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

Issue 15159008: Node::lazyAttach shouldn't lie about being attached (Closed)

Created:
7 years, 7 months ago by esprehn
Modified:
7 years, 7 months ago
CC:
blink-reviews, webcomponents-bugzilla_chromium.org, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org
Visibility:
Public.

Description

Node::lazyAttach shouldn't lie about being attached lazyAttach just needs to mark the node as needing a style recalc, there's no reason to mark the node as attached, or mark all the descendants as being attached. We also don't need to mark all descendants as needing a style recalc since Element::recalcStyle is going to transform the StyleChange into a Force when it goes to descendants. Now lazyAttach just marks you as needing a FullStyleChange and the later recalcStyle will mark you as attached. This means that after this patch attached() is equivalent to "ever had style recalc". In a future patch we should rename that flag. A benefit of this patch is that doing appendChild(divWithLotsOfDescendants); now does 2 fewer walks of the descendants because we don't need to mark them all as attached in lazyAttach, and we don't need to run detach() in recalcStyle() when it calls reattach. Another benefit is that Node::attach is no longer n^2 when you append many elements without any whitespace between them because the loop to fix up whitespace can bail out early when it sees !next->attached(). R=eseidel@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=150924

Patch Set 1 #

Patch Set 2 : Missing commit #

Total comments: 2

Patch Set 3 : Do a sync attach in lazyAttach if already in recalcStyle #

Patch Set 4 : Element::recalcStyle needs to setAttached now #

Patch Set 5 : Fix test #

Patch Set 6 : No really #

Patch Set 7 : Remove commented out line in test #

Total comments: 2

Patch Set 8 : Added comments #

Patch Set 9 : Rebase #

Patch Set 10 : Rebase again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -48 lines) Patch
M LayoutTests/fast/dom/shadow/shadow-root-attached.html View 2 chunks +2 lines, -0 lines 0 comments Download
M LayoutTests/fast/html/object-image-nested-fallback.html View 1 2 1 chunk +10 lines, -2 lines 0 comments Download
M LayoutTests/fast/overflow/overflow-height-float-not-removed-crash3-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/cache/subresource-expiration-1-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/http/tests/cache/subresource-expiration-2-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-mac/editing/selection/caret-ltr-2-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-mac/editing/selection/caret-ltr-2-left-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-mac/editing/selection/caret-ltr-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-mac/editing/selection/caret-ltr-right-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-mac/editing/selection/caret-rtl-2-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-mac/editing/selection/caret-rtl-2-left-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-mac/editing/selection/caret-rtl-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-mac/editing/selection/caret-rtl-right-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-win/editing/selection/caret-ltr-2-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-win/editing/selection/caret-ltr-2-left-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-win/editing/selection/caret-ltr-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-win/editing/selection/caret-ltr-right-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-win/editing/selection/caret-rtl-2-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-win/editing/selection/caret-rtl-2-left-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-win/editing/selection/caret-rtl-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/platform/chromium-win/editing/selection/caret-rtl-right-expected.txt View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/dom/Node.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -8 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 5 6 7 8 1 chunk +12 lines, -8 lines 0 comments Download
M Source/core/dom/Text.cpp View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download
M Source/core/dom/shadow/ElementShadow.cpp View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -3 lines 0 comments Download
M Source/core/dom/shadow/ShadowRoot.cpp View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M Source/core/html/HTMLDialogElement.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLFrameElementBase.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLObjectElement.cpp View 2 chunks +2 lines, -3 lines 0 comments Download
M Source/core/html/HTMLPlugInImageElement.cpp View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M Source/core/html/HTMLSelectElement.cpp View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
esprehn
The future is near.
7 years, 7 months ago (2013-05-16 22:13:35 UTC) #1
eseidel
lgtm I expect you're going to have fallout from this change which may take us ...
7 years, 7 months ago (2013-05-16 22:48:25 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/15159008/1001
7 years, 7 months ago (2013-05-16 22:48:33 UTC) #3
commit-bot: I haz the power
Retried try job too often on linux_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_layout_rel&number=8393
7 years, 7 months ago (2013-05-16 23:33:17 UTC) #4
dglazkov
Adding morrita, who'd seen/wrote a lot of this code. https://chromiumcodereview.appspot.com/15159008/diff/1001/LayoutTests/fast/dom/shadow/shadow-root-attached.html File LayoutTests/fast/dom/shadow/shadow-root-attached.html (right): https://chromiumcodereview.appspot.com/15159008/diff/1001/LayoutTests/fast/dom/shadow/shadow-root-attached.html#newcode24 LayoutTests/fast/dom/shadow/shadow-root-attached.html:24: ...
7 years, 7 months ago (2013-05-17 02:58:44 UTC) #5
esprehn
On 2013/05/17 02:58:44, Dimitri Glazkov wrote: > Adding morrita, who'd seen/wrote a lot of this ...
7 years, 7 months ago (2013-05-17 03:02:39 UTC) #6
esprehn
All the selection/* failures are 0x0 RenderTexts that are no longer produced. object-image-nested-fallback.html contains a ...
7 years, 7 months ago (2013-05-17 03:35:25 UTC) #7
Hajime Morrita
This change is theoretically correct. What we need is fix old pieces which depend on ...
7 years, 7 months ago (2013-05-17 04:01:24 UTC) #8
eseidel
I'm curious why you believe lazyAttached nodes to be in an inconsistent state? They're notes ...
7 years, 7 months ago (2013-05-17 04:35:29 UTC) #9
Hajime Morrita
On 2013/05/17 04:35:29, eseidel wrote: > I'm curious why you believe lazyAttached nodes to be ...
7 years, 7 months ago (2013-05-17 04:56:27 UTC) #10
esprehn
Getting really close on this, after this patch attached() means "ever had style recalc" and ...
7 years, 7 months ago (2013-05-17 21:08:58 UTC) #11
esprehn
Okay this is ready. It passes the tests on the try bots. :)
7 years, 7 months ago (2013-05-17 22:00:11 UTC) #12
ojan
https://codereview.chromium.org/15159008/diff/41001/Source/core/dom/Node.cpp File Source/core/dom/Node.cpp (right): https://codereview.chromium.org/15159008/diff/41001/Source/core/dom/Node.cpp#newcode874 Source/core/dom/Node.cpp:874: if (document()->inStyleRecalc()) { When do we call lazyAttach while ...
7 years, 7 months ago (2013-05-18 00:28:36 UTC) #13
esprehn
On 2013/05/18 00:28:36, ojan wrote: > https://codereview.chromium.org/15159008/diff/41001/Source/core/dom/Node.cpp > File Source/core/dom/Node.cpp (right): > > https://codereview.chromium.org/15159008/diff/41001/Source/core/dom/Node.cpp#newcode874 > ...
7 years, 7 months ago (2013-05-18 01:06:30 UTC) #14
esprehn
I thought about this more and decided comments were a good idea so I added ...
7 years, 7 months ago (2013-05-18 01:27:35 UTC) #15
eseidel
lgtm again. :) I don't want to block you. It's just not clear to me ...
7 years, 7 months ago (2013-05-22 00:42:32 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/15159008/54001
7 years, 7 months ago (2013-05-22 19:32:36 UTC) #17
esprehn
7 years, 7 months ago (2013-05-22 20:59:16 UTC) #18
Message was sent while issue was closed.
Committed patchset #10 manually as r150924 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698