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

Issue 2836753002: Rebuild layout tree in flat tree order. (Closed)

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

Description

Rebuild layout tree in flat tree order. Marking the DOM for layout tree rebuild and the actual rebuilding is now contained in the lifecycle update at a point where the shadow dom distribution is up-to-date. We can therefore safely mark the flat-tree ancestor chain without risking that it's broken by a distribution. The point of doing RebuildLayoutTree in flat tree order is that layout boxes can then be re-attached in the layout tree order which makes it simpler to handle whitespace reattachment. For shadow trees and slotted elements, when using the shadow-including tree order, we could have elements rebuild their layout boxes in an order arbitrarily decided by the slot assignments and slot positions in the shadow tree. Note that while the RebuildLayoutTree traversal used to happen in the shadow-including order, the layout attachment already happens in the flat tree order. See [1] for a plan to fix correctness and performance of whitespace re-attachment. This CL is doing the following changes: 1. Modify MarkAncestorsWithChildNeedsReattachLayoutTree to mark flat tree ancestry. 2. Rebuild distributed children for InsertionPoint and HTMLSlotElement. These children were rebuilt after their host's shadow tree before this change. 3. Factored out RebuildLayoutTreeForChild() as common code for both walking light tree children in ContainerNode, and distributed children in InsertionPoint and HTMLSlotElement. 4. Made FinalDestinationSlot() a member of node instead of a static function as it is now needed in multiple files. [1] http://bit.ly/2ozyBdx Review-Url: https://codereview.chromium.org/2836753002 Cr-Commit-Position: refs/heads/master@{#471188} Committed: https://chromium.googlesource.com/chromium/src/+/5e53c60ebe374282c8c2864a8e6d1d864afa221a

Patch Set 1 #

Patch Set 2 : Mark host ancestor for non-slotted. #

Patch Set 3 : Rebased #

Patch Set 4 : Removed in-progress work #

Patch Set 5 : Made FinalDestinationSlot a method on Node. #

Patch Set 6 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -33 lines) Patch
M third_party/WebKit/Source/core/dom/ContainerNode.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ContainerNode.cpp View 1 2 3 4 5 1 chunk +35 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.cpp View 1 2 3 4 5 2 chunks +31 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp View 1 2 3 4 3 chunks +2 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/dom/shadow/InsertionPoint.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLSlotElement.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLSlotElement.cpp View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (10 generated)
rune
While reviewing this, you should take a look at the design document if you haven't ...
3 years, 7 months ago (2017-04-27 11:10:02 UTC) #7
meade_UTC10
This seems fine to me, but I'm not super familiar with this code - I ...
3 years, 7 months ago (2017-04-28 07:44:47 UTC) #8
esprehn
I'm not sure I understand this change, you say: "Rebuild distributed children for InsertionPoint and ...
3 years, 7 months ago (2017-04-28 23:18:10 UTC) #9
rune
On 2017/04/28 23:18:10, esprehn wrote: > I'm not sure I understand this change, you say: ...
3 years, 7 months ago (2017-05-02 08:29:21 UTC) #10
nainar
Ran through the code and used your test case to step through the code. Makes ...
3 years, 7 months ago (2017-05-04 07:04:37 UTC) #11
rune
On 2017/05/04 07:04:37, nainar wrote: > Ran through the code and used your test case ...
3 years, 7 months ago (2017-05-04 08:35:54 UTC) #12
rune
On 2017/05/04 08:35:54, rune wrote: > On 2017/05/04 07:04:37, nainar wrote: > > Ran through ...
3 years, 7 months ago (2017-05-05 13:34:38 UTC) #13
esprehn
lgtm
3 years, 7 months ago (2017-05-11 22:28:41 UTC) #14
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/2836753002/100001
3 years, 7 months ago (2017-05-11 22:51:40 UTC) #17
commit-bot: I haz the power
3 years, 7 months ago (2017-05-12 02:27:24 UTC) #20
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/5e53c60ebe374282c8c2864a8e6d...

Powered by Google App Engine
This is Rietveld 408576698