/**
*/
protected short preNode(ICSSNode node) {
if (node instanceof ICSSStyleRule) {
// style rule
ICSSStyleRule style = (ICSSStyleRule) node;
ICSSSelectorList list = style.getSelectors();
int nSelectors = list.getLength();
int maxSpecificity = -1;
for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
// Check each Selector Lists
ICSSSelector selector = list.getSelector(iSelector);
int specificity = selector.getSpecificity();
if (maxSpecificity < specificity && selector.match(element, pseudoName)) {
maxSpecificity = specificity;
}
}
if (maxSpecificity >= 0) {
// apply this style to the element
overwriteDeclaration((ICSSStyleDeclaration) style.getStyle(), maxSpecificity);
}
return TRAV_PRUNE;
}
return TRAV_CONT;
}