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

Issue 2822113002: Do not set a distribution recalc flag when v1 shadow tree is added (Closed)

Created:
3 years, 8 months ago by hayato
Modified:
3 years, 8 months ago
Reviewers:
kochi
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof, webcomponents-bugzilla_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not set a distribution recalc flag when v1 shadow tree is added After rewriting Shadow DOM distribution engine for v1 [1], we no longer need to set a distribution recalc flag when a v1 shadow tree is added. A distribution recalc flag will be set correctly later, if necessary, when a slot is inserted, removed, or other relevant DOM mutation happens. Instead of setting recalc flag, host's children need to be lazy reattached in adding a shadow root, which would be done in resolve assignments if we set a distribution recalc flag. This optimization would make loading slightly faster when there are many shadow trees which will not have a slot because we do not need to traverse down the trees. In the case of bug 699838, this can make loading 5ms (at most) faster. [1] https://codereview.chromium.org/1995203002 BUG=712559 Review-Url: https://codereview.chromium.org/2822113002 Cr-Commit-Position: refs/heads/master@{#465547} Committed: https://chromium.googlesource.com/chromium/src/+/a9c70fe4e42df88f817cb00cbc13a98b7727d99f

Patch Set 1 #

Patch Set 2 : retry #

Patch Set 3 : try #

Patch Set 4 : try #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -1 line) Patch
A third_party/WebKit/LayoutTests/shadow-dom/layout-1.html View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/shadow-dom/layout-1-expected.html View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp View 1 2 3 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 35 (25 generated)
hayato
PTAL
3 years, 8 months ago (2017-04-18 07:43:45 UTC) #7
kochi
LGTM Below is more of a question than a comment: Even without this change, when ...
3 years, 8 months ago (2017-04-18 08:24:33 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2822113002/1
3 years, 8 months ago (2017-04-19 00:44:20 UTC) #12
hayato
retry
3 years, 8 months ago (2017-04-19 06:52:59 UTC) #14
hayato
try
3 years, 8 months ago (2017-04-19 07:17:08 UTC) #17
hayato
try
3 years, 8 months ago (2017-04-19 08:10:46 UTC) #23
hayato
On 2017/04/18 at 08:24:33, kochi wrote: > LGTM > > Below is more of a ...
3 years, 8 months ago (2017-04-19 10:35:27 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2822113002/60001
3 years, 8 months ago (2017-04-19 10:36:28 UTC) #31
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/a9c70fe4e42df88f817cb00cbc13a98b7727d99f
3 years, 8 months ago (2017-04-19 10:42:31 UTC) #34
kochi
3 years, 8 months ago (2017-04-20 02:29:06 UTC) #35
Message was sent while issue was closed.
On 2017/04/19 10:35:27, hayato wrote:
> On 2017/04/18 at 08:24:33, kochi wrote:
> > LGTM
> > 
> > Below is more of a question than a comment:
> > 
> > Even without this change, when no slot is in the V1 shadow
> > root, can SlotAssignment::ResolveDistribution() be almost
> > no-op?
> > 
> >
>
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/shado...
> > 
> > ResolveDistribution() calls ResolveAssignment(),
> > which calls DetachNotAssignedNode() for all children
> > of shadow host.  Is the time saved with this change
> > mostly spent in DetachNotAssignedNode() then??
> 
> No. What can be saved are the *number* of calling ResolveAssignment and tree
> traversing cost.
> RecalcDistribution is a recursive operation. We have to traverse every shadow
> trees, calling RessolveDistribution N times (N == the number of custom
> elements).

I see, thanks for the explanation!

Powered by Google App Engine
This is Rietveld 408576698