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

Issue 2398293003: Move Layout Tree Construction code into Element::rebuildLayoutTree() (Closed)

Created:
4 years, 2 months ago by nainar
Modified:
4 years, 1 month ago
Reviewers:
esprehn, Bugs Nash
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, Bugs Nash, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof, webcomponents-bugzilla_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move Layout Tree Construction code into Element::rebuildLayoutTree() This patch uses the two dirty bits (NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree) on Node and adds the relevant getters/setters for them. It makes rebuildLayoutTree() public to be accessed in Document.cpp. It also moves reattachWhitespaceSiblingsIfNeeded() to rebuildLayoutTree() and uses dirtyBits to call either reattachLayoutTree() on node itself or call rebuildLayoutTree() on children nodes. Also added some comments explaining some design decisions. Will be removed upon completion of separation. BUG=595137 Committed: https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee Committed: https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87 Cr-Original-Commit-Position: refs/heads/master@{#426353} Cr-Commit-Position: refs/heads/master@{#427612}

Patch Set 1 #

Patch Set 2 : Add option 2: store the textSibling passed to recalcStyle() and use that information in rebuildLayo… #

Patch Set 3 : Run git cl format third_party/WebKit #

Total comments: 3

Patch Set 4 : Changes to assertLayoutTreeUpdated #

Patch Set 5 : Clear nextTextSibling pointer where there is a LayoutObject between the element and text node #

Total comments: 4

Patch Set 6 : Assert NOTREACHED in case of childNeedsReattachLayoutTree() -> currently dead code. Factor out n^2 … #

Patch Set 7 : remove reattachPseudoElementLayoutTree() since its dead code for now #

Total comments: 6

Patch Set 8 : Bugs' comments #

Total comments: 6

Patch Set 9 : Addressing bugsnash@ comments #

Total comments: 10

Patch Set 10 : made @esprehn's changes #

Total comments: 1

Patch Set 11 : remove extraneous variable nextTextSibling in Element::recalcStyle #

Patch Set 12 : Final patch to land #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -9 lines) Patch
M third_party/WebKit/Source/core/dom/ContainerNode.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 4 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +24 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.h View 1 2 3 4 5 6 7 8 2 chunks +18 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.cpp View 1 2 3 4 5 6 7 8 9 11 3 chunks +24 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Text.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp View 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 88 (65 generated)
nainar
CL for src perf tryjob to run blink_style.top_25 benchmark on all platform(s)
4 years, 2 months ago (2016-10-07 03:53:38 UTC) #12
nainar
esprehn, Uploading this patch for a design review, PTAL? Thanks! :) https://codereview.chromium.org/2398293003/diff/40001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (left): ...
4 years, 2 months ago (2016-10-07 05:05:05 UTC) #16
nainar
Moving bugsnash from cc to a reviewer.
4 years, 2 months ago (2016-10-09 23:11:10 UTC) #18
esprehn
https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Source/core/dom/Element.cpp#newcode2001 third_party/WebKit/Source/core/dom/Element.cpp:2001: for (Node* child = firstChild(); child && child->isElementNode(); this ...
4 years, 2 months ago (2016-10-10 21:50:43 UTC) #28
nainar
Elliott, PTAL? Thanks! https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Source/core/dom/Element.cpp#newcode2001 third_party/WebKit/Source/core/dom/Element.cpp:2001: for (Node* child = firstChild(); child ...
4 years, 2 months ago (2016-10-10 22:56:34 UTC) #32
Bugs Nash
https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1998 third_party/WebKit/Source/core/dom/Element.cpp:1998: else if (childNeedsReattachLayoutTree()) I think this would be better ...
4 years, 2 months ago (2016-10-14 00:36:47 UTC) #39
nainar
@bugsnash, Made the changes you asked for. PTAL? Thanks! https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1998 third_party/WebKit/Source/core/dom/Element.cpp:1998: ...
4 years, 2 months ago (2016-10-14 03:28:10 UTC) #42
Bugs Nash
https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1996 third_party/WebKit/Source/core/dom/Element.cpp:1996: if (needsReattachLayoutTree()) what is the purpose of this check? ...
4 years, 2 months ago (2016-10-17 00:17:05 UTC) #45
nainar
@bugsnash, Made the changes requested. PTAL? Thanks! https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1996 third_party/WebKit/Source/core/dom/Element.cpp:1996: if (needsReattachLayoutTree()) ...
4 years, 2 months ago (2016-10-17 16:29:12 UTC) #48
esprehn
https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1893 third_party/WebKit/Source/core/dom/Element.cpp:1893: clearChildNeedsReattachLayoutTree(); Note that once you start walking the tree ...
4 years, 2 months ago (2016-10-17 21:36:26 UTC) #53
nainar
@esprehn, Made the changes you asked for, PTAL? Thanks! https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1893 third_party/WebKit/Source/core/dom/Element.cpp:1893: ...
4 years, 2 months ago (2016-10-18 00:04:41 UTC) #55
esprehn
This introduced an n^2 looking for the next text sibling which makes me a little ...
4 years, 2 months ago (2016-10-18 02:00:10 UTC) #59
esprehn
lgtm
4 years, 2 months ago (2016-10-18 02:00:17 UTC) #60
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/2398293003/240001
4 years, 2 months ago (2016-10-19 22:05:33 UTC) #70
commit-bot: I haz the power
Committed patchset #12 (id:240001)
4 years, 2 months ago (2016-10-20 00:31:32 UTC) #71
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee Cr-Commit-Position: refs/heads/master@{#426353}
4 years, 2 months ago (2016-10-21 13:13:53 UTC) #73
nainar
Going to revert this patch as it is suspected to cause crbug.com/658322. Since I am ...
4 years, 2 months ago (2016-10-22 06:13:22 UTC) #74
nainar
A revert of this CL (patchset #12 id:240001) has been created in https://codereview.chromium.org/2439973005/ by nainar@chromium.org. ...
4 years, 2 months ago (2016-10-22 06:14:16 UTC) #75
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/2398293003/240001
4 years, 1 month ago (2016-10-26 04:31:47 UTC) #77
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_x86-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-generic_chromium_compile_only_ng/builds/223580)
4 years, 1 month ago (2016-10-26 04:47:25 UTC) #79
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/2398293003/240001
4 years, 1 month ago (2016-10-26 06:21:25 UTC) #85
commit-bot: I haz the power
Committed patchset #12 (id:240001)
4 years, 1 month ago (2016-10-26 06:35:36 UTC) #86
commit-bot: I haz the power
4 years, 1 month ago (2016-10-26 06:37:52 UTC) #88
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87
Cr-Commit-Position: refs/heads/master@{#427612}

Powered by Google App Engine
This is Rietveld 408576698