Skip to content
Permalink
Browse files
REGRESSION(r182286): Tatechuyoko following ruby is drawn too far to t…
…he 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.

Canonical link: https://commits.webkit.org/169197@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
litherum committed Nov 6, 2015
1 parent 1a1b711 commit 07194d2ef8b355df4f057419f77fd98f0ca731e3
Showing 5 changed files with 54 additions and 2 deletions.
@@ -1,3 +1,13 @@
2015-11-06 Myles C. Maxfield <mmaxfield@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 Ryan Haddad <ryanhaddad@apple.com>

Marking fast/canvas/webgl/oes-texture-half-float-linear.html as flaky on mac
@@ -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>
@@ -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>
@@ -1,3 +1,22 @@
2015-11-06 Myles C. Maxfield <mmaxfield@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 <mario@endlessm.com>

Layout Test accessibility/win/linked-elements.html is crashing on win debug
@@ -717,12 +717,15 @@ void RenderBlockFlow::computeInlineDirectionPositionsForLine(RootInlineBox* line

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()) {

0 comments on commit 07194d2

Please sign in to comment.