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

Issue 1853713002: Fixed ::slotted performance in pure v1 shadow documents. (Closed)

Created:
4 years, 8 months ago by rune
Modified:
4 years, 8 months ago
Reviewers:
hayato, dglazkov, kochi
CC:
chromium-reviews, blink-reviews-style_chromium.org, blink-reviews-css, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, apavlov+blink_chromium.org, darktears, blink-reviews, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixed ::slotted performance in pure v1 shadow documents. Instead of traversing all m_treeBoundaryCrossingScopes matching rules from other scopes, just walk the assignedSlot() chain for resolvers. This makes rule matching a lot cheaper since quite a lot of components have tree boundary crossing rules in practice (polymer apps using v0 typically have hundreds of such scopes). The assumption here is that the assignedSlot chain most of the time will be quite short and/or cheap to walk. Introducing a flag set in StyleEngine if there ever exists a v0 shadow tree to fall back to traversing m_treeBoundaryCrossingScopes when necessary. For the slotted.html demo in crbug.com/599833, the full recalc with ~4000 elements goes from ~800ms to ~40ms with this change when each shadow tree has a ::slotted rule. No substantial regression for the case without ::slotted rules. Added a test for /deep/ being used a descendant combinator in a document without shadow trees, as I feared I might have broken that and I couldn't find any existing tests for it. For later, we may choose to never collect m_treeBoundaryCrossingScopes for pure v1 documents, but that means we would have to recreate that collection once we add a v0 shadow to the document. R=kochi@chromium.org,hayato@chromium.org,dglazkov@chromium.org BUG=599833 Committed: https://crrev.com/34d768eb8c2c2bdd8e9cd259a0661b31d5f4c303 Cr-Commit-Position: refs/heads/master@{#384867}

Patch Set 1 #

Patch Set 2 : Missing Member<> in HeapVector template #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -5 lines) Patch
A third_party/WebKit/LayoutTests/fast/dom/shadow/apply-deep-in-document-scope.html View 1 chunk +11 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/dom/shadow/apply-deep-in-document-scope-expected.txt View 1 chunk +11 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp View 1 3 chunks +27 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleEngine.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleEngine.cpp View 1 chunk +8 lines, -2 lines 1 comment Download

Messages

Total messages: 17 (8 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1853713002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1853713002/1
4 years, 8 months ago (2016-04-01 11:22:30 UTC) #2
rune
ptal
4 years, 8 months ago (2016-04-01 11:23:13 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-01 12:30:44 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1853713002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1853713002/20001
4 years, 8 months ago (2016-04-01 13:47:25 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-01 14:55:33 UTC) #10
kochi
lgtm https://codereview.chromium.org/1853713002/diff/20001/third_party/WebKit/Source/core/dom/StyleEngine.cpp File third_party/WebKit/Source/core/dom/StyleEngine.cpp (right): https://codereview.chromium.org/1853713002/diff/20001/third_party/WebKit/Source/core/dom/StyleEngine.cpp#newcode743 third_party/WebKit/Source/core/dom/StyleEngine.cpp:743: m_shadowCascadeOrder = order; Aha, good catch! createShadowRoot() could ...
4 years, 8 months ago (2016-04-04 04:48:09 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1853713002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1853713002/20001
4 years, 8 months ago (2016-04-04 06:51:36 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 8 months ago (2016-04-04 08:35:00 UTC) #15
commit-bot: I haz the power
4 years, 8 months ago (2016-04-04 08:36:26 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/34d768eb8c2c2bdd8e9cd259a0661b31d5f4c303
Cr-Commit-Position: refs/heads/master@{#384867}

Powered by Google App Engine
This is Rietveld 408576698