Skip to content

Commit 506bc07

Browse files
committed
[blocks-in-inline] Don't wrap sequences of blocks in anonymous block
https://bugs.webkit.org/show_bug.cgi?id=303999 rdar://166306432 Reviewed by Alan Baradlay. We already don't wrap single blocks. Remove remaining anonymous block wrapping. * LayoutTests/editing/selection/hit-test-continuation-margin-expected.html: * LayoutTests/editing/selection/hit-test-continuation-margin.html: This is a progression, our selection behavior now matches with or without the span. Change the ref to be the spanless case. * Source/WebCore/rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::updateAfterDescendants): * Source/WebCore/rendering/updating/RenderTreeBuilderInline.cpp: (WebCore::RenderTreeBuilder::Inline::updateAfterDescendants): Deleted. (WebCore::RenderTreeBuilder::Inline::wrapRunsOfBlocksInAnonymousBlock): Deleted. * Source/WebCore/rendering/updating/RenderTreeBuilderInline.h: Canonical link: https://commits.webkit.org/304357@main
1 parent 3066a2b commit 506bc07

31 files changed

+8195
-8321
lines changed

LayoutTests/editing/selection/hit-test-continuation-margin-expected.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,26 @@
22
<html>
33
<head>
44
<style>
5-
#test { width: 300px; font-size: 50px; border: solid 1px black; padding: 5px; }
6-
#test span { color: green; }
5+
#test { width: 300px; font-size: 50px; border: solid 1px black; padding: 5px; color: green; }
76
#test div { border: solid 2px blue; margin-top: 100px;}
87
</style>
98
</head>
109
<body>
11-
<p>Double-clicking in the empty space (margin) after the second line should select the second line, not the first.</p>
10+
<p>Double-clicking in the empty space (margin) after the second line should select the third line.</p>
1211
<div style="padding: 50px;">
13-
<div id="test"><span><div>first</div><div id="target">second</div><div>third</div></span></div>
12+
<div id="test"><div>first</div><div id="target">second</div><div>third</div></div>
1413
</div>
1514
<script>
1615

1716
const target = document.querySelector('#target');
1817

19-
var range = document.createRange();
20-
range.setStart(target, 0);
21-
range.setEnd(target, 1);
22-
window.getSelection().addRange(range);
18+
if (window.eventSender) {
19+
eventSender.mouseMoveTo(target.offsetLeft + 10, target.offsetTop + target.offsetHeight + 10);
20+
eventSender.mouseDown();
21+
eventSender.mouseUp();
22+
eventSender.mouseDown();
23+
eventSender.mouseUp();
24+
}
2325
</script>
2426
</body>
2527
</html>

LayoutTests/editing/selection/hit-test-continuation-margin.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</style>
99
</head>
1010
<body>
11-
<p>Double-clicking in the empty space (margin) after the second line should select the second line, not the first.</p>
11+
<p>Double-clicking in the empty space (margin) after the second line should select the third line.</p>
1212
<div style="padding: 50px;">
1313
<div id="test"><span><div>first</div><div id="target">second</div><div>third</div></span></div>
1414
</div>

LayoutTests/fast/css-generated-content/before-content-continuation-chain-expected.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ layer at (0,0) size 800x416
44
RenderBlock {HTML} at (0,0) size 800x416
55
RenderBody {BODY} at (8,8) size 784x400
66
RenderInline {SPAN} at (0,0) size 784x400 [color=#008000]
7-
RenderBlock (anonymous) at (0,0) size 784x200 [color=#000000]
8-
RenderBlock (generated) at (0,0) size 784x200 [color=#0000FF]
9-
RenderText at (0,0) size 200x200
10-
text run at (0,0) width 200: "A"
11-
RenderBlock {DIV} at (0,200) size 784x0 [color=#008000]
7+
RenderBlock (generated) at (0,0) size 784x200 [color=#0000FF]
8+
RenderText at (0,0) size 200x200
9+
text run at (0,0) width 200: "A"
10+
RenderBlock {DIV} at (0,200) size 784x0
1211
RenderText {#text} at (0,200) size 200x200
1312
text run at (0,200) width 200: "B"
1413
RenderText {#text} at (0,0) size 0x0

LayoutTests/platform/ios/css2.1/t09-c5526c-display-00-e-expected.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,16 @@ layer at (0,0) size 800x420
1919
RenderBlock (anonymous) at (10,20) size 140x46
2020
RenderInline {FORM} at (0,0) size 140x46
2121
RenderText {#text} at (0,0) size 0x0
22-
RenderBlock (anonymous) at (0,0) size 140x46
23-
RenderBlock {P} at (0,0) size 140x23
24-
RenderText {#text} at (0,6) size 29x14
25-
text run at (0,6) width 29: "bang "
26-
RenderBlock {INPUT} at (30,3) size 17x16 [color=#000000] [bgcolor=#FFFFFF03]
27-
RenderText {#text} at (0,0) size 0x0
28-
RenderBlock {P} at (0,23) size 140x23
29-
RenderText {#text} at (0,6) size 47x14
30-
text run at (0,6) width 47: "whimper "
31-
RenderBlock {INPUT} at (48,3) size 17x16 [color=#000000] [bgcolor=#FFFFFF03]
32-
RenderText {#text} at (0,0) size 0x0
22+
RenderBlock {P} at (0,0) size 140x23
23+
RenderText {#text} at (0,6) size 29x14
24+
text run at (0,6) width 29: "bang "
25+
RenderBlock {INPUT} at (30,3) size 17x16 [color=#000000] [bgcolor=#FFFFFF03]
26+
RenderText {#text} at (0,0) size 0x0
27+
RenderBlock {P} at (0,23) size 140x23
28+
RenderText {#text} at (0,6) size 47x14
29+
text run at (0,6) width 47: "whimper "
30+
RenderBlock {INPUT} at (48,3) size 17x16 [color=#000000] [bgcolor=#FFFFFF03]
31+
RenderText {#text} at (0,0) size 0x0
3332
RenderText {#text} at (0,0) size 0x0
3433
RenderBlock (floating) {LI} at (259,0) size 81x120 [color=#000000] [bgcolor=#FFCC00] [border: (5px solid #000000)]
3534
RenderText {#text} at (15,13) size 50x14

LayoutTests/platform/ios/editing/style/style-boundary-004-expected.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ layer at (0,0) size 800x600
2626
RenderText {#text} at (0,31) size 432x28
2727
text run at (0,31) width 432: "Should see this content in the red box below:"
2828
RenderInline {B} at (0,31) size 756x89
29-
RenderBlock (anonymous) at (0,60) size 756x60
30-
RenderBlock {DIV} at (0,0) size 756x30
31-
RenderText {#text} at (0,1) size 12x28
32-
text run at (0,1) width 12: "a"
33-
RenderBlock {DIV} at (0,30) size 756x30
34-
RenderText {#text} at (0,1) size 14x28
35-
text run at (0,1) width 14: "b"
29+
RenderBlock {DIV} at (0,60) size 756x30
30+
RenderText {#text} at (0,1) size 12x28
31+
text run at (0,1) width 12: "a"
32+
RenderBlock {DIV} at (0,90) size 756x30
33+
RenderText {#text} at (0,1) size 14x28
34+
text run at (0,1) width 14: "b"
3635
RenderText {#text} at (0,0) size 0x0
3736
RenderBlock {DIV} at (0,248) size 784x64
3837
RenderBlock {DIV} at (0,0) size 784x64 [border: (2px solid #FF0000)]

0 commit comments

Comments
 (0)