Title: [295573] trunk
- Revision
- 295573
- Author
- [email protected]
- Date
- 2022-06-15 14:40:00 -0700 (Wed, 15 Jun 2022)
Log Message
REGRESSION (r287195): Safari fails to correctly render indented numbered lists with custom CSS and hyphenation ON
https://bugs.webkit.org/show_bug.cgi?id=241630
<rdar://91245970>
Reviewed by Darin Adler.
* LayoutTests/fast/text/list-and-hyphenation-expected.html: Added.
* LayoutTests/fast/text/list-and-hyphenation.html: Added.
* Source/WebCore/rendering/RenderText.cpp:
(WebCore::RenderText::maxWordFragmentWidth):
Return entireWordWidth instead of 0 in the bail out cases.
This ends up setting maxWordWidth = w and leaving currMinWidth unchanged in the caller, matching the pre-r287195 behavior.
Canonical link: https://commits.webkit.org/251578@main
Modified Paths
Added Paths
Diff
Added: trunk/LayoutTests/fast/text/list-and-hyphenation-expected.html (0 => 295573)
--- trunk/LayoutTests/fast/text/list-and-hyphenation-expected.html (rev 0)
+++ trunk/LayoutTests/fast/text/list-and-hyphenation-expected.html 2022-06-15 21:40:00 UTC (rev 295573)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<style type="text/css">
+ol li {display:block;}
+ol > li {counter-increment: item; position: relative;}
+ol > li:before {
+ content:counters(item, ".") ".";
+ position: absolute; margin-right: 100%; right: 10px; font-weight: normal;
+}
+</style>
+<body><ol><li>Hyphenation</li><ol><li>shouldn't affect bullet position</li></ol></ol></body>
+
Added: trunk/LayoutTests/fast/text/list-and-hyphenation.html (0 => 295573)
--- trunk/LayoutTests/fast/text/list-and-hyphenation.html (rev 0)
+++ trunk/LayoutTests/fast/text/list-and-hyphenation.html 2022-06-15 21:40:00 UTC (rev 295573)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<style type="text/css">
+body {
+ -webkit-hyphens: auto;
+}
+
+ol li {display:block;}
+ol > li {counter-increment: item; position: relative;}
+ol > li:before {
+ content:counters(item, ".") ".";
+ position: absolute; margin-right: 100%; right: 10px; font-weight: normal;
+}
+</style>
+<body><ol><li>Hyphenation</li><ol><li>shouldn't affect bullet position</li></ol></ol></body>
+
Modified: trunk/Source/WebCore/rendering/RenderText.cpp (295572 => 295573)
--- trunk/Source/WebCore/rendering/RenderText.cpp 2022-06-15 21:35:30 UTC (rev 295572)
+++ trunk/Source/WebCore/rendering/RenderText.cpp 2022-06-15 21:40:00 UTC (rev 295573)
@@ -942,7 +942,7 @@
{
unsigned suffixStart = 0;
if (word.length() <= minimumSuffixLength)
- return 0;
+ return entireWordWidth;
Vector<int, 8> hyphenLocations;
ASSERT(word.length() >= minimumSuffixLength);
@@ -951,7 +951,7 @@
hyphenLocations.append(hyphenLocation);
if (hyphenLocations.isEmpty())
- return 0;
+ return entireWordWidth;
hyphenLocations.reverse();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes