Title: [192296] releases/WebKitGTK/webkit-2.10
Revision
192296
Author
carlo...@webkit.org
Date
2015-11-11 00:10:06 -0800 (Wed, 11 Nov 2015)

Log Message

Merge r192120 - REGRESSION(r182286): Tatechuyoko following ruby is drawn too far to the right
https://bugs.webkit.org/show_bug.cgi?id=150923

Reviewed by Zalan Bujtas.

Source/WebCore:

Ever since r182286, expansion opportunities in justified ruby were moved to their neighboring
elements (thereby forbidding trailing nor leading expansions inside ruby). However, when the
neighboring element is tatechuyoko, we will erroneously honor the expansion opportunity inside
the tatechuyoko, thereby moving it horizontally.

Tatechuyoko should never have expansion opportunities inside it.

Test: fast/text/ruby-justify-tatechuyoko.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::expansionBehaviorForInlineTextBox):

LayoutTests:

* fast/text/ruby-justify-tatechuyoko-expected.html: Added.
* fast/text/ruby-justify-tatechuyoko.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (192295 => 192296)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2015-11-11 07:21:23 UTC (rev 192295)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2015-11-11 08:10:06 UTC (rev 192296)
@@ -1,3 +1,13 @@
+2015-11-06  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGRESSION(r182286): Tatechuyoko following ruby is drawn too far to the right
+        https://bugs.webkit.org/show_bug.cgi?id=150923
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/text/ruby-justify-tatechuyoko-expected.html: Added.
+        * fast/text/ruby-justify-tatechuyoko.html: Added.
+
 2015-11-06  Mario Sanchez Prada  <ma...@endlessm.com>
 
         Layout Test accessibility/win/linked-elements.html is crashing on win debug

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/text/ruby-justify-tatechuyoko-expected.html (0 => 192296)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/text/ruby-justify-tatechuyoko-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/text/ruby-justify-tatechuyoko-expected.html	2015-11-11 08:10:06 UTC (rev 192296)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+</head>
+<body>
+This test makes sure that tatechuyoko which directly follows ruby is properly left-aligned.
+<div style="text-align: justify; max-height: 7em; font-size: 40px; -webkit-writing-mode: vertical-rl;" lang="ja">この文章<span style="-webkit-text-combine: horizontal;">99</span>は斜下付サンプルです。</div>
+</body>
+</html>
Property changes on: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/text/ruby-justify-tatechuyoko-expected.html
___________________________________________________________________

Added: svn:executable

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/text/ruby-justify-tatechuyoko.html (0 => 192296)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/text/ruby-justify-tatechuyoko.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/text/ruby-justify-tatechuyoko.html	2015-11-11 08:10:06 UTC (rev 192296)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+</head>
+<body>
+This test makes sure that tatechuyoko which directly follows ruby is properly left-aligned.
+<div style="text-align: justify; max-height: 7em; font-size: 40px; -webkit-writing-mode: vertical-rl;" lang="ja">この<ruby>文章<rt style="color: white;">ルビ</rt></ruby><span style="-webkit-text-combine: horizontal;">99</span>は斜下付サンプルです。</div>
+</body>
+</html>
Property changes on: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/text/ruby-justify-tatechuyoko.html
___________________________________________________________________

Added: svn:executable

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (192295 => 192296)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-11-11 07:21:23 UTC (rev 192295)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-11-11 08:10:06 UTC (rev 192296)
@@ -1,3 +1,22 @@
+2015-11-06  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGRESSION(r182286): Tatechuyoko following ruby is drawn too far to the right
+        https://bugs.webkit.org/show_bug.cgi?id=150923
+
+        Reviewed by Zalan Bujtas.
+
+        Ever since r182286, expansion opportunities in justified ruby were moved to their neighboring
+        elements (thereby forbidding trailing nor leading expansions inside ruby). However, when the
+        neighboring element is tatechuyoko, we will erroneously honor the expansion opportunity inside
+        the tatechuyoko, thereby moving it horizontally.
+
+        Tatechuyoko should never have expansion opportunities inside it.
+
+        Test: fast/text/ruby-justify-tatechuyoko.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::expansionBehaviorForInlineTextBox):
+
 2015-11-06  Mario Sanchez Prada  <ma...@endlessm.com>
 
         Layout Test accessibility/win/linked-elements.html is crashing on win debug

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlockLineLayout.cpp (192295 => 192296)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2015-11-11 07:21:23 UTC (rev 192295)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2015-11-11 08:10:06 UTC (rev 192296)
@@ -719,12 +719,15 @@
 
 static inline ExpansionBehavior expansionBehaviorForInlineTextBox(RenderBlockFlow& block, InlineTextBox& textBox, BidiRun* previousRun, BidiRun* nextRun, ETextAlign textAlign, bool isAfterExpansion)
 {
+    // Tatechuyoko is modeled as the Object Replacement Character (U+FFFC), which can never have expansion opportunities inside nor intrinsically adjacent to it.
+    if (textBox.renderer().style().textCombine() == TextCombineHorizontal)
+        return ForbidLeadingExpansion | ForbidTrailingExpansion;
+
     ExpansionBehavior result = 0;
     bool setLeadingExpansion = false;
     bool setTrailingExpansion = false;
     if (textAlign == JUSTIFY) {
-        // If the next box is ruby, and we're justifying, and the first box in the ruby base has a leading expansion, and we are a text box, then
-        // force a trailing expansion.
+        // If the next box is ruby, and we're justifying, and the first box in the ruby base has a leading expansion, and we are a text box, then force a trailing expansion.
         if (nextRun && is<RenderRubyRun>(nextRun->renderer()) && downcast<RenderRubyRun>(nextRun->renderer()).rubyBase() && nextRun->renderer().style().collapseWhiteSpace()) {
             auto& rubyBase = *downcast<RenderRubyRun>(nextRun->renderer()).rubyBase();
             if (rubyBase.firstRootBox() && !rubyBase.firstRootBox()->nextRootBox()) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to