Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Issue 1131493008: WIP: Move StyleEngine::m_activeTreeScopes to TreeScope::m_childTreeScopesWithActiveStyleSheets (Closed)

Created:
5 years, 7 months ago by kojii
Modified:
5 years, 6 months ago
Reviewers:
hayato, esprehn, tasak, rune, kochi
CC:
blink-reviews, blink-reviews-style_chromium.org, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, rwlbuis, kochi
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Move 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+321 lines, -156 lines) Patch
M Source/core/dom/StyleEngine.h View 1 2 3 4 5 6 chunks +5 lines, -51 lines 0 comments Download
M Source/core/dom/StyleEngine.cpp View 1 2 3 4 5 14 chunks +28 lines, -104 lines 0 comments Download
M Source/core/dom/TreeScope.h View 1 2 3 4 5 3 chunks +95 lines, -1 line 0 comments Download
M Source/core/dom/TreeScope.cpp View 1 2 3 4 5 6 chunks +190 lines, -0 lines 0 comments Download
M Source/core/dom/shadow/ShadowRoot.cpp View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
kojii
PTAL.
5 years, 7 months ago (2015-05-22 07:34:59 UTC) #2
kochi
Sorry for the delay. This is my first round of comments. More to follow. https://codereview.chromium.org/1131493008/diff/60001/Source/core/dom/StyleEngine.cpp ...
5 years, 7 months ago (2015-05-26 01:52:35 UTC) #5
kojii
Thank you for the review. Comments follow. https://codereview.chromium.org/1131493008/diff/60001/Source/core/dom/StyleEngine.cpp File Source/core/dom/StyleEngine.cpp (left): https://codereview.chromium.org/1131493008/diff/60001/Source/core/dom/StyleEngine.cpp#oldcode486 Source/core/dom/StyleEngine.cpp:486: document().clearScopedStyleResolver(); On ...
5 years, 7 months ago (2015-05-26 05:21:58 UTC) #6
esprehn
I'll look over this tomorrow. To unsubscribe from this group and stop receiving emails from ...
5 years, 7 months ago (2015-05-26 05:31:24 UTC) #7
rune
Looking a bit into this. Comments so far: We currently need to keep an ordered ...
5 years, 7 months ago (2015-05-26 12:23:54 UTC) #8
kojii
Thanks for your comments. On 2015/05/26 12:23:54, rune wrote: > Looking a bit into this. ...
5 years, 7 months ago (2015-05-27 02:15:27 UTC) #9
kojii
Briefly talked with tasak@, he agreed that we could get rid of the sorting at ...
5 years, 7 months ago (2015-05-27 03:40:53 UTC) #10
rune
On 2015/05/27 02:15:27, koji wrote: > Inspector needs the sorted list, though I'm not familiar ...
5 years, 7 months ago (2015-05-27 11:00:18 UTC) #11
kojii
5 years, 6 months ago (2015-06-09 03:32:15 UTC) #12
Closing this CL as I reached a consensus to get rid of the sorting with
Inspector team.

Powered by Google App Engine
This is Rietveld 408576698