FindChildWithRules should use an MRU cache

RESOLVED FIXED in mozilla1.9alpha1

Status

()

Core
CSS Parsing and Computation
P2
normal
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
mozilla1.9alpha1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [patch])

Attachments

(1 attachment)

(Assignee)

Description

12 years ago
There's currently no good reason for nsStyleContext's child lists to be doubly linked.  Furthermore, making them singly linked would force insertion at the beginning of the list, which would make the optimization in FindChildWithRules considerably more useful, I suspect, since it would look at the 10 most recently created children instead of the 10 least.  FindChildWithRules could even promote to the beginning of the list (and could also not have duplicated code for the two child lists).
(Assignee)

Comment 1

12 years ago
Well, maybe not -- I wasn't thinking about RemoveChild.  But I'd still like to make FindChildWithRules more effective...
Summary: nsStyleContext child list should be singly linked → FindChildWithRules should use an MRU cache
(Assignee)

Comment 2

12 years ago
Created attachment 220064 [details] [diff] [review]
patch

Not yet tested.
(Assignee)

Comment 3

12 years ago
Comment on attachment 220064 [details] [diff] [review]
patch

This also condenses a bunch of things that operate either on mChild or mEmptyChild.
Attachment #220064 - Flags: superreview?(bzbarsky)
Attachment #220064 - Flags: review?(bzbarsky)
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [patch]
Target Milestone: --- → mozilla1.9alpha
Attachment #220064 - Flags: superreview?(bzbarsky)
Attachment #220064 - Flags: superreview+
Attachment #220064 - Flags: review?(bzbarsky)
Attachment #220064 - Flags: review+
(Assignee)

Comment 4

12 years ago
Fix checked in to trunk.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.