DescriptionReplace style sharing cousin list search with LRU
The current implementation of style sharing uses a very confusing set of methods to
search a node's cousins in an attempt to find other nodes to share style with. This
patch replaces this confusing method with a simple LRU that allows us to find
nodes to share with even if they're not our cousins.
Re-worked to be simpler in the lazy-attach world (thanks esprehn & ojan!).
Previous commits of this change had perf regressions, the last of which should be
handled by only adding elements to the style sharing LRU during recalcStyle if sharing
is indeed possible for the element. Without this, in the degenerate case where there's
a large document and no elements can share style (like the fixed-grid-lots-of-data
performance test) we'd end up doing more work.
Because this change introduces RefPtrs that can hold onto nodes while the style
resolver is active, Internal gc functions are updated to clear the style sharing list.
Previous codereviews https://codereview.chromium.org/23075004/ and
https://chromiumcodereview.appspot.com/23049008
BUG=272363, 286376
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157646
Patch Set 1 #
Total comments: 7
Patch Set 2 : Updating with esprehn's changes #
Messages
Total messages: 5 (0 generated)
|