{
final CSSStyleRule[] activeStyleRules = styleRuleMatcher.getMatchingRules(element);
// sort ...
Arrays.sort(activeStyleRules, new CSSStyleRuleComparator());
SelectorWeight oldSelectorWeight = null;
for (int i = 0; i < activeStyleRules.length; i++)
{
final CSSStyleRule activeStyleRule = activeStyleRules[i];
final CSSSelector selector = activeStyleRule.getSelector();
final SelectorWeight activeWeight = selector.getWeight();
if (oldSelectorWeight != null)
{
if (oldSelectorWeight.compareTo(activeWeight) > 0)
{