|
|
Created:
4 years, 2 months ago by nainar Modified:
4 years, 1 month ago 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. |
DescriptionMove 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 #Dependent Patchsets: Messages
Total messages: 88 (65 generated)
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Run git cl format third_party/WebKit Make rebuildLayoutTree() public to be accessed in Document.cpp Add ability to reattach the Layout Tree of PseudoElements by calling reattachPseudoElementLayoutTree() in rebuildLayoutTree(). Also added some comments explaining some design decisions. Move reattachWhitespaceSiblingsIfNeeded() to rebuildLayoutTree() and use dirtyBits to call either reattachLayoutTree() on node itself or call rebuildLayoutTree on children nodes. Note that the following test still fails: fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html Set NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node This patch sets the NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node correctly in Element::recalcOwnStyle. BUG=595137 patch from issue 2375293002 at patchset 80001 (http://crrev.com/2375293002#ps80001) ========== to ========== WIP CL Run git cl format third_party/WebKit Make rebuildLayoutTree() public to be accessed in Document.cpp Add ability to reattach the Layout Tree of PseudoElements by calling reattachPseudoElementLayoutTree() in rebuildLayoutTree(). Also added some comments explaining some design decisions. Move reattachWhitespaceSiblingsIfNeeded() to rebuildLayoutTree() and use dirtyBits to call either reattachLayoutTree() on node itself or call rebuildLayoutTree on children nodes. Note that the following test still fails: fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html Set NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node This patch sets the NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node correctly in Element::recalcOwnStyle. patch from issue 2375293002 at patchset 80001 (http://crrev.com/2375293002#ps80001) BUG=595137 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== WIP CL Run git cl format third_party/WebKit Make rebuildLayoutTree() public to be accessed in Document.cpp Add ability to reattach the Layout Tree of PseudoElements by calling reattachPseudoElementLayoutTree() in rebuildLayoutTree(). Also added some comments explaining some design decisions. Move reattachWhitespaceSiblingsIfNeeded() to rebuildLayoutTree() and use dirtyBits to call either reattachLayoutTree() on node itself or call rebuildLayoutTree on children nodes. Note that the following test still fails: fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html Set NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node This patch sets the NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node correctly in Element::recalcOwnStyle. patch from issue 2375293002 at patchset 80001 (http://crrev.com/2375293002#ps80001) BUG=595137 ========== to ========== WIP CL Run git cl format third_party/WebKit Add option 2: store the textSibling passed to recalcStyle() and use that information in rebuildLayoutTree() Make rebuildLayoutTree() public to be accessed in Document.cpp Add ability to reattach the Layout Tree of PseudoElements by calling reattachPseudoElementLayoutTree() in rebuildLayoutTree(). Also added some comments explaining some design decisions. Move reattachWhitespaceSiblingsIfNeeded() to rebuildLayoutTree() and use dirtyBits to call either reattachLayoutTree() on node itself or call rebuildLayoutTree on children nodes. Note that the following test still fails: fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html Set NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node This patch sets the NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node correctly in Element::recalcOwnStyle. patch from issue 2375293002 at patchset 80001 (http://crrev.com/2375293002#ps80001) BUG=595137 ==========
The CQ bit was unchecked by nainar@chromium.org
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CL for src perf tryjob to run blink_style.top_25 benchmark on all platform(s)
Patchset #4 (id:60001) has been deleted
Description was changed from ========== WIP CL Run git cl format third_party/WebKit Add option 2: store the textSibling passed to recalcStyle() and use that information in rebuildLayoutTree() Make rebuildLayoutTree() public to be accessed in Document.cpp Add ability to reattach the Layout Tree of PseudoElements by calling reattachPseudoElementLayoutTree() in rebuildLayoutTree(). Also added some comments explaining some design decisions. Move reattachWhitespaceSiblingsIfNeeded() to rebuildLayoutTree() and use dirtyBits to call either reattachLayoutTree() on node itself or call rebuildLayoutTree on children nodes. Note that the following test still fails: fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html Set NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node This patch sets the NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node correctly in Element::recalcOwnStyle. patch from issue 2375293002 at patchset 80001 (http://crrev.com/2375293002#ps80001) BUG=595137 ========== to ========== WIP CL: 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 adds the ability to reattach the Layout Tree of PseudoElements by creating and calling reattachPseudoElementLayoutTree() in rebuildLayoutTree(). 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. These are temporary and will be removed later. Note that the following test still fails: fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html Uploading this patch for a design review only BUG=595137 ==========
nainar@chromium.org changed reviewers: + esprehn@chromium.org
esprehn, Uploading this patch for a design review, PTAL? Thanks! :) https://codereview.chromium.org/2398293003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Element.cpp (left): https://codereview.chromium.org/2398293003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Element.cpp:1898: Moved this to rebuildLayoutTree() https://codereview.chromium.org/2398293003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Element.cpp:2010: // This is information passed on to recalcStyle from recalcDescendantStyles Need to decide if this method is preferable or whether we want to store the Text node from recalcStyle and use that here in rebuildLayoutTree https://codereview.chromium.org/2398293003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Element.h (right): https://codereview.chromium.org/2398293003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Element.h:403: StyleRecalcChange rebuildLayoutTree(); Moved this here because it will need to be accessed in Document in a future CL
nainar@chromium.org changed reviewers: + bugsnash@chromium.org
Moving bugsnash from cc to a reviewer.
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== WIP CL: 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 adds the ability to reattach the Layout Tree of PseudoElements by creating and calling reattachPseudoElementLayoutTree() in rebuildLayoutTree(). 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. These are temporary and will be removed later. Note that the following test still fails: fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html Uploading this patch for a design review only BUG=595137 ========== to ========== WIP CL: 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 adds the ability to reattach the Layout Tree of PseudoElements by creating and calling reattachPseudoElementLayoutTree() in rebuildLayoutTree(). 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. These are temporary and will be removed later. BUG=595137 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2001: for (Node* child = firstChild(); child && child->isElementNode(); this breaks at the first non element, ex. text or comment. you need: if (node->isElementNode()) inside the loop. Also you don't handle Shadow DOM here, you need to iterate the ShadowRoots first, see how ::recalcStyle does this: for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { Actually I think this entire side of the branch is unreachable because you only call this inside recalcOwnStyle right now right after calling setNeedsReattachLayoutTree() we always take the needsReattachLayoutTree(). Maybe we remove this side of the if statement and make it NOTREACHED() for this patch. The next patch that move rebuildLayoutTree to be it's own step in updateStyle() will fill it in. https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2015: for (Node* child = parentNode()->lastChild(); child; This is n^2, if you appendChild 500 elements, this always iterates from the end to yourself. I think we want to just start at |this| and iterate until we find the next whitespace sibling.
Description was changed from ========== WIP CL: 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 adds the ability to reattach the Layout Tree of PseudoElements by creating and calling reattachPseudoElementLayoutTree() in rebuildLayoutTree(). 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. These are temporary and will be removed later. BUG=595137 ========== to ========== 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 ==========
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Elliott, PTAL? Thanks! https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2001: for (Node* child = firstChild(); child && child->isElementNode(); Added NOTREACHED() here and noted the changes needed for a future patch. https://codereview.chromium.org/2398293003/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2015: for (Node* child = parentNode()->lastChild(); child; Done. Starting iteration from this->nextSibling. Can change this to checking in the if condition that the node in consideration is not this itself.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1998: else if (childNeedsReattachLayoutTree()) I think this would be better as a DCHECK https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2004: // (like WebKit does). I wouldn't include what webkit does in a comment - it might change https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2009: if (sibling->isElementNode() && toElement(sibling)->layoutObject()) { could avoid this branch by adding it to the for loop conditional
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
@bugsnash, Made the changes you asked for. PTAL? Thanks! https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1998: else if (childNeedsReattachLayoutTree()) Done. https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2004: // (like WebKit does). Done. https://codereview.chromium.org/2398293003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2009: if (sibling->isElementNode() && toElement(sibling)->layoutObject()) { Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1996: if (needsReattachLayoutTree()) what is the purpose of this check? it doesn't seem necessary at this point https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1999: DCHECK(!childNeedsReattachLayoutTree()); add a comment explaining why we expect this DCHECK to be true (i.e. reattachLayoutTree handles the children) https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2002: Text* nextTextSibling = nullptr; the comment about the trade off between storage and calculation was good, I just meant to remove the part about webkit. I think this would be better separated into its own method nextTextSibling(), possibly on Node, which can return null if the next sibling is not an Element or doesn't have a layout object. In future once Text mirrors Element this could even be called from within reattachWhitespaceSiblings itself instead of being passed here.
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
@bugsnash, Made the changes requested. PTAL? Thanks! https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1996: if (needsReattachLayoutTree()) Moved to a DCHECK and added an explainer comment here as well. https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1999: DCHECK(!childNeedsReattachLayoutTree()); Done. https://codereview.chromium.org/2398293003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2002: Text* nextTextSibling = nullptr; Edited the comment. Moved code to function.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== 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 ========== to ========== 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 ==========
Description was changed from ========== 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 ========== to ========== 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 ==========
https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1893: clearChildNeedsReattachLayoutTree(); Note that once you start walking the tree you're not going to want to clear the clearChildNeedsReattachLayoutTree bit here. These bits should only be touched inside reattachLayoutTree. https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1990: AttachContext reattachContext; DCHECK(inActiveDocument()) in this function https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2002: DCHECK(!childNeedsReattachLayoutTree()); DCHECK(parentNode()); DCHECK(parentNode()->childNeedsReattachLayoutTree()); https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Node.cpp:396: !(sibling->isElementNode() && toElement(sibling)->layoutObject()); Run demorgans :) (!sibling->isElementNode() || !toElement(sibling)->layoutObject()) https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp (right): https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp:136: clearChildNeedsReattachLayoutTree(); ditto, you won't want to touch the reattach bits in recalcStyle once you start tree walking inside reattachLayoutTree.
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
@esprehn, Made the changes you asked for, PTAL? Thanks! https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1893: clearChildNeedsReattachLayoutTree(); Done. https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1990: AttachContext reattachContext; Done. https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:2002: DCHECK(!childNeedsReattachLayoutTree()); Done. https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Node.cpp:396: !(sibling->isElementNode() && toElement(sibling)->layoutObject()); Done. https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp (right): https://codereview.chromium.org/2398293003/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp:136: clearChildNeedsReattachLayoutTree(); Done.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
This introduced an n^2 looking for the next text sibling which makes me a little nervous but I say let's go for it and figure out it later. Speaking of there's n^2 protection in the form of needsAttach() getter that's used during layout tree construction. We need to figure out how to make that work in the next patch by looking at the bits you added here. https://codereview.chromium.org/2398293003/diff/200001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/dom/Element.cpp (left): https://codereview.chromium.org/2398293003/diff/200001/third_party/WebKit/Sou... third_party/WebKit/Source/core/dom/Element.cpp:1898: reattachWhitespaceSiblingsIfNeeded(nextTextSibling); We don't need the nextTextSibling here anymore so we could remove the argument in a follow up patch?
lgtm
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by nainar@chromium.org
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by nainar@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from esprehn@chromium.org Link to the patchset: https://codereview.chromium.org/2398293003/#ps240001 (title: "Final patch to land")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #12 (id:240001)
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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 Cr-Commit-Position: refs/heads/master@{#426353} ==========
Message was sent while issue was closed.
Patchset 12 (id:??) landed as https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee Cr-Commit-Position: refs/heads/master@{#426353}
Message was sent while issue was closed.
Going to revert this patch as it is suspected to cause crbug.com/658322. Since I am OOO - I can't actually investigate till I get into Sydney. So going to revert to be safe.
Message was sent while issue was closed.
A revert of this CL (patchset #12 id:240001) has been created in https://codereview.chromium.org/2439973005/ by nainar@chromium.org. The reason for reverting is: Suspected to cause crbug.com/658322..
The CQ bit was checked by nainar@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
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-ge...)
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by nainar@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #12 (id:240001)
Message was sent while issue was closed.
Description was changed from ========== 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 Cr-Commit-Position: refs/heads/master@{#426353} ========== to ========== 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} ==========
Message was sent while issue was closed.
Patchset 12 (id:??) landed as https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87 Cr-Commit-Position: refs/heads/master@{#427612} |