-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove special handling of
::before
and ::after
on RUBY
elements
https://bugs.webkit.org/show_bug.cgi?id=264446 rdar://problem/118478034 Reviewed by Antti Koivisto. Merge: https://chromium.googlesource.com/chromium/blink/+/81eb8745dfd7d21fc9588220eed989d901cb7276 This PR removes special handling, which was added in 60235@main and further work for crashes in bug 55930. This special handling is not as per web-specification and was also removed by Blink in 2015 and it was not done by Internet Explorer and Firefox. This PR changes it to treat them as they were a first or last DOM child of the RUBY parent. That's how ::before and ::after normally works. This means that now ::before and ::after will be part of, or even establish, ruby runs. Added a test for the crasher. Also rewrote three tests as reftests, since the expectations started to fail anyway. One test was invalid (ruby-beforeafter.html), since it required special handling of ::before and ::after, while the two others just got different rendering due to this change. * Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp: (isAnonymousRubyInlineBlock): Deleted (isRubyBeforeBlock): Deleted (isRubyAfterBlock): Deleted (isRubyChildForNormalRemoval): Updated (rubyBeforeBlock): Deleted (rubyAfterBlock): Deleted (createAnonymousRubyInlineBlock): Deleted (RenderTreeBuilder::Ruby::findOrCreateParentForChild): Updated (RenderTreeBuilder::Ruby::findOrCreateParentForChild): Updated (RenderTreeBuilder::Ruby::detach): Updated for 'Inline' (RenderTreeBuilder::Ruby::detach): Updated for 'Block' Updated Tests (as Ref Tests): * LayoutTests/fast/ruby/ruby-beforeafter.html: * LayoutTests/fast/ruby/ruby-beforeafter-expected.html: * LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content.html * LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.html: * LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html: * LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.html: Crash Test: * LayoutTests/fast/ruby/add-text-to-block-ruby-with-after-pseudo-crash.html: * LayoutTests/fast/ruby/add-text-to-block-ruby-with-after-pseudo-crash-expected.txt: Resource File: * LayoutTests/resources/ahem.js: Remove Old Expectations: * LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.png: * LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt: * LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.png: * LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt: * LayoutTests/platform/glib/fast/ruby/ruby-beforeafter-expected.txt: * LayoutTests/platform/gtk/fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.png: * LayoutTests/platform/gtk/fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.png: * LayoutTests/platform/ios-wk2/fast/ruby/ruby-beforeafter-expected.txt: * LayoutTests/platform/ios/fast/ruby/ruby-beforeafter-expected.txt: * LayoutTests/platform/mac/fast/ruby/ruby-beforeafter-expected.png: * LayoutTests/platform/mac/fast/ruby/ruby-beforeafter-expected.txt: * LayoutTests/platform/wincairo/fast/ruby/ruby-beforeafter-expected.txt: Canonical link: https://commits.webkit.org/270823@main
- Loading branch information
1 parent
bbd2e5d
commit 3c70113
Showing
22 changed files
with
923 additions
and
581 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
LayoutTests/fast/ruby/add-text-to-block-ruby-with-after-pseudo-crash-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Passed if this test did not crash or assert. |
22 changes: 22 additions & 0 deletions
22
LayoutTests/fast/ruby/add-text-to-block-ruby-with-after-pseudo-crash.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
ruby::after { | ||
display: block; | ||
content: ""; | ||
} | ||
ruby { | ||
display: block ruby; | ||
} | ||
</style> | ||
|
||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
|
||
onload = function() { | ||
var ruby = document.createElement('ruby'); | ||
document.body.appendChild(ruby); | ||
document.body.offsetTop; | ||
ruby.appendChild(document.createTextNode('Passed if this test did not crash or assert.')); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
span { | ||
color: blue; | ||
} | ||
rt { | ||
background: yellow; | ||
} | ||
</style> | ||
<p>Tests that CSS-generated :before or :after content just appear as | ||
if they were the first or last DOM child of the ruby element.</p> | ||
<p>The blue text should have annotations above them (yellow background).</p> | ||
</p>Foo <ruby><span>[before]b</span><rt>long text</rt></ruby> Bar<br></p> | ||
</p>Foo <ruby><span>b</span><rt>long text</rt>[after]</ruby> Bar<br></p> | ||
</p>Foo <ruby><span>[before]b</span><rt>long text</rt>[after]</ruby> Bar<br></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
<html> | ||
<head> | ||
<style type="text/css"> | ||
<!-- | ||
.b:before { | ||
content: '[before]'; | ||
} | ||
.a:after { | ||
content: '[after]'; | ||
} | ||
--> | ||
</style> | ||
</head> | ||
<body> | ||
<p>Tests that CSS-generated :before or :after content doesn't intrude into ruby bases.</p> | ||
</p>Foo <ruby class="b">b<rt>long text</rt></ruby> Bar<br></p> | ||
</p>Foo <ruby class="a">b<rt>long text</rt></ruby> Bar<br></p> | ||
</p>Foo <ruby class="b a">b<rt>long text</rt></ruby> Bar<br></p> | ||
</body> | ||
</html> | ||
<!DOCTYPE html> | ||
<style> | ||
.b::before { | ||
content: '[before]'; | ||
color: blue; | ||
} | ||
.a::after { | ||
content: '[after]'; | ||
} | ||
span { | ||
color: blue; | ||
} | ||
rt { | ||
background: yellow; | ||
} | ||
</style> | ||
<p>Tests that CSS-generated :before or :after content just appear as | ||
if they were the first or last DOM child of the ruby element.</p> | ||
<p>The blue text should have annotations above them (yellow background).</p> | ||
</p>Foo <ruby class="b"><span>b</span><rt>long text</rt></ruby> Bar<br></p> | ||
</p>Foo <ruby class="a"><span>b</span><rt>long text</rt></ruby> Bar<br></p> | ||
</p>Foo <ruby class="b a"><span>b</span><rt>long text</rt></ruby> Bar<br></p> |
14 changes: 14 additions & 0 deletions
14
LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<p>The orange, blue, yellow and green text boxes should not overlap.</p> | ||
<style> | ||
div, ruby { | ||
font: 1em/1 Ahem, sans-serif; | ||
font-size: 500%; | ||
} | ||
</style> | ||
<ruby style="display:block ruby; color:blue;"> | ||
<span style="color:orange;">1234</span> ABCD <span style="color:yellow;">4578</span> | ||
</ruby> | ||
<div style="color:green;"> | ||
EFGH | ||
</div> |
Binary file removed
BIN
-10.8 KB
...s/fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.png
Binary file not shown.
19 changes: 0 additions & 19 deletions
19
LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt
This file was deleted.
Oops, something went wrong.
39 changes: 19 additions & 20 deletions
39
LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
<!-- The orange, blue, yellow and green text boxes should not overlap --> | ||
<html> | ||
<body style="font: 1em/1 Ahem, sans-serif;"> | ||
<!DOCTYPE html> | ||
<script src="../../resources/ahem.js"></script> | ||
<p>The orange, blue, yellow and green text boxes should not overlap.</p> | ||
<style> | ||
#test::before | ||
{ | ||
content: "1234 "; | ||
color: orange; | ||
} | ||
#test::after | ||
{ | ||
content: " 4578"; | ||
color: yellow; | ||
} | ||
#test::before { | ||
content: "1234"; | ||
color: orange; | ||
} | ||
#test::after { | ||
content: "4578"; | ||
color: yellow; | ||
} | ||
ruby, div { | ||
font: 1em/1 Ahem, sans-serif; | ||
} | ||
</style> | ||
<ruby id="test" style="display: block; color: blue"> | ||
ABCD | ||
<ruby id="test" style="display:block ruby; color:blue;"> | ||
ABCD | ||
</ruby> | ||
<div style="font-size: 800%; color: green"> | ||
EFGH | ||
<div style="font-size:500%; color:green;"> | ||
EFGH | ||
</div> | ||
<script> | ||
document.body.offsetTop; | ||
var test = document.getElementById("test"); | ||
test.style.fontSize = "800%"; | ||
test.style.fontSize = "500%"; | ||
</script> | ||
</body> | ||
</html> |
14 changes: 14 additions & 0 deletions
14
LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<p>The orange, blue, yellow and green text boxes should not overlap.</p> | ||
<style> | ||
div, ruby { | ||
font: 1em/1 Ahem, sans-serif; | ||
font-size: 500%; | ||
} | ||
</style> | ||
<ruby style="color:blue;"> | ||
<span style="color:orange;">1234</span> ABCD <span style="color:yellow;">4578</span> | ||
</ruby> | ||
<div style="color:green;"> | ||
EFGH | ||
</div> |
Binary file removed
BIN
-10.8 KB
.../fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.png
Binary file not shown.
21 changes: 0 additions & 21 deletions
21
LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt
This file was deleted.
Oops, something went wrong.
38 changes: 18 additions & 20 deletions
38
LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
<!-- The orange, blue, yellow and green text boxes should not overlap --> | ||
<html> | ||
<body style="font: 1em/1 Ahem, sans-serif;"> | ||
<!DOCTYPE html> | ||
<p>The orange, blue, yellow and green text boxes should not overlap.</p> | ||
<style> | ||
#test::before | ||
{ | ||
content: "1234 "; | ||
color: orange; | ||
} | ||
#test::after | ||
{ | ||
content: " 4578"; | ||
color: yellow; | ||
} | ||
#test::before { | ||
content: "1234"; | ||
color: orange; | ||
} | ||
#test::after { | ||
content: "4578"; | ||
color: yellow; | ||
} | ||
ruby, div { | ||
font: 1em/1 Ahem, sans-serif; | ||
} | ||
</style> | ||
<ruby id="test" style="color: blue"> | ||
ABCD | ||
<ruby id="test" style="color:blue;"> | ||
ABCD | ||
</ruby> | ||
<div style="font-size: 800%; color: green"> | ||
EFGH | ||
<div style="font-size:500%; color:green;"> | ||
EFGH | ||
</div> | ||
<script> | ||
document.body.offsetTop; | ||
var test = document.getElementById("test"); | ||
test.style.fontSize = "800%"; | ||
test.style.fontSize = "500%"; | ||
</script> | ||
</body> | ||
</html> |
68 changes: 0 additions & 68 deletions
68
LayoutTests/platform/glib/fast/ruby/ruby-beforeafter-expected.txt
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-2.93 KB
...k/fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.png
Binary file not shown.
Binary file removed
BIN
-2.93 KB
.../fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.png
Binary file not shown.
68 changes: 0 additions & 68 deletions
68
LayoutTests/platform/ios-wk2/fast/ruby/ruby-beforeafter-expected.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.