Closed Bug 511147 Opened 16 years ago Closed 16 years ago

Optimize a > b ~ c as well as a b ~ c in SelectorMatchesTree

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: zwol, Assigned: zwol)

References

Details

Attachments

(1 file)

I noticed this while working on bug 508466. In one branch of SelectorMatchesTree, there is this logic: // to avoid greedy matching, we need to recur if this is a // descendant or general sibling combinator and the next // combinator is different, but we can make an exception for // sibling, then parent, since a sibling's parent is always the // same. if ((NS_IS_GREEDY_OPERATOR(selector->mOperator)) && (selector->mNext) && (selector->mNext->mOperator != selector->mOperator) && !(selector->mOperator == '~' && selector->mNext->mOperator == PRUnichar(0))) { The last part of the condition exempts 'a b ~ c' from recursion, but the rationale in the comment applies equally to 'a > b ~ c'. In testing, adding an additional exemption for selector->mNext->mOperator == '>' seems to be safe. Patch to follow shortly. Blocking 508466 only because both this and that need to modify this part of the code.
Attached patch patchSplinter Review
Attachment #395098 - Flags: review?(dbaron)
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
OS: Linux → All
Priority: -- → P4
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: