maqetta/maqetta — Issue #1760: Support pseudo selectors when doing selector compares 
Author: billreed63
Created: 2012-02-16 21:23:33+00:00
State: open
Labels: Feature, Model, Priority Low

Mobile button the cascade includes the .mblButtonDisabled, .mblButton:disabled (project1/themes/android/android.css line: This seem wrong

I did some digging on this and here is what seems to be happening

IN Context.js line 2454 we call CSSFile.getMatchingRule(), which then calls CSSRule.match(), which calls CSSSelector.match(node)

In CSSSelector match we are looking for the selector that matches a class on the node that was passed in.

we fall through to this bit of code around line 99

````
var found = false;
for ( var i = 0; i < classes.length; i++ )
if (found = (classes[i] == this.cls))
break;
if (!found)
return -1;
specific += 10;
anymatches = true;

````
where we compare the selector class ````this.cls```` to the node class ```classes[i]``` In the case of a selector of type

````mblButton:disabled```` the CSSSelector object has separated them into a class and a pseudoRule and we only compare the class.

````
this: a
children: Array[0]
cls: "mblButton"
elementType: "CSSSelector"
endOffset: 60799
name: ""
parent: a
pseudoRule: "disabled"
startOffset: 60778
````