<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[177377] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/177377">177377</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-12-16 11:28:57 -0800 (Tue, 16 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Ruby does not preserve expansion opportunities from enclosing context
https://bugs.webkit.org/show_bug.cgi?id=139618

Source/WebCore:

Patch by Myles C. Maxfield &lt;litherum@gmail.com&gt; on 2014-12-16
Reviewed by David Hyatt.

There is currently no sharing of expansion opportunity information between
ruby bases and the text surrounding the ruby. This patch adds a bit on
RenderText, m_contentIsKnownToFollow, which affects how expansion
opportunities are handled at paint-time, as well as a bit on RenderRubyBase,
m_isAfterExpansion, which affects how expansions are calculated when laying
out a line. This patch also adds a field to RenderRubyBase which represents
the base's starting position within a ruby. This field is necessary because
an expansion from a line might occur at the very beginning of a ruby base,
so we have to remember some state from expansion time to RenderRubyBase
layout time.

Added more tests to fast/ruby/ruby-justification.html.

* rendering/InlineBox.h:
(WebCore::InlineBox::setExpansionWithoutGrowing):
(WebCore::InlineBox::expansion):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::removeChild): Keep the bit on InlineTextBox up to
date.
(WebCore::InlineFlowBox::placeBoxRangeInInlineDirection): Set expansion
information in InlineFlowBoxes so the total expansion for a whole line
is held in the RootInlineBox's expansion.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::expansionBehavior):
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateRubyForJustifiedText):
updateRubyForJustifiedText() had a bunch of problems with it. First of all,
it didn't actually set the InlineBoxes as dirty, so the second layout pass
sometimes wouldn't perform any updates. Secondarily, it didn't take
overhangs into account. Thirdly, it didn't mark the ruby base and text as
needing layout so that subsequent layouts would actually traverse into them.
(WebCore::RenderBlockFlow::computeExpansionForJustifiedText):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
This nested if triangle is super nasty, but I'm not sure of a better way to
write it.
(WebCore::updateRubyForJustifiedText): Deleted.
(WebCore::computeExpansionForJustifiedText): Deleted.
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::RenderRubyBase):
(WebCore::RenderRubyBase::adjustInlineDirectionLineBounds):
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layout):
* rendering/RenderText.cpp:
(WebCore::RenderText::RenderText):
* rendering/RenderText.h:
(WebCore::RenderText::contentIsKnownToFollow):
(WebCore::RenderText::setContentIsKnownToFollow):

LayoutTests:

Updating test for new expansion logic.

Patch by Myles C. Maxfield &lt;litherum@gmail.com&gt; on 2014-12-16
Reviewed by David Hyatt.

* fast/ruby/ruby-justification-expected.html:
* fast/ruby/ruby-justification.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastrubyrubyjustificationexpectedhtml">trunk/LayoutTests/fast/ruby/ruby-justification-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastrubyrubyjustificationhtml">trunk/LayoutTests/fast/ruby/ruby-justification.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineBoxh">trunk/Source/WebCore/rendering/InlineBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineFlowBoxcpp">trunk/Source/WebCore/rendering/InlineFlowBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxh">trunk/Source/WebCore/rendering/InlineTextBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowh">trunk/Source/WebCore/rendering/RenderBlockFlow.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockLineLayoutcpp">trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyBasecpp">trunk/Source/WebCore/rendering/RenderRubyBase.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyBaseh">trunk/Source/WebCore/rendering/RenderRubyBase.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyRuncpp">trunk/Source/WebCore/rendering/RenderRubyRun.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextcpp">trunk/Source/WebCore/rendering/RenderText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTexth">trunk/Source/WebCore/rendering/RenderText.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/LayoutTests/ChangeLog        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-12-16  Myles C. Maxfield  &lt;litherum@gmail.com&gt;
+
+        Ruby does not preserve expansion opportunities from enclosing context
+        https://bugs.webkit.org/show_bug.cgi?id=139618
+
+        Updating test for new expansion logic.
+
+        Reviewed by David Hyatt.
+
+        * fast/ruby/ruby-justification-expected.html:
+        * fast/ruby/ruby-justification.html:
+
</ins><span class="cx"> 2014-12-16  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         More expectations updated to Timeout.
</span></span></pre></div>
<a id="trunkLayoutTestsfastrubyrubyjustificationexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/ruby/ruby-justification-expected.html (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/ruby/ruby-justification-expected.html        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/LayoutTests/fast/ruby/ruby-justification-expected.html        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -9,7 +9,13 @@
</span><span class="cx"> &lt;div&gt;
</span><span class="cx"> abcdefg &lt;ruby&gt;abcdefg&lt;rt&gt;&lt;span style=&quot;color: transparent;&quot;&gt;a&lt;/span&gt;&lt;/ruby&gt; abcdefg mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
</span><span class="cx"> &lt;/div&gt;
</span><ins>+&lt;div&gt;
+abcdefg &lt;ruby&gt;a&lt;rt&gt;&lt;span style=&quot;color: transparent;&quot;&gt;a&lt;/span&gt;&lt;/ruby&gt; abcdefg mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
</ins><span class="cx"> &lt;/div&gt;
</span><ins>+&lt;div&gt;
+a&lt;span style=&quot;background: green;&quot;&gt;&amp;#x685c;&lt;/span&gt;b mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
+&lt;/div&gt;
+&lt;/div&gt;
</ins><span class="cx"> &lt;div style=&quot;font-family: Ahem; font-size: 16px;&quot;&gt;
</span><span class="cx"> &lt;ruby&gt;abcdefg&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;abcdefg&lt;rt&gt;a&lt;/ruby&gt; mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
</span><span class="cx"> &lt;/div&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastrubyrubyjustificationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/ruby/ruby-justification.html (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/ruby/ruby-justification.html        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/LayoutTests/fast/ruby/ruby-justification.html        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -9,6 +9,12 @@
</span><span class="cx"> &lt;div&gt;
</span><span class="cx"> &lt;ruby&gt;abcdefg abcdefg&lt;rt&gt;&lt;span style=&quot;color: transparent;&quot;&gt;a&lt;/span&gt;&lt;/ruby&gt; abcdefg mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
</span><span class="cx"> &lt;/div&gt;
</span><ins>+&lt;div&gt;
+abcdefg &lt;ruby&gt;a&lt;rt&gt;&lt;span style=&quot;color: transparent;&quot;&gt;aaaaaaaaaaaaaaaaaaaaaaa&lt;/span&gt;&lt;/ruby&gt; abcdefg mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
+&lt;/div&gt;
+&lt;div&gt;
+a&lt;ruby&gt;&lt;rb style=&quot;background: green;&quot;&gt;&amp;#x685c;&lt;/rb&gt;&lt;rt&gt; &lt;/ruby&gt;b mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
+&lt;/div&gt;
</ins><span class="cx"> &lt;div style=&quot;font-family: Ahem;&quot;&gt;
</span><span class="cx"> &lt;ruby&gt;abcdefg abcdefg&lt;rt&gt;a&lt;/ruby&gt; mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
</span><span class="cx"> &lt;/div&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/ChangeLog        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2014-12-16  Myles C. Maxfield  &lt;litherum@gmail.com&gt;
+
+        Ruby does not preserve expansion opportunities from enclosing context
+        https://bugs.webkit.org/show_bug.cgi?id=139618
+
+        Reviewed by David Hyatt.
+
+        There is currently no sharing of expansion opportunity information between
+        ruby bases and the text surrounding the ruby. This patch adds a bit on
+        RenderText, m_contentIsKnownToFollow, which affects how expansion
+        opportunities are handled at paint-time, as well as a bit on RenderRubyBase,
+        m_isAfterExpansion, which affects how expansions are calculated when laying
+        out a line. This patch also adds a field to RenderRubyBase which represents
+        the base's starting position within a ruby. This field is necessary because
+        an expansion from a line might occur at the very beginning of a ruby base,
+        so we have to remember some state from expansion time to RenderRubyBase
+        layout time.
+
+        Added more tests to fast/ruby/ruby-justification.html.
+
+        * rendering/InlineBox.h:
+        (WebCore::InlineBox::setExpansionWithoutGrowing):
+        (WebCore::InlineBox::expansion):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::removeChild): Keep the bit on InlineTextBox up to
+        date.
+        (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection): Set expansion
+        information in InlineFlowBoxes so the total expansion for a whole line
+        is held in the RootInlineBox's expansion.
+        * rendering/InlineTextBox.h:
+        (WebCore::InlineTextBox::expansionBehavior):
+        * rendering/RenderBlockFlow.h:
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
+        updateRubyForJustifiedText() had a bunch of problems with it. First of all,
+        it didn't actually set the InlineBoxes as dirty, so the second layout pass
+        sometimes wouldn't perform any updates. Secondarily, it didn't take
+        overhangs into account. Thirdly, it didn't mark the ruby base and text as
+        needing layout so that subsequent layouts would actually traverse into them.
+        (WebCore::RenderBlockFlow::computeExpansionForJustifiedText):
+        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
+        This nested if triangle is super nasty, but I'm not sure of a better way to
+        write it.
+        (WebCore::updateRubyForJustifiedText): Deleted.
+        (WebCore::computeExpansionForJustifiedText): Deleted.
+        * rendering/RenderRubyBase.cpp:
+        (WebCore::RenderRubyBase::RenderRubyBase):
+        (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds):
+        * rendering/RenderRubyBase.h:
+        * rendering/RenderRubyRun.cpp:
+        (WebCore::RenderRubyRun::layout):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::RenderText):
+        * rendering/RenderText.h:
+        (WebCore::RenderText::contentIsKnownToFollow):
+        (WebCore::RenderText::setContentIsKnownToFollow):
+
</ins><span class="cx"> 2014-12-16  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Crash in WebKit::WebPageProxy::dispatchViewStateChange() tapping a link from another app while playing a video
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineBox.h (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineBox.h        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/InlineBox.h        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -277,6 +277,12 @@
</span><span class="cx">         m_expansion = newExpansion;
</span><span class="cx">         m_logicalWidth += m_expansion;
</span><span class="cx">     }
</span><ins>+    void setExpansionWithoutGrowing(float newExpansion)
+    {
+        ASSERT(!m_expansion);
+        m_expansion = newExpansion;
+    }
+    float expansion() const { return m_expansion; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     InlineBox* m_next; // The next element on the same line as us.
</span><span class="lines">@@ -408,7 +414,6 @@
</span><span class="cx">     void setHasHyphen(bool hasHyphen) { m_bitfields.setHasEllipsisBoxOrHyphen(hasHyphen); }    
</span><span class="cx">     bool canHaveLeadingExpansion() const { return m_bitfields.hasSelectedChildrenOrCanHaveLeadingExpansion(); }
</span><span class="cx">     void setCanHaveLeadingExpansion(bool canHaveLeadingExpansion) { m_bitfields.setHasSelectedChildrenOrCanHaveLeadingExpansion(canHaveLeadingExpansion); }
</span><del>-    float expansion() const { return m_expansion; }
</del><span class="cx">     
</span><span class="cx">     // For InlineFlowBox and InlineTextBox
</span><span class="cx">     bool extracted() const { return m_bitfields.extracted(); }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineFlowBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -179,6 +179,14 @@
</span><span class="cx">     if (!isDirty())
</span><span class="cx">         dirtyLineBoxes();
</span><span class="cx"> 
</span><ins>+    if (child-&gt;prevLeafChild() &amp;&amp; is&lt;InlineTextBox&gt;(child-&gt;prevLeafChild())) {
+        if (is&lt;InlineTextBox&gt;(child))
+            downcast&lt;InlineTextBox&gt;(child-&gt;prevLeafChild())-&gt;renderer().setContentIsKnownToFollow(downcast&lt;InlineTextBox&gt;(child)-&gt;renderer().contentIsKnownToFollow());
+        // FIXME: Handle the case where we remove the last inline box, and it's not a text box. If we're trying to share
+        // expansion opportunites both inside and outside a replaced element (such as for ruby bases), we need to search
+        // outside the current inline box tree to determine if there is content that follows the new last inline item.
+    }
+
</ins><span class="cx">     root().childRemoved(child);
</span><span class="cx"> 
</span><span class="cx">     if (child == m_firstChild)
</span><span class="lines">@@ -373,6 +381,7 @@
</span><span class="cx"> 
</span><span class="cx"> float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, InlineBox* lastChild, float&amp; logicalLeft, float&amp; minLogicalLeft, float&amp; maxLogicalRight, bool&amp; needsWordSpacing)
</span><span class="cx"> {
</span><ins>+    float totalExpansion = 0;
</ins><span class="cx">     for (InlineBox* child = firstChild; child &amp;&amp; child != lastChild; child = child-&gt;nextOnLine()) {
</span><span class="cx">         if (is&lt;RenderText&gt;(child-&gt;renderer())) {
</span><span class="cx">             auto&amp; textBox = downcast&lt;InlineTextBox&gt;(*child);
</span><span class="lines">@@ -386,6 +395,7 @@
</span><span class="cx">             if (knownToHaveNoOverflow())
</span><span class="cx">                 minLogicalLeft = std::min(logicalLeft, minLogicalLeft);
</span><span class="cx">             logicalLeft += textBox.logicalWidth();
</span><ins>+            totalExpansion += textBox.expansion();
</ins><span class="cx">             if (knownToHaveNoOverflow())
</span><span class="cx">                 maxLogicalRight = std::max(logicalLeft, maxLogicalRight);
</span><span class="cx">         } else {
</span><span class="lines">@@ -405,6 +415,7 @@
</span><span class="cx">                 if (knownToHaveNoOverflow())
</span><span class="cx">                     minLogicalLeft = std::min(logicalLeft, minLogicalLeft);
</span><span class="cx">                 logicalLeft = flow.placeBoxesInInlineDirection(logicalLeft, needsWordSpacing);
</span><ins>+                totalExpansion += flow.expansion();
</ins><span class="cx">                 if (knownToHaveNoOverflow())
</span><span class="cx">                     maxLogicalRight = std::max(logicalLeft, maxLogicalRight);
</span><span class="cx">                 logicalLeft += flow.marginLogicalRight();
</span><span class="lines">@@ -427,6 +438,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+    setExpansionWithoutGrowing(totalExpansion);
</ins><span class="cx">     return logicalLeft;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineTextBox.h (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.h        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx">     TextRun::ExpansionBehavior expansionBehavior() const
</span><span class="cx">     {
</span><span class="cx">         return (canHaveLeadingExpansion() ? TextRun::AllowLeadingExpansion : TextRun::ForbidLeadingExpansion)
</span><del>-            | (expansion() &amp;&amp; nextLeafChild() &amp;&amp; !nextLeafChild()-&gt;isLineBreak() ? TextRun::AllowTrailingExpansion : TextRun::ForbidTrailingExpansion);
</del><ins>+            | (renderer().contentIsKnownToFollow() || (expansion() &amp;&amp; nextLeafChild() &amp;&amp; !nextLeafChild()-&gt;isLineBreak()) ? TextRun::AllowTrailingExpansion : TextRun::ForbidTrailingExpansion);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void behavesLikeText() const = delete;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -549,6 +549,8 @@
</span><span class="cx">     RootInlineBox* constructLine(BidiRunList&lt;BidiRun&gt;&amp;, const LineInfo&amp;);
</span><span class="cx">     void setMarginsForRubyRun(BidiRun*, RenderRubyRun&amp;, RenderObject*, const LineInfo&amp;);
</span><span class="cx">     void computeInlineDirectionPositionsForLine(RootInlineBox*, const LineInfo&amp;, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap&amp;, VerticalPositionCache&amp;, WordMeasurements&amp;);
</span><ins>+    void updateRubyForJustifiedText(RenderRubyRun&amp;, BidiRun&amp;, const Vector&lt;unsigned, 16&gt;&amp; expansionOpportunities, unsigned&amp; expansionOpportunityCount, float&amp; totalLogicalWidth, float availableLogicalWidth, RenderObject* previousObject, const LineInfo&amp;, size_t&amp; expansionIndex);
+    void computeExpansionForJustifiedText(BidiRun* firstRun, BidiRun* trailingSpaceRun, const Vector&lt;unsigned, 16&gt;&amp; expansionOpportunities, unsigned expansionOpportunityCount, float totalLogicalWidth, float availableLogicalWidth, const LineInfo&amp;);
</ins><span class="cx">     BidiRun* computeInlineDirectionPositionsForSegment(RootInlineBox*, const LineInfo&amp;, ETextAlign, float&amp; logicalLeft,
</span><span class="cx">         float&amp; availableLogicalWidth, BidiRun* firstRun, BidiRun* trailingSpaceRun, GlyphOverflowAndFallbackFontsMap&amp; textBoxDataMap, VerticalPositionCache&amp;, WordMeasurements&amp;);
</span><span class="cx">     void computeBlockDirectionPositionsForLine(RootInlineBox*, BidiRun*, GlyphOverflowAndFallbackFontsMap&amp;, VerticalPositionCache&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -545,7 +545,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline void updateRubyForJustifiedText(RenderRubyRun&amp; rubyRun, BidiRun&amp; r, const Vector&lt;unsigned, 16&gt;&amp; expansionOpportunities, unsigned&amp; expansionOpportunityCount, float&amp; totalLogicalWidth, float availableLogicalWidth, size_t&amp; i)
</del><ins>+void RenderBlockFlow::updateRubyForJustifiedText(RenderRubyRun&amp; rubyRun, BidiRun&amp; r, const Vector&lt;unsigned, 16&gt;&amp; expansionOpportunities, unsigned&amp; expansionOpportunityCount, float&amp; totalLogicalWidth, float availableLogicalWidth, RenderObject* previousObject, const LineInfo&amp; lineInfo, size_t&amp; i)
</ins><span class="cx"> {
</span><span class="cx">     if (!rubyRun.rubyBase() || !rubyRun.rubyBase()-&gt;firstRootBox() || rubyRun.rubyBase()-&gt;firstRootBox()-&gt;nextRootBox() || !r.renderer().style().collapseWhiteSpace())
</span><span class="cx">         return;
</span><span class="lines">@@ -568,26 +568,47 @@
</span><span class="cx"> 
</span><span class="cx">     if (totalOpportunitiesInRun) {
</span><span class="cx">         ASSERT(!rubyRun.hasOverrideWidth());
</span><del>-        rubyRun.setOverrideLogicalContentWidth(rubyRun.logicalWidth() + totalExpansion);
</del><ins>+        float newBaseWidth = rubyRun.logicalWidth() + totalExpansion + marginStartForChild(rubyRun) + marginEndForChild(rubyRun);
+        float newRubyRunWidth = rubyRun.logicalWidth() + totalExpansion;
+        rubyBase.setInitialOffset((newRubyRunWidth - newBaseWidth) / 2);
+        rubyRun.setOverrideLogicalContentWidth(newRubyRunWidth);
</ins><span class="cx">         rubyRun.setNeedsLayout(MarkOnlyThis);
</span><ins>+        rootBox.markDirty();
+        if (RenderRubyText* rubyText = rubyRun.rubyText()) {
+            if (RootInlineBox* textRootBox = rubyText-&gt;firstRootBox())
+                textRootBox-&gt;markDirty();
+        }
</ins><span class="cx">         rubyRun.layoutBlock(true);
</span><span class="cx">         rubyRun.clearOverrideLogicalContentWidth();
</span><del>-        r.box()-&gt;setExpansion(totalExpansion);
</del><ins>+        setMarginsForRubyRun(&amp;r, rubyRun, previousObject, lineInfo); // Expanding the base might mean there's less of a need for overhang
+        r.box()-&gt;setExpansion(newRubyRunWidth - r.box()-&gt;logicalWidth());
</ins><span class="cx"> 
</span><ins>+        // This relayout caused the size of the RenderRubyText and the RenderRubyBase to change, dependent on the line's current expansion. Next time we relayout the
+        // RenderRubyRun, make sure that we relayout the RenderRubyBase and RenderRubyText as well.
+        rubyBase.setNeedsLayout(MarkOnlyThis);
+        if (RenderRubyText* rubyText = rubyRun.rubyText())
+            rubyText-&gt;setNeedsLayout(MarkOnlyThis);
+        if (rubyBase.lastLeafChild() &amp;&amp; is&lt;RenderText&gt;(rubyBase.lastLeafChild()) &amp;&amp; r.box() &amp;&amp; r.box()-&gt;nextLeafChild() &amp;&amp; !r.box()-&gt;nextLeafChild()-&gt;isLineBreak())
+            downcast&lt;RenderText&gt;(rubyBase.lastLeafChild())-&gt;setContentIsKnownToFollow(true);
+
</ins><span class="cx">         totalLogicalWidth += totalExpansion;
</span><span class="cx">         expansionOpportunityCount -= totalOpportunitiesInRun;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline void computeExpansionForJustifiedText(BidiRun* firstRun, BidiRun* trailingSpaceRun, const Vector&lt;unsigned, 16&gt;&amp; expansionOpportunities, unsigned expansionOpportunityCount, float totalLogicalWidth, float availableLogicalWidth)
</del><ins>+void RenderBlockFlow::computeExpansionForJustifiedText(BidiRun* firstRun, BidiRun* trailingSpaceRun, const Vector&lt;unsigned, 16&gt;&amp; expansionOpportunities, unsigned expansionOpportunityCount, float totalLogicalWidth, float availableLogicalWidth, const LineInfo&amp; lineInfo)
</ins><span class="cx"> {
</span><span class="cx">     if (!expansionOpportunityCount || availableLogicalWidth &lt;= totalLogicalWidth)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    RenderObject* previousObject = nullptr;
+
</ins><span class="cx">     size_t i = 0;
</span><span class="cx">     for (BidiRun* run = firstRun; run; run = run-&gt;next()) {
</span><del>-        if (!run-&gt;box() || run == trailingSpaceRun)
</del><ins>+        if (!run-&gt;box() || run == trailingSpaceRun) {
+            previousObject = &amp;run-&gt;renderer();
</ins><span class="cx">             continue;
</span><ins>+        }
</ins><span class="cx">         
</span><span class="cx">         if (is&lt;RenderText&gt;(run-&gt;renderer())) {
</span><span class="cx">             unsigned opportunitiesInRun = expansionOpportunities[i++];
</span><span class="lines">@@ -603,8 +624,10 @@
</span><span class="cx">             }
</span><span class="cx">             expansionOpportunityCount -= opportunitiesInRun;
</span><span class="cx">         } else if (is&lt;RenderRubyRun&gt;(run-&gt;renderer()))
</span><del>-            updateRubyForJustifiedText(downcast&lt;RenderRubyRun&gt;(run-&gt;renderer()), *run, expansionOpportunities, expansionOpportunityCount, totalLogicalWidth, availableLogicalWidth, i);
</del><ins>+            updateRubyForJustifiedText(downcast&lt;RenderRubyRun&gt;(run-&gt;renderer()), *run, expansionOpportunities, expansionOpportunityCount, totalLogicalWidth, availableLogicalWidth, previousObject, lineInfo, i);
</ins><span class="cx"> 
</span><ins>+        previousObject = &amp;run-&gt;renderer();
+
</ins><span class="cx">         if (!expansionOpportunityCount)
</span><span class="cx">             break;
</span><span class="cx">     }
</span><span class="lines">@@ -704,7 +727,7 @@
</span><span class="cx">     bool needsWordSpacing = false;
</span><span class="cx">     float totalLogicalWidth = lineBox-&gt;getFlowSpacingLogicalWidth();
</span><span class="cx">     unsigned expansionOpportunityCount = 0;
</span><del>-    bool isAfterExpansion = true;
</del><ins>+    bool isAfterExpansion = is&lt;RenderRubyBase&gt;(*this) ? downcast&lt;RenderRubyBase&gt;(*this).isAfterExpansion() : true;
</ins><span class="cx">     Vector&lt;unsigned, 16&gt; expansionOpportunities;
</span><span class="cx">     RenderObject* previousObject = nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -737,6 +760,7 @@
</span><span class="cx">             if (is&lt;RenderRubyRun&gt;(run-&gt;renderer()) &amp;&amp; textAlign == JUSTIFY &amp;&amp; run != trailingSpaceRun &amp;&amp; downcast&lt;RenderRubyRun&gt;(run-&gt;renderer()).rubyBase()) {
</span><span class="cx">                 auto* rubyBase = downcast&lt;RenderRubyRun&gt;(run-&gt;renderer()).rubyBase();
</span><span class="cx">                 if (rubyBase-&gt;firstRootBox() &amp;&amp; !rubyBase-&gt;firstRootBox()-&gt;nextRootBox() &amp;&amp; run-&gt;renderer().style().collapseWhiteSpace()) {
</span><ins>+                    rubyBase-&gt;setIsAfterExpansion(isAfterExpansion);
</ins><span class="cx">                     for (auto* leafChild = rubyBase-&gt;firstRootBox()-&gt;firstLeafChild(); leafChild; leafChild = leafChild-&gt;nextLeafChild()) {
</span><span class="cx">                         if (!is&lt;InlineTextBox&gt;(*leafChild))
</span><span class="cx">                             continue;
</span><span class="lines">@@ -768,13 +792,28 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (isAfterExpansion &amp;&amp; !expansionOpportunities.isEmpty()) {
</span><del>-        expansionOpportunities.last()--;
-        expansionOpportunityCount--;
</del><ins>+        bool shouldShareExpansionsWithContainingLine = true;
+        if (is&lt;RenderRubyBase&gt;(*this)) {
+            if (RenderRubyRun* rubyRun = downcast&lt;RenderRubyBase&gt;(*this).rubyRun()) {
+                if (RenderElement* rubyElement = rubyRun-&gt;parent()) {
+                    if (rubyElement-&gt;style().display() == INLINE) {
+                        if (RenderBlock* containingBlock = rubyElement-&gt;containingBlock()) {
+                            if (containingBlock-&gt;style().textAlign() == JUSTIFY)
+                                shouldShareExpansionsWithContainingLine = false;
+                        }
+                    }
+                }
+            }
+        }
+        if (shouldShareExpansionsWithContainingLine) {
+            expansionOpportunities.last()--;
+            expansionOpportunityCount--;
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     updateLogicalWidthForAlignment(textAlign, lineBox, trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth, expansionOpportunityCount);
</span><span class="cx"> 
</span><del>-    computeExpansionForJustifiedText(firstRun, trailingSpaceRun, expansionOpportunities, expansionOpportunityCount, totalLogicalWidth, availableLogicalWidth);
</del><ins>+    computeExpansionForJustifiedText(firstRun, trailingSpaceRun, expansionOpportunities, expansionOpportunityCount, totalLogicalWidth, availableLogicalWidth, lineInfo);
</ins><span class="cx"> 
</span><span class="cx">     return run;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyBase.cpp (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyBase.cpp        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/RenderRubyBase.cpp        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -38,6 +38,8 @@
</span><span class="cx"> 
</span><span class="cx"> RenderRubyBase::RenderRubyBase(Document&amp; document, Ref&lt;RenderStyle&gt;&amp;&amp; style)
</span><span class="cx">     : RenderBlockFlow(document, WTF::move(style))
</span><ins>+    , m_initialOffset(0)
+    , m_isAfterExpansion(true)
</ins><span class="cx"> {
</span><span class="cx">     setInline(false);
</span><span class="cx"> }
</span><span class="lines">@@ -141,6 +143,12 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderRubyBase::adjustInlineDirectionLineBounds(int expansionOpportunityCount, float&amp; logicalLeft, float&amp; logicalWidth) const
</span><span class="cx"> {
</span><ins>+    if (rubyRun()-&gt;hasOverrideWidth() &amp;&amp; firstRootBox() &amp;&amp; !firstRootBox()-&gt;nextRootBox()) {
+        logicalLeft += m_initialOffset;
+        logicalWidth -= 2 * m_initialOffset;
+        return;
+    }
+
</ins><span class="cx">     LayoutUnit maxPreferredLogicalWidth = rubyRun() &amp;&amp; rubyRun()-&gt;hasOverrideWidth() ? rubyRun()-&gt;overrideLogicalContentWidth() : this-&gt;maxPreferredLogicalWidth();
</span><span class="cx">     if (maxPreferredLogicalWidth &gt;= logicalWidth)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyBase.h (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyBase.h        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/RenderRubyBase.h        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -46,6 +46,17 @@
</span><span class="cx">     
</span><span class="cx">     RenderRubyRun* rubyRun() const;
</span><span class="cx"> 
</span><ins>+    void setIsAfterExpansion(bool isAfterExpansion) { m_isAfterExpansion = isAfterExpansion; }
+    bool isAfterExpansion() { return m_isAfterExpansion; }
+
+    void setInitialOffset(float initialOffset) { m_initialOffset = initialOffset; }
+
+    void reset()
+    {
+        m_initialOffset = 0;
+        m_isAfterExpansion = true;
+    }
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual bool isRubyBase() const override { return true; }
</span><span class="cx">     virtual bool isChildAllowed(const RenderObject&amp;, const RenderStyle&amp;) const override;
</span><span class="lines">@@ -59,6 +70,9 @@
</span><span class="cx"> 
</span><span class="cx">     // Allow RenderRubyRun to manipulate the children within ruby bases.
</span><span class="cx">     friend class RenderRubyRun;
</span><ins>+
+    float m_initialOffset;
+    unsigned m_isAfterExpansion : 1;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyRuncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyRun.cpp (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyRun.cpp        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/RenderRubyRun.cpp        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -230,6 +230,9 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderRubyRun::layout()
</span><span class="cx"> {
</span><ins>+    if (RenderRubyBase* base = rubyBase())
+        base-&gt;reset();
+
</ins><span class="cx">     RenderBlockFlow::layout();
</span><span class="cx">     
</span><span class="cx">     RenderRubyText* rt = rubyText();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.cpp (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.cpp        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/RenderText.cpp        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -164,6 +164,7 @@
</span><span class="cx">     , m_knownToHaveNoOverflowAndNoFallbackFonts(false)
</span><span class="cx">     , m_useBackslashAsYenSymbol(false)
</span><span class="cx">     , m_originalTextDiffersFromRendered(false)
</span><ins>+    , m_contentIsKnownToFollow(false)
</ins><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx">     , m_candidateComputedTextSize(0)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.h (177376 => 177377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.h        2014-12-16 19:27:23 UTC (rev 177376)
+++ trunk/Source/WebCore/rendering/RenderText.h        2014-12-16 19:28:57 UTC (rev 177377)
</span><span class="lines">@@ -166,6 +166,9 @@
</span><span class="cx"> 
</span><span class="cx">     LayoutUnit topOfFirstText() const;
</span><span class="cx"> 
</span><ins>+    bool contentIsKnownToFollow() { return m_contentIsKnownToFollow; }
+    void setContentIsKnownToFollow(bool contentIsKnownToFollow) { m_contentIsKnownToFollow = contentIsKnownToFollow; }
+
</ins><span class="cx"> protected:
</span><span class="cx">     virtual void computePreferredLogicalWidths(float leadWidth);
</span><span class="cx">     virtual void willBeDestroyed() override;
</span><span class="lines">@@ -201,21 +204,22 @@
</span><span class="cx">     void node() const = delete;
</span><span class="cx"> 
</span><span class="cx">     // We put the bitfield first to minimize padding on 64-bit.
</span><del>-    bool m_hasBreakableChar : 1; // Whether or not we can be broken into multiple lines.
-    bool m_hasBreak : 1; // Whether or not we have a hard break (e.g., &lt;pre&gt; with '\n').
-    bool m_hasTab : 1; // Whether or not we have a variable width tab character (e.g., &lt;pre&gt; with '\t').
-    bool m_hasBeginWS : 1; // Whether or not we begin with WS (only true if we aren't pre)
-    bool m_hasEndWS : 1; // Whether or not we end with WS (only true if we aren't pre)
-    bool m_linesDirty : 1; // This bit indicates that the text run has already dirtied specific
</del><ins>+    unsigned m_hasBreakableChar : 1; // Whether or not we can be broken into multiple lines.
+    unsigned m_hasBreak : 1; // Whether or not we have a hard break (e.g., &lt;pre&gt; with '\n').
+    unsigned m_hasTab : 1; // Whether or not we have a variable width tab character (e.g., &lt;pre&gt; with '\t').
+    unsigned m_hasBeginWS : 1; // Whether or not we begin with WS (only true if we aren't pre)
+    unsigned m_hasEndWS : 1; // Whether or not we end with WS (only true if we aren't pre)
+    unsigned m_linesDirty : 1; // This bit indicates that the text run has already dirtied specific
</ins><span class="cx">                            // line boxes, and this hint will enable layoutInlineChildren to avoid
</span><span class="cx">                            // just dirtying everything when character data is modified (e.g., appended/inserted
</span><span class="cx">                            // or removed).
</span><del>-    bool m_containsReversedText : 1;
-    bool m_isAllASCII : 1;
-    bool m_canUseSimpleFontCodePath : 1;
-    mutable bool m_knownToHaveNoOverflowAndNoFallbackFonts : 1;
-    bool m_useBackslashAsYenSymbol : 1;
-    bool m_originalTextDiffersFromRendered : 1;
</del><ins>+    unsigned m_containsReversedText : 1;
+    unsigned m_isAllASCII : 1;
+    unsigned m_canUseSimpleFontCodePath : 1;
+    mutable unsigned m_knownToHaveNoOverflowAndNoFallbackFonts : 1;
+    unsigned m_useBackslashAsYenSymbol : 1;
+    unsigned m_originalTextDiffersFromRendered : 1;
+    unsigned m_contentIsKnownToFollow : 1;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx">     // FIXME: This should probably be part of the text sizing structures in Document instead. That would save some memory.
</span></span></pre>
</div>
</div>

</body>
</html>