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)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a1
People
(Reporter: zwol, Assigned: zwol)
References
Details
Attachments
(1 file)
5.90 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•16 years ago
|
||
Attachment #395098 -
Flags: review?(dbaron)
Comment on attachment 395098 [details] [diff] [review]
patch
r=dbaron
Attachment #395098 -
Flags: review?(dbaron) → review+
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
I'll land this later today.
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.
Description
•