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).
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
Comment on attachment 220064 [details] [diff] [review] patch This also condenses a bunch of things that operate either on mChild or mEmptyChild.
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla1.9alpha
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.