|
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
Total comments: 2
Total comments: 2
|
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
|
Total messages: 18 (0 generated)
|