Weight calculation wrong for selectors involving pseudo-elements

RESOLVED FIXED

Status

()

RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

Trunk
x86
Mac OS X
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 408078 [details]
Testcase

This is a regression from bug 520848, pointed out in bug 508466 comment 17.  Testcase attached.

The key issue is the removal of the weight += listSel->CalcWeight() call in the old !IsSinglePseudoClass(*listSel) branch under (!nsCSSPseudoClasses::IsPseudoClass(pseudoClassList->mAtom)).
Oh, and we're no longer dropping rules with multiple pseudo-elements, though at least I suspect we're not matching them...
Comment on attachment 408089 [details] [diff] [review]
Fix

Looks good.

CSS2.1 does say that pseudo-elements contribute to the 'd' component of the specificity (== the low byte of the weight) but I cannot presently think of a situation where it matters, and maybe that should be a follow-up bug.
Attachment #408089 - Flags: review?(zweinberg) → review+
Yeah, I can't think of a situation where it matters either, until we support selectors with more than one pseudo-element in them.  And even then it might not.
Pushed http://hg.mozilla.org/mozilla-central/rev/cfe85c2bbc53
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.