Commit 7c44da72 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Implement lazy (re-)attachment of whitespace.

The existing implementation of re-attachment of whitespace nodes had
performance issues because it tried to re-attach whitepace nodes as
early as possible, leading to multiple re-attachments of the same node
and multiple sibling-walks past the same out-of-flow elements.

Instead, this CL stores the last seen text node in a new
WhitespaceAttacher object and delays the re-attachment of that text
node until we know its need for a LayoutObject for the current layout
tree rebuild. In particular, we don't re-attach the whitespace node
when previous siblings are/become display:none or out-of-flow.

Contrary to what last_text_node did, the WhitespaceAttacher persist
the last seen text node in the flat tree order and across
display:contents and slot/content element which fixes various
correctness issues in addition to performance issues.

In addition to the last visited text node, we also store the last
seen display:contents element and only walk the display:contents
subtree when needed to find its first in-flow whitespace descendant.

BUG=349395,399816,705525,686016,648931,650168

Change-Id: Id397986c49a4bc75e831da1ff8b679f2043873c3
Reviewed-on: https://chromium-review.googlesource.com/517940
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: default avatarHayato Ito <hayato@chromium.org>
Reviewed-by: default avatarmeade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483683}
parent 203a2bad
......@@ -7,7 +7,6 @@ Actual checkboxes:
Broccoli
Asparagus
This test PASSES in DumpRenderTree. The role is AXRole: AXCheckBox
The following should be a button:
X
......@@ -15,7 +14,6 @@ X
Actual button:
Hello This test PASSES in DumpRenderTree. The role is AXRole: AXButton
The following should be a heading:
X
......@@ -25,7 +23,6 @@ Actual heading:
Hello
This test PASSES in DumpRenderTree. The role is AXRole: AXHeading
The following should be a link:
X
......@@ -33,7 +30,6 @@ X
Actual link:
Hello This test PASSES in DumpRenderTree. The role is AXRole: AXLink
The following should be a radio button:
X
......@@ -43,7 +39,6 @@ Actual radio buttons:
Broccoli
Asparagus
This test PASSES in DumpRenderTree. The role is AXRole: AXRadioButton
The following should be a text box:
X
......@@ -51,7 +46,6 @@ X
Actual text box:
This test PASSES in DumpRenderTree. The role is AXRole: AXTextField
The following should be an image:
X
......@@ -59,7 +53,6 @@ X
Actual image:
This test PASSES in DumpRenderTree. The role is AXRole: AXImage
The following should be a list:
X
......@@ -69,7 +62,6 @@ Actual list:
Broccoli
Beets
This test PASSES in DumpRenderTree. The role is AXRole: AXList
The following should be a dialog:
X
......
Visit Chromium Click the text! Button
Copyright 2015.
I have a checkbox Radio Button
I have a checkbox Radio Button
I have a menuItem Menu ItemRadio
Birthday: Birthday(date and time): Birthday(datetime-local): Birthday (month and year): Select a week: Select a file: Min-Max: Color: Select a time:
0 100 + =
......
......@@ -3,7 +3,6 @@ layer at (0,0) size 800x600 scrollHeight 732
layer at (0,0) size 800x8
LayoutBlockFlow {HTML} at (0,0) size 800x8
LayoutBlockFlow {BODY} at (8,8) size 784x0
LayoutText {#text} at (0,0) size 0x0
layer at (8,8) size 214x232
LayoutImage (positioned) {IMG} at (8,8) size 214x232
layer at (8,8) size 214x232
......
......@@ -3,7 +3,6 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x8
LayoutBlockFlow {HTML} at (0,0) size 800x8
LayoutBlockFlow {BODY} at (8,8) size 784x0
LayoutText {#text} at (0,0) size 0x0
layer at (8,8) size 214x232 transparent
LayoutImage (positioned) {IMG} at (8,8) size 214x232
layer at (8,8) size 214x232 transparent
......
CONSOLE ERROR: line 56: Discontiguous selection is not supported.
PASS repainted when expected
FAIL did not repaint when expected
PASS repainted when expected
......
......@@ -6,3 +6,5 @@ This test outdents an empty paragraph with inline style.
| <b>
| <#selection-caret>
| <br>
| "
"
......@@ -2,5 +2,4 @@ This is the test case for bug 7615758
between a rock and a hard rock cafe
by rahcel (rahcel), 11 hours, 31 minutes ago.
Favorited by
PASSPASS
Favorited byPASSPASS
To run this test manually, click the "Crash me" button.
To run this test manually, click the "Crash me" button.
SUCCEEDED
To run this test manually, type some text in the input field, then click the "Crash me" button.
To run this test manually, type some text in the input field, then click the "Crash me" button.
SUCCEEDED
Bug 101970: Heap-use-after-free in WebCore::LayoutLayerModelObject::hasSelfPaintingLayer
Test passes if it does not crash.
......@@ -4,7 +4,6 @@ layer at (0,0) size 800x116
LayoutBlockFlow {HTML} at (0,0) size 800x116
LayoutBlockFlow {BODY} at (8,8) size 784x100
LayoutText {#text} at (0,0) size 0x0
LayoutText {#text} at (0,0) size 0x0
layer at (8,8) size 100x100
LayoutHTMLCanvas {CANVAS} at (0,0) size 100x100
layer at (108,8) size 100x100
......
......@@ -15,4 +15,3 @@ layer at (0,0) size 800x416
LayoutText {#text} at (0,0) size 200x200
text run at (0,0) width 200: "B"
LayoutText {#text} at (0,0) size 0x0
LayoutText {#text} at (0,0) size 0x0
......@@ -23,4 +23,3 @@ layer at (0,0) size 800x600
LayoutTextFragment (anonymous) at (16,0) size 16x16
text run at (16,0) width 16: "\""
LayoutText {#text} at (0,0) size 0x0
LayoutText {#text} at (0,0) size 0x0
Test that scrollbar width is added to the intrinsic width of different display types.
PASS
PASS
......@@ -5,4 +5,3 @@ layer at (0,0) size 800x8
LayoutBlockFlow {BODY} at (8,8) size 784x0
LayoutInline {A} at (0,0) size 0x0 [color=#551A8B]
LayoutText {#text} at (0,0) size 0x0
LayoutText {#text} at (0,0) size 0x0
Tests that element.clientWidth of visible element with scrollbars returns proper values
PASS
PASS
Tests that element.clientWidth of visible element with scrollbars returns proper values
PASS
PASS
......@@ -25,4 +25,4 @@ PASS document.getElementById("half_size").clientWidth is (window.innerWidth/2)
PASS currentSrcFileNameNoParams("half_size") is "image-set-2x.png"
PASS document.getElementById("infitisimal_sizes").clientWidth is (window.innerWidth/100)
PASS currentSrcFileNameNoParams("infitisimal_sizes") is "image-set-2x.png"
......@@ -2,7 +2,7 @@ nick.jpg has MIME type image/jpeg
nick.jpg has MIME type image/jpeg
This test verifies that an image which is prefetched, and which is also contained as a subresource of the current document can be loaded correctly as a subresource. See bug 49236 in which this wasn't working.
When this test succeeds, you'll see an image of Nick on a sailboat immediately below this text. When this test fails, you will see no images at all.
When this test succeeds, you'll see an image of Nick on a sailboat immediately below this text. When this test fails, you will see no images at all.
NICK_ONLOAD called
NICK_ONLOAD called
......
This test verifies that an image which is prefetched, and which is also contained as a subresource of the current document can be loaded correctly as a subresource, even if the URI doesn't exist.
When this test succeeds, you will see nothing. When this test fails, you will crash or have another error.
When this test succeeds, you will see nothing. When this test fails, you will crash or have another error.
DNE_ONERROR called
DNE_ONERROR called
......
prefetch.link has MIME type text/plain
This test requires DumpRenderTree to see the log of what resources are loaded.
SUCCESS! prefetch onload called.
......@@ -8,4 +8,3 @@ layer at (0,0) size 800x600
LayoutBlockFlow {DIV} at (0,0) size 80x16
LayoutBlockFlow {DIV} at (0,0) size 40x16
LayoutText {#text} at (0,0) size 0x0
LayoutText {#text} at (0,0) size 0x0
......@@ -8,7 +8,6 @@ layer at (0,0) size 800x600
LayoutText {#text} at (0,0) size 0x0
LayoutBlockFlow (floating) {DIV} at (0,50) size 50x50 [bgcolor=#FF0000]
LayoutBlockFlow {DIV} at (0,0) size 50x50 [bgcolor=#008000]
LayoutText {#text} at (0,0) size 0x0
LayoutBR {BR} at (0,0) size 0x0
LayoutImage {IMG} at (50,50) size 0x0
LayoutText {#text} at (0,0) size 0x0
......@@ -21,10 +21,8 @@ This test checks whether the selection is restored, cleared, or set to the full
7) , only the word "SUCCESS" should be selected:
8) , the whole phrase "SUCCESS and SUCCESS" should be selected:
9) Hit Ctrl-Option-I (or Alt-I on Windows), the whole phrase "SUCCESS and SUCCESS" should be selected: