DescriptionMove StyleEngine::m_activeTreeScopes to TreeScope::m_childTreeScopesWithActiveStyleSheets
*** SUSPENDED FOR FURTHER INVESTIGATIONS, NOT FOR LANDING ***
StyleEngine used to keep all TreeScopes that have StyleSheetCollections
in the document in the document order. When considering 1k or more
treeScopes in a document, sorting treeScopes in the document order becomes
more expensive and this sorting alone tends to consume 2-3% of total time
to build the DOM tree.
This patch moves the document-global ordered list to a list of direct
children in each TreeScope. Assuming shadow trees are usually nesteed at
some levels, this change helps faster determination of the document order
of TreeScopes.
It should also help to traverse descendant TreeScopes, which will be
needed as we move more to componentised StyleResolver.
Two ways to traverse TreeScopes with active StyleSheetCollections are
provided in this patch.
TreeScopesWithActiveStyleSheetsTraversal(TreeScope&) iterates the TreeScope
and its descendant TreeScopes that have active StyleSheetCollections.
Pass treeScope.childTreeScopesWithActiveStyleSheets() instead to iterate
only its descendants, excluding the treeScope.
BUG=401359, 433225
Patch Set 1 #Patch Set 2 : #Patch Set 3 : Remove wrong assert #Patch Set 4 : Skip TreeScopes without styleSheetCollection #
Total comments: 20
Patch Set 5 : Rebase #Patch Set 6 : Reflected kochi's review #
Messages
Total messages: 12 (3 generated)
|