Closed Bug 524175 Opened 15 years ago Closed 15 years ago

Weight calculation wrong for selectors involving pseudo-elements

Categories

(Core :: CSS Parsing and Computation, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(2 files)

Attached file 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...
Attached patch FixSplinter Review
Attachment #408089 - Flags: review?(zweinberg)
Blocks: 520848
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
Closed: 15 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: