StyleRule r = (StyleRule)rules.get(j);
SelectorList sl = r.getSelectorList();
int spec = 0;
int slen = sl.getLength();
for (int k = 0; k < slen; k++) {
ExtendedSelector s = (ExtendedSelector)sl.item(k);
if (s.match(elt, pseudo)) {
int sp = s.getSpecificity();
if (sp > spec) {
spec = sp;
}
}
}