code: function (element, ignoredClasses) {
  
  	this.element = element;
  	this.isDirectChild = true;
  	this.tag = element.localName;
  	this.tag = this.tag.replace(/:/g, '\\:');
  
  	// nth-of-child(n+1)
  	this.indexn = null;
  	this.index = 1;
  	this.id = null;
  	this.classes = new Array();
  
  	// do not add additinal info to html, body tags.
  	// html:nth-of-type(1) cannot be selected
  	if(this.tag === 'html' || this.tag === 'HTML'
  		|| this.tag === 'body' || this.tag === 'BODY') {
  		this.index = null;
  		return;
  	}
  
  	if (element.parentNode !== undefined) {
  		// nth-child
  		//this.index = [].indexOf.call(element.parentNode.children, element)+1;
  
  		// nth-of-type
  		for (var i = 0; i < element.parentNode.children.length; i++) {
  			var child = element.parentNode.children[i];
  			if (child === element) {
  				break;
  			}
  			if (child.tagName === element.tagName) {
  				this.index++;
  			}
  		}
  	}
  
  	if (element.id !== '') {
  		if (typeof element.id === 'string') {
  			this.id = element.id;
  			this.id = this.id.replace(/:/g, '\\:');
  		}
  	}
  
  	for (var i = 0; i < element.classList.length; i++) {
  		var cclass = element.classList[i];
  		if (ignoredClasses.indexOf(cclass) === -1) {
  			cclass = cclass.replace(/:/g, '\\:');
  			this.classes.push(cclass);
  		}
  	}
  }
docs: TODO refactor element selector list into a ~ class