<!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>[159354] trunk/Source/WebCore</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/159354">159354</a></dd>
<dt>Author</dt> <dd>zoltan@webkit.org</dd>
<dt>Date</dt> <dd>2013-11-15 13:40:59 -0800 (Fri, 15 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move BreakingContext and LineBreaker into their own files
&lt;https://webkit.org/b/124336&gt;

Reviewed by David Hyatt.

In this change I introduced 'line' subdirectory inside 'rendering', this directory will contain all the classes
which have been refactored from RenderBlockLineLayout.cpp. This change contains the separation of BreakingContext,
and the separation of LineBreaker classes. Since I wanted to keep the helper functions organized, I also added a
new file called LineInlineHeaders.h, which contains the functions which used in LineBreaker.h and BreakingContext.h.
I moved LineInfo class into line directory. It was necessary this time, since I added a cpp for it. I'll move the
rest of the line layout related helper classes later. (I wanted to minimize merge conflicts.)

No new tests, no behavior change.

* CMakeLists.txt:
* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCoreCommon.props:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::createRun):
* rendering/line/BreakingContextInlineHeaders.h: Added.
(WebCore::WordMeasurement::WordMeasurement):
(WebCore::TrailingObjects::TrailingObjects):
(WebCore::TrailingObjects::setTrailingWhitespace):
(WebCore::TrailingObjects::clear):
(WebCore::TrailingObjects::appendBoxIfNeeded):
(WebCore::deprecatedAddMidpoint):
(WebCore::startIgnoringSpaces):
(WebCore::stopIgnoringSpaces):
(WebCore::ensureLineBoxInsideIgnoredSpaces):
(WebCore::TrailingObjects::updateMidpointsForTrailingBoxes):
(WebCore::BreakingContext::BreakingContext):
(WebCore::BreakingContext::currentObject):
(WebCore::BreakingContext::lineBreak):
(WebCore::BreakingContext::lineBreakRef):
(WebCore::BreakingContext::lineWidth):
(WebCore::BreakingContext::atEnd):
(WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
(WebCore::BreakingContext::initializeForCurrentObject):
(WebCore::BreakingContext::increment):
(WebCore::BreakingContext::handleBR):
(WebCore::borderPaddingMarginStart):
(WebCore::borderPaddingMarginEnd):
(WebCore::shouldAddBorderPaddingMargin):
(WebCore::previousInFlowSibling):
(WebCore::inlineLogicalWidth):
(WebCore::BreakingContext::handleOutOfFlowPositioned):
(WebCore::BreakingContext::handleFloat):
(WebCore::shouldSkipWhitespaceAfterStartObject):
(WebCore::BreakingContext::handleEmptyInline):
(WebCore::BreakingContext::handleReplaced):
(WebCore::firstPositiveWidth):
(WebCore::updateSegmentsForShapes):
(WebCore::iteratorIsBeyondEndOfRenderCombineText):
(WebCore::nextCharacter):
(WebCore::updateCounterIfNeeded):
(WebCore::measureHyphenWidth):
(WebCore::textWidth):
(WebCore::ensureCharacterGetsLineBox):
(WebCore::tryHyphenating):
(WebCore::BreakingContext::handleText):
(WebCore::textBeginsWithBreakablePosition):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
(WebCore::checkMidpoints):
(WebCore::BreakingContext::handleEndOfLine):
* rendering/line/LineBreaker.cpp: Added.
(WebCore::LineBreaker::reset):
(WebCore::LineBreaker::skipTrailingWhitespace):
(WebCore::LineBreaker::skipLeadingWhitespace):
* rendering/line/LineBreaker.h: Added.
(WebCore::LineBreaker::LineBreaker):
(WebCore::LineBreaker::lineWasHyphenated):
(WebCore::LineBreaker::positionedObjects):
(WebCore::LineBreaker::clear):
* rendering/line/LineInfo.cpp: Added.
(WebCore::LineInfo::setEmpty):
* rendering/line/LineInfo.h: Renamed from Source/WebCore/rendering/LineInfo.h.
(WebCore::LineInfo::LineInfo):
(WebCore::LineInfo::isFirstLine):
(WebCore::LineInfo::isLastLine):
(WebCore::LineInfo::isEmpty):
(WebCore::LineInfo::previousLineBrokeCleanly):
(WebCore::LineInfo::floatPaginationStrut):
(WebCore::LineInfo::runsFromLeadingWhitespace):
(WebCore::LineInfo::resetRunsFromLeadingWhitespace):
(WebCore::LineInfo::incrementRunsFromLeadingWhitespace):
(WebCore::LineInfo::setFirstLine):
(WebCore::LineInfo::setLastLine):
(WebCore::LineInfo::setPreviousLineBrokeCleanly):
(WebCore::LineInfo::setFloatPaginationStrut):
* rendering/line/LineInlineHeaders.h: Added.
(WebCore::hasInlineDirectionBordersPaddingOrMargin):
(WebCore::lineStyle):
(WebCore::requiresLineBoxForContent):
(WebCore::shouldCollapseWhiteSpace):
(WebCore::skipNonBreakingSpace):
(WebCore::alwaysRequiresLineBox):
(WebCore::requiresLineBox):
(WebCore::setStaticPositions):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefileam">trunk/Source/WebCore/GNUmakefile.am</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCoreCommonprops">trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockLineLayoutcpp">trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/rendering/line/</li>
<li><a href="#trunkSourceWebCorerenderinglineBreakingContextInlineHeadersh">trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineBreakercpp">trunk/Source/WebCore/rendering/line/LineBreaker.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineBreakerh">trunk/Source/WebCore/rendering/line/LineBreaker.h</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineInfocpp">trunk/Source/WebCore/rendering/line/LineInfo.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineInfoh">trunk/Source/WebCore/rendering/line/LineInfo.h</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineInlineHeadersh">trunk/Source/WebCore/rendering/line/LineInlineHeaders.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorerenderingLineInfoh">trunk/Source/WebCore/rendering/LineInfo.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (159353 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2013-11-15 20:57:35 UTC (rev 159353)
+++ trunk/Source/WebCore/CMakeLists.txt        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/text&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/plugins&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/rendering&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/rendering/line&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/rendering/mathml&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/rendering/shapes&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/rendering/style&quot;
</span><span class="lines">@@ -2209,6 +2210,9 @@
</span><span class="cx">     rendering/TextPainter.cpp
</span><span class="cx">     rendering/break_lines.cpp
</span><span class="cx"> 
</span><ins>+    rendering/line/LineBreaker.cpp
+    rendering/line/LineInfo.cpp
+
</ins><span class="cx">     rendering/mathml/RenderMathMLBlock.cpp
</span><span class="cx">     rendering/mathml/RenderMathMLFenced.cpp
</span><span class="cx">     rendering/mathml/RenderMathMLFraction.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (159353 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-11-15 20:57:35 UTC (rev 159353)
+++ trunk/Source/WebCore/ChangeLog        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -1,3 +1,109 @@
</span><ins>+2013-11-15  Zoltan Horvath  &lt;zoltan@webkit.org&gt;
+
+        Move BreakingContext and LineBreaker into their own files
+        &lt;https://webkit.org/b/124336&gt;
+
+        Reviewed by David Hyatt.
+
+        In this change I introduced 'line' subdirectory inside 'rendering', this directory will contain all the classes
+        which have been refactored from RenderBlockLineLayout.cpp. This change contains the separation of BreakingContext,
+        and the separation of LineBreaker classes. Since I wanted to keep the helper functions organized, I also added a
+        new file called LineInlineHeaders.h, which contains the functions which used in LineBreaker.h and BreakingContext.h.
+        I moved LineInfo class into line directory. It was necessary this time, since I added a cpp for it. I'll move the
+        rest of the line layout related helper classes later. (I wanted to minimize merge conflicts.)
+
+        No new tests, no behavior change.
+
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * GNUmakefile.list.am:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCoreCommon.props:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::createRun):
+        * rendering/line/BreakingContextInlineHeaders.h: Added.
+        (WebCore::WordMeasurement::WordMeasurement):
+        (WebCore::TrailingObjects::TrailingObjects):
+        (WebCore::TrailingObjects::setTrailingWhitespace):
+        (WebCore::TrailingObjects::clear):
+        (WebCore::TrailingObjects::appendBoxIfNeeded):
+        (WebCore::deprecatedAddMidpoint):
+        (WebCore::startIgnoringSpaces):
+        (WebCore::stopIgnoringSpaces):
+        (WebCore::ensureLineBoxInsideIgnoredSpaces):
+        (WebCore::TrailingObjects::updateMidpointsForTrailingBoxes):
+        (WebCore::BreakingContext::BreakingContext):
+        (WebCore::BreakingContext::currentObject):
+        (WebCore::BreakingContext::lineBreak):
+        (WebCore::BreakingContext::lineBreakRef):
+        (WebCore::BreakingContext::lineWidth):
+        (WebCore::BreakingContext::atEnd):
+        (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
+        (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
+        (WebCore::BreakingContext::initializeForCurrentObject):
+        (WebCore::BreakingContext::increment):
+        (WebCore::BreakingContext::handleBR):
+        (WebCore::borderPaddingMarginStart):
+        (WebCore::borderPaddingMarginEnd):
+        (WebCore::shouldAddBorderPaddingMargin):
+        (WebCore::previousInFlowSibling):
+        (WebCore::inlineLogicalWidth):
+        (WebCore::BreakingContext::handleOutOfFlowPositioned):
+        (WebCore::BreakingContext::handleFloat):
+        (WebCore::shouldSkipWhitespaceAfterStartObject):
+        (WebCore::BreakingContext::handleEmptyInline):
+        (WebCore::BreakingContext::handleReplaced):
+        (WebCore::firstPositiveWidth):
+        (WebCore::updateSegmentsForShapes):
+        (WebCore::iteratorIsBeyondEndOfRenderCombineText):
+        (WebCore::nextCharacter):
+        (WebCore::updateCounterIfNeeded):
+        (WebCore::measureHyphenWidth):
+        (WebCore::textWidth):
+        (WebCore::ensureCharacterGetsLineBox):
+        (WebCore::tryHyphenating):
+        (WebCore::BreakingContext::handleText):
+        (WebCore::textBeginsWithBreakablePosition):
+        (WebCore::BreakingContext::canBreakAtThisPosition):
+        (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
+        (WebCore::checkMidpoints):
+        (WebCore::BreakingContext::handleEndOfLine):
+        * rendering/line/LineBreaker.cpp: Added.
+        (WebCore::LineBreaker::reset):
+        (WebCore::LineBreaker::skipTrailingWhitespace):
+        (WebCore::LineBreaker::skipLeadingWhitespace):
+        * rendering/line/LineBreaker.h: Added.
+        (WebCore::LineBreaker::LineBreaker):
+        (WebCore::LineBreaker::lineWasHyphenated):
+        (WebCore::LineBreaker::positionedObjects):
+        (WebCore::LineBreaker::clear):
+        * rendering/line/LineInfo.cpp: Added.
+        (WebCore::LineInfo::setEmpty):
+        * rendering/line/LineInfo.h: Renamed from Source/WebCore/rendering/LineInfo.h.
+        (WebCore::LineInfo::LineInfo):
+        (WebCore::LineInfo::isFirstLine):
+        (WebCore::LineInfo::isLastLine):
+        (WebCore::LineInfo::isEmpty):
+        (WebCore::LineInfo::previousLineBrokeCleanly):
+        (WebCore::LineInfo::floatPaginationStrut):
+        (WebCore::LineInfo::runsFromLeadingWhitespace):
+        (WebCore::LineInfo::resetRunsFromLeadingWhitespace):
+        (WebCore::LineInfo::incrementRunsFromLeadingWhitespace):
+        (WebCore::LineInfo::setFirstLine):
+        (WebCore::LineInfo::setLastLine):
+        (WebCore::LineInfo::setPreviousLineBrokeCleanly):
+        (WebCore::LineInfo::setFloatPaginationStrut):
+        * rendering/line/LineInlineHeaders.h: Added.
+        (WebCore::hasInlineDirectionBordersPaddingOrMargin):
+        (WebCore::lineStyle):
+        (WebCore::requiresLineBoxForContent):
+        (WebCore::shouldCollapseWhiteSpace):
+        (WebCore::skipNonBreakingSpace):
+        (WebCore::alwaysRequiresLineBox):
+        (WebCore::requiresLineBox):
+        (WebCore::setStaticPositions):
+
</ins><span class="cx"> 2013-11-15  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move execution of IDBTransactionBackendOperations to the IDBServerConnection
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.am (159353 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.am        2013-11-15 20:57:35 UTC (rev 159353)
+++ trunk/Source/WebCore/GNUmakefile.am        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx">         -I$(srcdir)/Source/WebCore/plugins \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/plugins/win \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/rendering \
</span><ins>+        -I$(srcdir)/Source/WebCore/rendering/line \
</ins><span class="cx">         -I$(srcdir)/Source/WebCore/rendering/mathml \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/rendering/shapes \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/rendering/style \
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (159353 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2013-11-15 20:57:35 UTC (rev 159353)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -4301,7 +4301,6 @@
</span><span class="cx">         Source/WebCore/rendering/LogicalSelectionOffsetCaches.h \
</span><span class="cx">         Source/WebCore/rendering/LayoutRepainter.h \
</span><span class="cx">         Source/WebCore/rendering/LayoutRepainter.cpp \
</span><del>-        Source/WebCore/rendering/LineInfo.h \
</del><span class="cx">         Source/WebCore/rendering/LineLayoutState.h \
</span><span class="cx">         Source/WebCore/rendering/LineWidth.h \
</span><span class="cx">         Source/WebCore/rendering/LineWidth.cpp \
</span><span class="lines">@@ -4506,6 +4505,12 @@
</span><span class="cx">         Source/WebCore/rendering/TextPainter.h \
</span><span class="cx">         Source/WebCore/rendering/TextPaintStyle.h \
</span><span class="cx">         Source/WebCore/rendering/VerticalPositionCache.h \
</span><ins>+        Source/WebCore/rendering/line/BreakingContextInlineHeaders.h \
+        Source/WebCore/rendering/line/LineInfo.h \
+        Source/WebCore/rendering/line/LineInfo.cpp \
+        Source/WebCore/rendering/line/LineBreaker.h \
+        Source/WebCore/rendering/line/LineBreaker.cpp \
+        Source/WebCore/rendering/line/LineInlineHeaders.h \
</ins><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp \
</span><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLBlock.h \
</span><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (159353 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-11-15 20:57:35 UTC (rev 159353)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -11050,6 +11050,8 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\SimpleLineLayout.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\SimpleLineLayoutFunctions.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\TextPaintStyle.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\rendering\line\LineBreaker.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\rendering\line\LineInfo.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\shapes\PolygonShape.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\shapes\RasterShape.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\shapes\RectangleShape.cpp&quot; /&gt;
</span><span class="lines">@@ -19779,7 +19781,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\InlineTextBox.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\LayoutRepainter.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\LayoutState.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\rendering\LineInfo.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\LineLayoutState.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\LineWidth.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\OrderIterator.h&quot; /&gt;
</span><span class="lines">@@ -19854,6 +19855,10 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\RenderSelectionInfo.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\RenderSlider.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\RenderSnapshottedPlugIn.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\rendering\line\BreakingContextInlineHeaders.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\rendering\line\LineBreaker.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\rendering\line\LineInfo.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\rendering\line\LineInlineHeaders.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\shapes\PolygonShape.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\shapes\RasterShape.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\shapes\RectangleShape.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCoreCommonprops"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props (159353 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props        2013-11-15 20:57:35 UTC (rev 159353)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -7,11 +7,11 @@
</span><span class="cx">   &lt;/PropertyGroup&gt;
</span><span class="cx">   &lt;ItemDefinitionGroup&gt;
</span><span class="cx">     &lt;ClCompile&gt;
</span><del>-      &lt;AdditionalIncludeDirectories&gt;$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)&lt;/AdditionalIncludeDirectories&gt;
</del><ins>+      &lt;AdditionalIncludeDirectories&gt;$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)&lt;/AdditionalIncludeDirectories&gt;
</ins><span class="cx">       &lt;PreprocessorDefinitions&gt;DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS;%(PreprocessorDefinitions)&lt;/PreprocessorDefinitions&gt;
</span><span class="cx">       &lt;PrecompiledHeader&gt;Use&lt;/PrecompiledHeader&gt;
</span><span class="cx">       &lt;PrecompiledHeaderFile&gt;WebCorePrefix.h&lt;/PrecompiledHeaderFile&gt;
</span><span class="cx">       &lt;ForcedIncludeFiles&gt;WebCorePrefix.h;ICUVersion.h;%(ForcedIncludeFiles)&lt;/ForcedIncludeFiles&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">   &lt;/ItemDefinitionGroup&gt;
</span><del>-&lt;/Project&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/Project&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (159353 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-15 20:57:35 UTC (rev 159353)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -3437,7 +3437,6 @@
</span><span class="cx">                 9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */; };
</span><span class="cx">                 A024575116CEAA27000E5671 /* EXTDrawBuffers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A024574E16CEAA27000E5671 /* EXTDrawBuffers.cpp */; };
</span><span class="cx">                 A024575216CEAA27000E5671 /* EXTDrawBuffers.h in Headers */ = {isa = PBXBuildFile; fileRef = A024574F16CEAA27000E5671 /* EXTDrawBuffers.h */; };
</span><del>-                A06BFE2E17DFB43F008302BB /* LineInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A06BFE2C17DFB433008302BB /* LineInfo.h */; };
</del><span class="cx">                 A07D3355152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A07D3353152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp */; };
</span><span class="cx">                 A07D3356152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A07D3354152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h */; };
</span><span class="cx">                 A07D3358152B632D001B6393 /* WebGLShaderPrecisionFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A07D3357152B632D001B6393 /* WebGLShaderPrecisionFormat.h */; };
</span><span class="lines">@@ -6299,6 +6298,8 @@
</span><span class="cx">                 FEE1811416C319E800084849 /* SQLTransactionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE1811216C319E800084849 /* SQLTransactionBackend.h */; };
</span><span class="cx">                 FF945ECB161F7F3600971BC8 /* PseudoElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FF945EC9161F7F3600971BC8 /* PseudoElement.cpp */; };
</span><span class="cx">                 FF945ECC161F7F3600971BC8 /* PseudoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FF945ECA161F7F3600971BC8 /* PseudoElement.h */; };
</span><ins>+                FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CA1833EC3800158A31 /* LineBreaker.cpp */; };
+                FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CD1833F17600158A31 /* LineInfo.cpp */; };
</ins><span class="cx">                 FFD5B97A135CC97800D5E92A /* PageVisibilityState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */; };
</span><span class="cx">                 FFD5B97B135CC97800D5E92A /* PageVisibilityState.h in Headers */ = {isa = PBXBuildFile; fileRef = FFD5B978135CC97800D5E92A /* PageVisibilityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx"> /* End PBXBuildFile section */
</span><span class="lines">@@ -10206,7 +10207,6 @@
</span><span class="cx">                 A024574E16CEAA27000E5671 /* EXTDrawBuffers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTDrawBuffers.cpp; path = canvas/EXTDrawBuffers.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A024574F16CEAA27000E5671 /* EXTDrawBuffers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTDrawBuffers.h; path = canvas/EXTDrawBuffers.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A024575016CEAA27000E5671 /* EXTDrawBuffers.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTDrawBuffers.idl; path = canvas/EXTDrawBuffers.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                A06BFE2C17DFB433008302BB /* LineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 A0718BE817E26F1600F6BF44 /* LineLayoutState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineLayoutState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A07D3353152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLShaderPrecisionFormat.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A07D3354152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLShaderPrecisionFormat.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13472,6 +13472,11 @@
</span><span class="cx">                 FEE1811216C319E800084849 /* SQLTransactionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionBackend.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FF945EC9161F7F3600971BC8 /* PseudoElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PseudoElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FF945ECA161F7F3600971BC8 /* PseudoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FFB698C91832F10B00158A31 /* BreakingContextInlineHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BreakingContextInlineHeaders.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FFB698CA1833EC3800158A31 /* LineBreaker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineBreaker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FFB698CB1833EC3800158A31 /* LineBreaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreaker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FFB698CD1833F17600158A31 /* LineInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FFB698CE1833F17600158A31 /* LineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageVisibilityState.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FFD5B978135CC97800D5E92A /* PageVisibilityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageVisibilityState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx"> /* End PBXFileReference section */
</span><span class="lines">@@ -20901,6 +20906,7 @@
</span><span class="cx">                 F523D2F302DE443B018635CA /* rendering */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                FFB698C81832F10B00158A31 /* line */,
</ins><span class="cx">                                 CDE7FC42181904B1002BBB77 /* OrderIterator.cpp */,
</span><span class="cx">                                 CDE7FC43181904B1002BBB77 /* OrderIterator.h */,
</span><span class="cx">                                 439046C212DA25CE00AF80A2 /* mathml */,
</span><span class="lines">@@ -20949,7 +20955,6 @@
</span><span class="cx">                                 A120ACA013F9983700FE4AC7 /* LayoutRepainter.h */,
</span><span class="cx">                                 2D9066040BE141D400956998 /* LayoutState.cpp */,
</span><span class="cx">                                 2D9066050BE141D400956998 /* LayoutState.h */,
</span><del>-                                A06BFE2C17DFB433008302BB /* LineInfo.h */,
</del><span class="cx">                                 A0718BE817E26F1600F6BF44 /* LineLayoutState.h */,
</span><span class="cx">                                 A0CB002317DF81AC0017896B /* LineWidth.cpp */,
</span><span class="cx">                                 A0CB002117DE9CD00017896B /* LineWidth.h */,
</span><span class="lines">@@ -21889,6 +21894,18 @@
</span><span class="cx">                         name = WebAudio;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                FFB698C81832F10B00158A31 /* line */ = {
+                        isa = PBXGroup;
+                        children = (
+                                FFB698CD1833F17600158A31 /* LineInfo.cpp */,
+                                FFB698CE1833F17600158A31 /* LineInfo.h */,
+                                FFB698CA1833EC3800158A31 /* LineBreaker.cpp */,
+                                FFB698CB1833EC3800158A31 /* LineBreaker.h */,
+                                FFB698C91832F10B00158A31 /* BreakingContextInlineHeaders.h */,
+                        );
+                        path = line;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx"> /* End PBXGroup section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXHeadersBuildPhase section */
</span><span class="lines">@@ -25182,7 +25199,6 @@
</span><span class="cx">                                 BE16C59517CFE17200852C04 /* InbandWebVTTTextTrack.h in Headers */,
</span><span class="cx">                                 BC10D76817D8EE71005E2626 /* RenderBlockFlow.h in Headers */,
</span><span class="cx">                                 A0CB002517DF826C0017896B /* LineWidth.h in Headers */,
</span><del>-                                A06BFE2E17DFB43F008302BB /* LineInfo.h in Headers */,
</del><span class="cx">                                 CD3E251C18046B0600E27F56 /* GridCoordinate.h in Headers */,
</span><span class="cx">                                 CD3E252418046BCD00E27F56 /* CSSGridTemplateValue.h in Headers */,
</span><span class="cx">                                 CDEF4FD717E85C8F00AEE24B /* GridLength.h in Headers */,
</span><span class="lines">@@ -25767,6 +25783,7 @@
</span><span class="cx">                                 977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
</span><span class="cx">                                 A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,
</span><span class="cx">                                 A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
</span><ins>+                                FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */,
</ins><span class="cx">                                 78D02BC5154A18DF00B62D05 /* CSSPropertyAnimation.cpp in Sources */,
</span><span class="cx">                                 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
</span><span class="cx">                                 07C59B5617F4AC15000FBCBB /* VideoStreamTrack.cpp in Sources */,
</span><span class="lines">@@ -26573,6 +26590,7 @@
</span><span class="cx">                                 070363E5181A1CDC00C074A5 /* AVMediaCaptureSource.mm in Sources */,
</span><span class="cx">                                 9392262F10321084006E7D5D /* JSCSSRuleListCustom.cpp in Sources */,
</span><span class="cx">                                 142011B60A003133008303F9 /* JSCSSStyleDeclaration.cpp in Sources */,
</span><ins>+                                FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */,
</ins><span class="cx">                                 BC5825F30C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp in Sources */,
</span><span class="cx">                                 BC46C2060C0DDCA10020CFC3 /* JSCSSStyleRule.cpp in Sources */,
</span><span class="cx">                                 BCC5BE000C0E93110011C2DB /* JSCSSStyleSheet.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLineInfoh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/rendering/LineInfo.h (159353 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LineInfo.h        2013-11-15 20:57:35 UTC (rev 159353)
+++ trunk/Source/WebCore/rendering/LineInfo.h        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer in the documentation and/or other materials
- *    provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LineInfo_h
-#define LineInfo_h
-
-#include &quot;LineWidth.h&quot;
-
-namespace WebCore {
-
-class LineInfo {
-public:
-    LineInfo()
-        : m_isFirstLine(true)
-        , m_isLastLine(false)
-        , m_isEmpty(true)
-        , m_previousLineBrokeCleanly(true)
-        , m_floatPaginationStrut(0)
-        , m_runsFromLeadingWhitespace(0)
-    { }
-
-    bool isFirstLine() const { return m_isFirstLine; }
-    bool isLastLine() const { return m_isLastLine; }
-    bool isEmpty() const { return m_isEmpty; }
-    bool previousLineBrokeCleanly() const { return m_previousLineBrokeCleanly; }
-    LayoutUnit floatPaginationStrut() const { return m_floatPaginationStrut; }
-    unsigned runsFromLeadingWhitespace() const { return m_runsFromLeadingWhitespace; }
-    void resetRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace = 0; }
-    void incrementRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace++; }
-
-    void setFirstLine(bool firstLine) { m_isFirstLine = firstLine; }
-    void setLastLine(bool lastLine) { m_isLastLine = lastLine; }
-    void setEmpty(bool empty, RenderBlock* block = 0, LineWidth* lineWidth = 0)
-    {
-        if (m_isEmpty == empty)
-            return;
-        m_isEmpty = empty;
-        if (!empty &amp;&amp; block &amp;&amp; floatPaginationStrut()) {
-            block-&gt;setLogicalHeight(block-&gt;logicalHeight() + floatPaginationStrut());
-            setFloatPaginationStrut(0);
-            lineWidth-&gt;updateAvailableWidth();
-        }
-    }
-
-    void setPreviousLineBrokeCleanly(bool previousLineBrokeCleanly) { m_previousLineBrokeCleanly = previousLineBrokeCleanly; }
-    void setFloatPaginationStrut(LayoutUnit strut) { m_floatPaginationStrut = strut; }
-
-private:
-    bool m_isFirstLine;
-    bool m_isLastLine;
-    bool m_isEmpty;
-    bool m_previousLineBrokeCleanly;
-    LayoutUnit m_floatPaginationStrut;
-    unsigned m_runsFromLeadingWhitespace;
-};
-
-}
-
-#endif // LineInfo_h
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (159353 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2013-11-15 20:57:35 UTC (rev 159353)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -3,6 +3,7 @@
</span><span class="cx">  * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2013 ChangSeok Oh &lt;shivamidow@gmail.com&gt;
</span><ins>+ * Copyright (C) 2013 Adobe Systems Inc. All right reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -25,138 +26,31 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><span class="cx"> #include &quot;BidiResolver.h&quot;
</span><ins>+#include &quot;BreakingContextInlineHeaders.h&quot;
</ins><span class="cx"> #include &quot;FloatingObjects.h&quot;
</span><del>-#include &quot;Hyphenation.h&quot;
</del><span class="cx"> #include &quot;InlineElementBox.h&quot;
</span><span class="cx"> #include &quot;InlineIterator.h&quot;
</span><span class="cx"> #include &quot;InlineTextBox.h&quot;
</span><del>-#include &quot;LineInfo.h&quot;
</del><span class="cx"> #include &quot;LineLayoutState.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;RenderBlockFlow.h&quot;
</span><del>-#include &quot;RenderCombineText.h&quot;
-#include &quot;RenderCounter.h&quot;
</del><span class="cx"> #include &quot;RenderFlowThread.h&quot;
</span><del>-#include &quot;RenderInline.h&quot;
-#include &quot;RenderLayer.h&quot;
</del><span class="cx"> #include &quot;RenderLineBreak.h&quot;
</span><del>-#include &quot;RenderListMarker.h&quot;
</del><span class="cx"> #include &quot;RenderRegion.h&quot;
</span><del>-#include &quot;RenderRubyRun.h&quot;
</del><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;SimpleLineLayoutFunctions.h&quot;
</span><span class="cx"> #include &quot;TrailingFloatsRootInlineBox.h&quot;
</span><span class="cx"> #include &quot;VerticalPositionCache.h&quot;
</span><del>-#include &quot;break_lines.h&quot;
</del><span class="cx"> #include &lt;wtf/RefCountedLeakCounter.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><del>-#include &lt;wtf/Vector.h&gt;
-#include &lt;wtf/unicode/CharacterNames.h&gt;
</del><span class="cx"> 
</span><del>-#if ENABLE(CSS_SHAPES)
-#include &quot;ShapeInsideInfo.h&quot;
-#endif
-
</del><span class="cx"> #if ENABLE(SVG)
</span><del>-#include &quot;RenderSVGInlineText.h&quot;
</del><span class="cx"> #include &quot;SVGRootInlineBox.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-using namespace WTF;
-using namespace Unicode;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-// We don't let our line box tree for a single line get any deeper than this.
-const unsigned cMaxLineDepth = 200;
-
-struct RenderTextInfo {
-    // Destruction of m_layout requires TextLayout to be a complete type, so the constructor and destructor are made non-inline to avoid compilation errors.
-    RenderTextInfo();
-    ~RenderTextInfo();
-
-    RenderText* m_text;
-    OwnPtr&lt;TextLayout&gt; m_layout;
-    LazyLineBreakIterator m_lineBreakIterator;
-    const Font* m_font;
-};
-
-class LineBreaker {
-public:
-    friend class BreakingContext;
-    LineBreaker(RenderBlockFlow&amp; block)
-        : m_block(block)
-    {
-        reset();
-    }
-
-    InlineIterator nextLineBreak(InlineBidiResolver&amp;, LineInfo&amp;, RenderTextInfo&amp;, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&amp;);
-
-    bool lineWasHyphenated() { return m_hyphenated; }
-    const Vector&lt;RenderBox*&gt;&amp; positionedObjects() { return m_positionedObjects; }
-    EClear clear() { return m_clear; }
-
-private:
-    void reset();
-
-    InlineIterator nextSegmentBreak(InlineBidiResolver&amp;, LineInfo&amp;, RenderTextInfo&amp;, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&amp;);
-    void skipTrailingWhitespace(InlineIterator&amp;, const LineInfo&amp;);
-    void skipLeadingWhitespace(InlineBidiResolver&amp;, LineInfo&amp;, FloatingObject* lastFloatFromPreviousLine, LineWidth&amp;);
-
-    RenderBlockFlow&amp; m_block;
-    bool m_hyphenated;
-    EClear m_clear;
-    Vector&lt;RenderBox*&gt; m_positionedObjects;
-};
-
-static inline LayoutUnit borderPaddingMarginStart(const RenderInline&amp; child)
-{
-    return child.marginStart() + child.paddingStart() + child.borderStart();
-}
-
-static inline LayoutUnit borderPaddingMarginEnd(const RenderInline&amp; child)
-{
-    return child.marginEnd() + child.paddingEnd() + child.borderEnd();
-}
-
-static inline bool shouldAddBorderPaddingMargin(RenderObject* child)
-{
-    // When deciding whether we're at the edge of an inline, adjacent collapsed whitespace is the same as no sibling at all.
-    return !child || (child-&gt;isText() &amp;&amp; !toRenderText(child)-&gt;textLength());
-}
-
-static RenderObject* previousInFlowSibling(RenderObject* child)
-{
-    child = child-&gt;previousSibling();
-    while (child &amp;&amp; child-&gt;isOutOfFlowPositioned())
-        child = child-&gt;previousSibling();
-    return child;
-}
-
-static LayoutUnit inlineLogicalWidth(RenderObject* child, bool checkStartEdge = true, bool checkEndEdge = true)
-{
-    unsigned lineDepth = 1;
-    LayoutUnit extraWidth = 0;
-    RenderElement* parent = child-&gt;parent();
-    while (parent-&gt;isRenderInline() &amp;&amp; lineDepth++ &lt; cMaxLineDepth) {
-        const RenderInline&amp; parentAsRenderInline = toRenderInline(*parent);
-        if (!isEmptyInline(parentAsRenderInline)) {
-            checkStartEdge = checkStartEdge &amp;&amp; shouldAddBorderPaddingMargin(previousInFlowSibling(child));
-            if (checkStartEdge)
-                extraWidth += borderPaddingMarginStart(parentAsRenderInline);
-            checkEndEdge = checkEndEdge &amp;&amp; shouldAddBorderPaddingMargin(child-&gt;nextSibling());
-            if (checkEndEdge)
-                extraWidth += borderPaddingMarginEnd(parentAsRenderInline);
-            if (!checkStartEdge &amp;&amp; !checkEndEdge)
-                return extraWidth;
-        }
-        child = parent;
-        parent = child-&gt;parent();
-    }
-    return extraWidth;
-}
-
</del><span class="cx"> static void determineDirectionality(TextDirection&amp; dir, InlineIterator iter)
</span><span class="cx"> {
</span><span class="cx">     while (!iter.atEnd()) {
</span><span class="lines">@@ -177,68 +71,8 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void checkMidpoints(LineMidpointState&amp; lineMidpointState, InlineIterator&amp; lBreak)
</del><ins>+inline BidiRun* createRun(int start, int end, RenderObject* obj, InlineBidiResolver&amp; resolver)
</ins><span class="cx"> {
</span><del>-    // Check to see if our last midpoint is a start point beyond the line break.  If so,
-    // shave it off the list, and shave off a trailing space if the previous end point doesn't
-    // preserve whitespace.
-    if (lBreak.m_obj &amp;&amp; lineMidpointState.numMidpoints &amp;&amp; !(lineMidpointState.numMidpoints % 2)) {
-        InlineIterator* midpoints = lineMidpointState.midpoints.data();
-        InlineIterator&amp; endpoint = midpoints[lineMidpointState.numMidpoints - 2];
-        const InlineIterator&amp; startpoint = midpoints[lineMidpointState.numMidpoints - 1];
-        InlineIterator currpoint = endpoint;
-        while (!currpoint.atEnd() &amp;&amp; currpoint != startpoint &amp;&amp; currpoint != lBreak)
-            currpoint.increment();
-        if (currpoint == lBreak) {
-            // We hit the line break before the start point.  Shave off the start point.
-            lineMidpointState.numMidpoints--;
-            if (endpoint.m_obj-&gt;style().collapseWhiteSpace() &amp;&amp; endpoint.m_obj-&gt;isText())
-                endpoint.m_pos--;
-        }
-    }
-}
-
-// Don't call this directly. Use one of the descriptive helper functions below.
-static void deprecatedAddMidpoint(LineMidpointState&amp; lineMidpointState, const InlineIterator&amp; midpoint)
-{
-    if (lineMidpointState.midpoints.size() &lt;= lineMidpointState.numMidpoints)
-        lineMidpointState.midpoints.grow(lineMidpointState.numMidpoints + 10);
-
-    InlineIterator* midpoints = lineMidpointState.midpoints.data();
-    midpoints[lineMidpointState.numMidpoints++] = midpoint;
-}
-
-static inline void startIgnoringSpaces(LineMidpointState&amp; lineMidpointState, const InlineIterator&amp; midpoint)
-{
-    ASSERT(!(lineMidpointState.numMidpoints % 2));
-    deprecatedAddMidpoint(lineMidpointState, midpoint);
-}
-
-static inline void stopIgnoringSpaces(LineMidpointState&amp; lineMidpointState, const InlineIterator&amp; midpoint)
-{
-    ASSERT(lineMidpointState.numMidpoints % 2);
-    deprecatedAddMidpoint(lineMidpointState, midpoint);
-}
-
-// When ignoring spaces, this needs to be called for objects that need line boxes such as RenderInlines or
-// hard line breaks to ensure that they're not ignored.
-static inline void ensureLineBoxInsideIgnoredSpaces(LineMidpointState&amp; lineMidpointState, RenderObject* renderer)
-{
-    InlineIterator midpoint(0, renderer, 0);
-    stopIgnoringSpaces(lineMidpointState, midpoint);
-    startIgnoringSpaces(lineMidpointState, midpoint);
-}
-
-// Adding a pair of midpoints before a character will split it out into a new line box.
-static inline void ensureCharacterGetsLineBox(LineMidpointState&amp; lineMidpointState, InlineIterator&amp; textParagraphSeparator)
-{
-    InlineIterator midpoint(0, textParagraphSeparator.m_obj, textParagraphSeparator.m_pos);
-    startIgnoringSpaces(lineMidpointState, InlineIterator(0, textParagraphSeparator.m_obj, textParagraphSeparator.m_pos - 1));
-    stopIgnoringSpaces(lineMidpointState, InlineIterator(0, textParagraphSeparator.m_obj, textParagraphSeparator.m_pos));
-}
-
-static inline BidiRun* createRun(int start, int end, RenderObject* obj, InlineBidiResolver&amp; resolver)
-{
</del><span class="cx">     ASSERT(obj);
</span><span class="cx">     return new BidiRun(start, end, *obj, resolver.context(), resolver.dir());
</span><span class="cx"> }
</span><span class="lines">@@ -303,7 +137,6 @@
</span><span class="cx">     return rootBox;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> static inline InlineBox* createInlineBoxForRenderer(RenderObject* obj, bool isRootLineBox, bool isOnlyRun = false)
</span><span class="cx"> {
</span><span class="cx">     if (isRootLineBox)
</span><span class="lines">@@ -329,15 +162,6 @@
</span><span class="cx">     return toRenderInline(obj)-&gt;createAndAppendInlineFlowBox();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// FIXME: Don't let counters mark themselves as needing pref width recalcs during layout
-// so we don't need this hack.
-static inline void updateCounterIfNeeded(RenderText&amp; renderText)
-{
-    if (!renderText.preferredLogicalWidthsDirty() || !renderText.isCounter())
-        return;
-    toRenderCounter(renderText).updateCounter();
-}
-
</del><span class="cx"> static inline void dirtyLineBoxesForRenderer(RenderObject&amp; renderer, bool fullLayout)
</span><span class="cx"> {
</span><span class="cx">     if (renderer.isText()) {
</span><span class="lines">@@ -605,34 +429,6 @@
</span><span class="cx">     setMarginEndForChild(renderer, -endOverhang);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline float measureHyphenWidth(RenderText* renderer, const Font&amp; font, HashSet&lt;const SimpleFontData*&gt;* fallbackFonts = 0)
-{
-    const RenderStyle&amp; style = renderer-&gt;style();
-    return font.width(RenderBlock::constructTextRun(renderer, font, style.hyphenString().string(), style), fallbackFonts);
-}
-
-class WordMeasurement {
-public:
-    WordMeasurement()
-        : renderer(0)
-        , width(0)
-        , startOffset(0)
-        , endOffset(0)
-    {
-    }
-    
-    RenderText* renderer;
-    float width;
-    int startOffset;
-    int endOffset;
-    HashSet&lt;const SimpleFontData*&gt; fallbackFonts;
-};
-
-static inline const RenderStyle&amp; lineStyle(const RenderElement&amp; renderer, const LineInfo&amp; lineInfo)
-{
-    return lineInfo.isFirstLine() ? renderer.firstLineStyle() : renderer.style();
-}
-
</del><span class="cx"> static inline void setLogicalWidthForTextRun(RootInlineBox* lineBox, BidiRun* run, RenderText* renderer, float xPos, const LineInfo&amp; lineInfo,
</span><span class="cx">     GlyphOverflowAndFallbackFontsMap&amp; textBoxDataMap, VerticalPositionCache&amp; verticalPositionCache, WordMeasurements&amp; wordMeasurements)
</span><span class="cx"> {
</span><span class="lines">@@ -997,24 +793,6 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
-static void setStaticPositions(RenderBlockFlow&amp; block, RenderBox&amp; child)
-{
-    // FIXME: The math here is actually not really right. It's a best-guess approximation that
-    // will work for the common cases
-    RenderElement* containerBlock = child.container();
-    LayoutUnit blockHeight = block.logicalHeight();
-    if (containerBlock-&gt;isRenderInline()) {
-        // A relative positioned inline encloses us. In this case, we also have to determine our
-        // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned
-        // inline so that we can obtain the value later.
-        toRenderInline(containerBlock)-&gt;layer()-&gt;setStaticInlinePosition(block.startAlignedOffsetForLine(blockHeight, false));
-        toRenderInline(containerBlock)-&gt;layer()-&gt;setStaticBlockPosition(blockHeight);
-    }
-    block.updateStaticInlinePositionForChild(child, blockHeight);
-    child.layer()-&gt;setStaticBlockPosition(blockHeight);
-}
-
</del><span class="cx"> template &lt;typename CharacterType&gt;
</span><span class="cx"> static inline int findFirstTrailingSpace(const RenderText&amp; lastText, const CharacterType* characters, int start, int stop)
</span><span class="cx"> {
</span><span class="lines">@@ -1466,15 +1244,6 @@
</span><span class="cx">         pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline float firstPositiveWidth(const WordMeasurements&amp; wordMeasurements)
-{
-    for (size_t i = 0; i &lt; wordMeasurements.size(); ++i) {
-        if (wordMeasurements[i].width &gt; 0)
-            return wordMeasurements[i].width;
-    }
-    return 0;
-}
-
</del><span class="cx"> static inline LayoutUnit adjustLogicalLineTop(ShapeInsideInfo* shapeInsideInfo, InlineIterator start, InlineIterator end, const WordMeasurements&amp; wordMeasurements)
</span><span class="cx"> {
</span><span class="cx">     if (!shapeInsideInfo || end != start)
</span><span class="lines">@@ -2225,91 +1994,6 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool skipNonBreakingSpace(const InlineIterator&amp; it, const LineInfo&amp; lineInfo)
-{
-    if (it.m_obj-&gt;style().nbspMode() != SPACE || it.current() != noBreakSpace)
-        return false;
-
-    // FIXME: This is bad.  It makes nbsp inconsistent with space and won't work correctly
-    // with m_minWidth/m_maxWidth.
-    // Do not skip a non-breaking space if it is the first character
-    // on a line after a clean line break (or on the first line, since previousLineBrokeCleanly starts off
-    // |true|).
-    if (lineInfo.isEmpty() &amp;&amp; lineInfo.previousLineBrokeCleanly())
-        return false;
-
-    return true;
-}
-
-enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace };
-static inline bool shouldCollapseWhiteSpace(const RenderStyle* style, const LineInfo&amp; lineInfo, WhitespacePosition whitespacePosition)
-{
-    // CSS2 16.6.1
-    // If a space (U+0020) at the beginning of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is removed.
-    // If a space (U+0020) at the end of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is also removed.
-    // If spaces (U+0020) or tabs (U+0009) at the end of a line have 'white-space' set to 'pre-wrap', UAs may visually collapse them.
-    return style-&gt;collapseWhiteSpace()
-        || (whitespacePosition == TrailingWhitespace &amp;&amp; style-&gt;whiteSpace() == PRE_WRAP &amp;&amp; (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
-}
-
-static bool requiresLineBoxForContent(const RenderInline&amp; flow, const LineInfo&amp; lineInfo)
-{
-    RenderElement* parent = flow.parent();
-    if (flow.document().inNoQuirksMode()) {
-        const RenderStyle&amp; flowStyle = lineStyle(flow, lineInfo);
-        const RenderStyle&amp; parentStyle = lineStyle(*parent, lineInfo);
-        if (flowStyle.lineHeight() != parentStyle.lineHeight()
-            || flowStyle.verticalAlign() != parentStyle.verticalAlign()
-            || !parentStyle.font().fontMetrics().hasIdenticalAscentDescentAndLineGap(flowStyle.font().fontMetrics()))
-        return true;
-    }
-    return false;
-}
-
-static bool hasInlineDirectionBordersPaddingOrMargin(const RenderInline&amp; flow)
-{
-    // Where an empty inline is split across anonymous blocks we should only give lineboxes to the 'sides' of the
-    // inline that have borders, padding or margin.
-    bool shouldApplyStartBorderPaddingOrMargin = !flow.parent()-&gt;isAnonymousBlock() || !flow.isInlineElementContinuation();
-    if (shouldApplyStartBorderPaddingOrMargin &amp;&amp; (flow.borderStart() || flow.marginStart() || flow.paddingStart()))
-        return true;
-
-    bool shouldApplyEndBorderPaddingOrMargin = !flow.parent()-&gt;isAnonymousBlock() || flow.isInlineElementContinuation() || !flow.inlineElementContinuation();
-    return shouldApplyEndBorderPaddingOrMargin &amp;&amp; (flow.borderEnd() || flow.marginEnd() || flow.paddingEnd());
-}
-
-static bool alwaysRequiresLineBox(const RenderInline&amp; flow)
-{
-    // FIXME: Right now, we only allow line boxes for inlines that are truly empty.
-    // We need to fix this, though, because at the very least, inlines containing only
-    // ignorable whitespace should should also have line boxes.
-    return isEmptyInline(flow) &amp;&amp; hasInlineDirectionBordersPaddingOrMargin(flow);
-}
-
-static bool requiresLineBox(const InlineIterator&amp; it, const LineInfo&amp; lineInfo = LineInfo(), WhitespacePosition whitespacePosition = LeadingWhitespace)
-{
-    if (it.m_obj-&gt;isFloatingOrOutOfFlowPositioned())
-        return false;
-
-    if (it.m_obj-&gt;isBR())
-        return true;
-
-    bool rendererIsEmptyInline = false;
-    if (it.m_obj-&gt;isRenderInline()) {
-        const RenderInline&amp; inlineRenderer = toRenderInline(*it.m_obj);
-        if (!alwaysRequiresLineBox(inlineRenderer) &amp;&amp; !requiresLineBoxForContent(inlineRenderer, lineInfo))
-            return false;
-        rendererIsEmptyInline = isEmptyInline(inlineRenderer);
-    }
-
-    if (!shouldCollapseWhiteSpace(&amp;it.m_obj-&gt;style(), lineInfo, whitespacePosition))
-        return true;
-
-    UChar current = it.current();
-    bool notJustWhitespace = current != ' ' &amp;&amp; current != '\t' &amp;&amp; current != softHyphen &amp;&amp; (current != '\n' || it.m_obj-&gt;preservesNewline()) &amp;&amp; !skipNonBreakingSpace(it, lineInfo);
-    return notJustWhitespace || rendererIsEmptyInline;
-}
-
</del><span class="cx"> bool RenderBlock::generatesLineBoxesForInlineChild(RenderObject* inlineObj)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(inlineObj-&gt;parent() == this);
</span><span class="lines">@@ -2322,249 +2006,6 @@
</span><span class="cx">     return !it.atEnd();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// FIXME: The entire concept of the skipTrailingWhitespace function is flawed, since we really need to be building
-// line boxes even for containers that may ultimately collapse away. Otherwise we'll never get positioned
-// elements quite right. In other words, we need to build this function's work into the normal line
-// object iteration process.
-// NB. this function will insert any floating elements that would otherwise
-// be skipped but it will not position them.
-void LineBreaker::skipTrailingWhitespace(InlineIterator&amp; iterator, const LineInfo&amp; lineInfo)
-{
-    while (!iterator.atEnd() &amp;&amp; !requiresLineBox(iterator, lineInfo, TrailingWhitespace)) {
-        RenderObject&amp; object = *iterator.m_obj;
-        if (object.isOutOfFlowPositioned())
-            setStaticPositions(m_block, toRenderBox(object));
-        else if (object.isFloating())
-            m_block.insertFloatingObject(toRenderBox(object));
-        iterator.increment();
-    }
-}
-
-void LineBreaker::skipLeadingWhitespace(InlineBidiResolver&amp; resolver, LineInfo&amp; lineInfo, FloatingObject* lastFloatFromPreviousLine, LineWidth&amp; width)
-{
-    while (!resolver.position().atEnd() &amp;&amp; !requiresLineBox(resolver.position(), lineInfo, LeadingWhitespace)) {
-        RenderObject&amp; object = *resolver.position().m_obj;
-        if (object.isOutOfFlowPositioned()) {
-            setStaticPositions(m_block, toRenderBox(object));
-            if (object.style().isOriginalDisplayInlineType()) {
-                resolver.runs().addRun(createRun(0, 1, &amp;object, resolver));
-                lineInfo.incrementRunsFromLeadingWhitespace();
-            }
-        } else if (object.isFloating()) {
-            // The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
-            // so in order to place this first child float at the top content edge of the self-collapsing block add the margin back in before placement.
-            LayoutUnit marginOffset = (!object.previousSibling() &amp;&amp; m_block.isSelfCollapsingBlock() &amp;&amp; m_block.style().clear() &amp;&amp; m_block.getClearDelta(m_block, LayoutUnit())) ? m_block.collapsedMarginBeforeForChild(m_block) : LayoutUnit();
-            LayoutUnit oldLogicalHeight = m_block.logicalHeight();
-            m_block.setLogicalHeight(oldLogicalHeight + marginOffset);
-            m_block.positionNewFloatOnLine(m_block.insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width);
-            m_block.setLogicalHeight(oldLogicalHeight);
-        } else if (object.isText() &amp;&amp; object.style().hasTextCombine() &amp;&amp; object.isCombineText() &amp;&amp; !toRenderCombineText(object).isCombined()) {
-            toRenderCombineText(object).combineText();
-            if (toRenderCombineText(object).isCombined())
-                continue;
-        }
-        resolver.increment();
-    }
-    resolver.commitExplicitEmbedding();
-}
-
-// This is currently just used for list markers and inline flows that have line boxes. Neither should
-// have an effect on whitespace at the start of the line.
-static bool shouldSkipWhitespaceAfterStartObject(RenderBlockFlow&amp; block, RenderObject* o, LineMidpointState&amp; lineMidpointState)
-{
-    RenderObject* next = bidiNextSkippingEmptyInlines(block, o);
-    while (next &amp;&amp; next-&gt;isFloatingOrOutOfFlowPositioned())
-        next = bidiNextSkippingEmptyInlines(block, next);
-
-    if (next &amp;&amp; next-&gt;isText() &amp;&amp; toRenderText(next)-&gt;textLength() &gt; 0) {
-        RenderText* nextText = toRenderText(next);
-        UChar nextChar = nextText-&gt;characterAt(0);
-        if (nextText-&gt;style().isCollapsibleWhiteSpace(nextChar)) {
-            startIgnoringSpaces(lineMidpointState, InlineIterator(0, o, 0));
-            return true;
-        }
-    }
-
-    return false;
-}
-
-static ALWAYS_INLINE float textWidth(RenderText* text, unsigned from, unsigned len, const Font&amp; font, float xPos, bool isFixedPitch, bool collapseWhiteSpace, HashSet&lt;const SimpleFontData*&gt;&amp; fallbackFonts, TextLayout* layout = 0)
-{
-    const RenderStyle&amp; style = text-&gt;style();
-
-    GlyphOverflow glyphOverflow;
-    if (isFixedPitch || (!from &amp;&amp; len == text-&gt;textLength()) || style.hasTextCombine())
-        return text-&gt;width(from, len, font, xPos, &amp;fallbackFonts, &amp;glyphOverflow);
-
-    if (layout)
-        return Font::width(*layout, from, len, &amp;fallbackFonts);
-
-    TextRun run = RenderBlock::constructTextRun(text, font, text, from, len, style);
-    run.setCharactersLength(text-&gt;textLength() - from);
-    ASSERT(run.charactersLength() &gt;= run.length());
-
-    run.setCharacterScanForCodePath(!text-&gt;canUseSimpleFontCodePath());
-    run.setTabSize(!collapseWhiteSpace, style.tabSize());
-    run.setXPos(xPos);
-    return font.width(run, &amp;fallbackFonts, &amp;glyphOverflow);
-}
-
-static void tryHyphenating(RenderText* text, const Font&amp; font, const AtomicString&amp; localeIdentifier, unsigned consecutiveHyphenatedLines, int consecutiveHyphenatedLinesLimit, int minimumPrefixLimit, int minimumSuffixLimit, unsigned lastSpace, unsigned pos, float xPos, int availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator&amp; lineBreak, int nextBreakable, bool&amp; hyphenated)
-{
-    // Map 'hyphenate-limit-{before,after}: auto;' to 2.
-    unsigned minimumPrefixLength;
-    unsigned minimumSuffixLength;
-
-    if (minimumPrefixLimit &lt; 0)
-        minimumPrefixLength = 2;
-    else
-        minimumPrefixLength = static_cast&lt;unsigned&gt;(minimumPrefixLimit);
-
-    if (minimumSuffixLimit &lt; 0)
-        minimumSuffixLength = 2;
-    else
-        minimumSuffixLength = static_cast&lt;unsigned&gt;(minimumSuffixLimit);
-
-    if (pos - lastSpace &lt;= minimumSuffixLength)
-        return;
-
-    if (consecutiveHyphenatedLinesLimit &gt;= 0 &amp;&amp; consecutiveHyphenatedLines &gt;= static_cast&lt;unsigned&gt;(consecutiveHyphenatedLinesLimit))
-        return;
-
-    int hyphenWidth = measureHyphenWidth(text, font);
-
-    float maxPrefixWidth = availableWidth - xPos - hyphenWidth - lastSpaceWordSpacing;
-    // If the maximum width available for the prefix before the hyphen is small, then it is very unlikely
-    // that an hyphenation opportunity exists, so do not bother to look for it.
-    if (maxPrefixWidth &lt;= font.pixelSize() * 5 / 4)
-        return;
-
-    const RenderStyle&amp; style = text-&gt;style();
-    TextRun run = RenderBlock::constructTextRun(text, font, text, lastSpace, pos - lastSpace, style);
-    run.setCharactersLength(text-&gt;textLength() - lastSpace);
-    ASSERT(run.charactersLength() &gt;= run.length());
-
-    run.setTabSize(!collapseWhiteSpace, style.tabSize());
-    run.setXPos(xPos + lastSpaceWordSpacing);
-
-    unsigned prefixLength = font.offsetForPosition(run, maxPrefixWidth, false);
-    if (prefixLength &lt; minimumPrefixLength)
-        return;
-
-    prefixLength = lastHyphenLocation(text-&gt;characters() + lastSpace, pos - lastSpace, std::min(prefixLength, pos - lastSpace - minimumSuffixLength) + 1, localeIdentifier);
-    if (!prefixLength || prefixLength &lt; minimumPrefixLength)
-        return;
-
-    // When lastSapce is a space, which it always is except sometimes at the beginning of a line or after collapsed
-    // space, it should not count towards hyphenate-limit-before.
-    if (prefixLength == minimumPrefixLength) {
-        UChar characterAtLastSpace = text-&gt;characterAt(lastSpace);
-        if (characterAtLastSpace == ' ' || characterAtLastSpace == '\n' || characterAtLastSpace == '\t' || characterAtLastSpace == noBreakSpace)
-            return;
-    }
-
-    ASSERT(pos - lastSpace - prefixLength &gt;= minimumSuffixLength);
-
-#if !ASSERT_DISABLED
-    HashSet&lt;const SimpleFontData*&gt; fallbackFonts;
-    float prefixWidth = hyphenWidth + textWidth(text, lastSpace, prefixLength, font, xPos, isFixedPitch, collapseWhiteSpace, fallbackFonts) + lastSpaceWordSpacing;
-    ASSERT(xPos + prefixWidth &lt;= availableWidth);
-#else
-    UNUSED_PARAM(isFixedPitch);
-#endif
-
-    lineBreak.moveTo(text, lastSpace + prefixLength, nextBreakable);
-    hyphenated = true;
-}
-
-class TrailingObjects {
-public:
-    TrailingObjects();
-    void setTrailingWhitespace(RenderText*);
-    void clear();
-    void appendBoxIfNeeded(RenderBoxModelObject*);
-
-    enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace };
-
-    void updateMidpointsForTrailingBoxes(LineMidpointState&amp;, const InlineIterator&amp; lBreak, CollapseFirstSpaceOrNot);
-
-private:
-    RenderText* m_whitespace;
-    Vector&lt;RenderBoxModelObject*, 4&gt; m_boxes;
-};
-
-TrailingObjects::TrailingObjects()
-    : m_whitespace(0)
-{
-}
-
-inline void TrailingObjects::setTrailingWhitespace(RenderText* whitespace)
-{
-    ASSERT(whitespace);
-    m_whitespace = whitespace;
-}
-
-inline void TrailingObjects::clear()
-{
-    m_whitespace = 0;
-    m_boxes.shrink(0); // Use shrink(0) instead of clear() to retain our capacity.
-}
-
-inline void TrailingObjects::appendBoxIfNeeded(RenderBoxModelObject* box)
-{
-    if (m_whitespace)
-        m_boxes.append(box);
-}
-
-void TrailingObjects::updateMidpointsForTrailingBoxes(LineMidpointState&amp; lineMidpointState, const InlineIterator&amp; lBreak, CollapseFirstSpaceOrNot collapseFirstSpace)
-{
-    if (!m_whitespace)
-        return;
-
-    // This object is either going to be part of the last midpoint, or it is going to be the actual endpoint.
-    // In both cases we just decrease our pos by 1 level to exclude the space, allowing it to - in effect - collapse into the newline.
-    if (lineMidpointState.numMidpoints % 2) {
-        // Find the trailing space object's midpoint.
-        int trailingSpaceMidpoint = lineMidpointState.numMidpoints - 1;
-        for ( ; trailingSpaceMidpoint &gt; 0 &amp;&amp; lineMidpointState.midpoints[trailingSpaceMidpoint].m_obj != m_whitespace; --trailingSpaceMidpoint) { }
-        ASSERT(trailingSpaceMidpoint &gt;= 0);
-        if (collapseFirstSpace == CollapseFirstSpace)
-            lineMidpointState.midpoints[trailingSpaceMidpoint].m_pos--;
-
-        // Now make sure every single trailingPositionedBox following the trailingSpaceMidpoint properly stops and starts
-        // ignoring spaces.
-        size_t currentMidpoint = trailingSpaceMidpoint + 1;
-        for (size_t i = 0; i &lt; m_boxes.size(); ++i) {
-            if (currentMidpoint &gt;= lineMidpointState.numMidpoints) {
-                // We don't have a midpoint for this box yet.
-                ensureLineBoxInsideIgnoredSpaces(lineMidpointState, m_boxes[i]);
-            } else {
-                ASSERT(lineMidpointState.midpoints[currentMidpoint].m_obj == m_boxes[i]);
-                ASSERT(lineMidpointState.midpoints[currentMidpoint + 1].m_obj == m_boxes[i]);
-            }
-            currentMidpoint += 2;
-        }
-    } else if (!lBreak.m_obj) {
-        ASSERT(m_whitespace-&gt;isText());
-        ASSERT(collapseFirstSpace == CollapseFirstSpace);
-        // Add a new end midpoint that stops right at the very end.
-        unsigned length = m_whitespace-&gt;textLength();
-        unsigned pos = length &gt;= 2 ? length - 2 : UINT_MAX;
-        InlineIterator endMid(0, m_whitespace, pos);
-        startIgnoringSpaces(lineMidpointState, endMid);
-        for (size_t i = 0; i &lt; m_boxes.size(); ++i) {
-            ensureLineBoxInsideIgnoredSpaces(lineMidpointState, m_boxes[i]);
-        }
-    }
-}
-
-void LineBreaker::reset()
-{
-    m_positionedObjects.clear();
-    m_hyphenated = false;
-    m_clear = CNONE;
-}
-
</del><span class="cx"> InlineIterator LineBreaker::nextLineBreak(InlineBidiResolver&amp; resolver, LineInfo&amp; lineInfo, RenderTextInfo&amp; renderTextInfo, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&amp; wordMeasurements)
</span><span class="cx"> {
</span><span class="cx"> #if !ENABLE(CSS_SHAPES)
</span><span class="lines">@@ -2619,863 +2060,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool iteratorIsBeyondEndOfRenderCombineText(const InlineIterator&amp; iter, RenderCombineText&amp; renderer)
-{
-    return iter.m_obj == &amp;renderer &amp;&amp; iter.m_pos &gt;= renderer.textLength();
-}
-
-#if ENABLE(CSS_SHAPES)
-static void updateSegmentsForShapes(RenderBlockFlow&amp; block, const FloatingObject* lastFloatFromPreviousLine, const WordMeasurements&amp; wordMeasurements, LineWidth&amp; width, bool isFirstLine)
-{
-    ASSERT(lastFloatFromPreviousLine);
-
-    ShapeInsideInfo* shapeInsideInfo = block.layoutShapeInsideInfo();
-    if (!lastFloatFromPreviousLine-&gt;isPlaced() || !shapeInsideInfo)
-        return;
-
-    bool isHorizontalWritingMode = block.isHorizontalWritingMode();
-    LayoutUnit logicalOffsetFromShapeContainer = block.logicalOffsetFromShapeAncestorContainer(shapeInsideInfo-&gt;owner()).height();
-
-    LayoutUnit lineLogicalTop = block.logicalHeight() + logicalOffsetFromShapeContainer;
-    LayoutUnit lineLogicalHeight = block.lineHeight(isFirstLine, isHorizontalWritingMode ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
-    LayoutUnit lineLogicalBottom = lineLogicalTop + lineLogicalHeight;
-
-    LayoutUnit floatLogicalTop = block.logicalTopForFloat(lastFloatFromPreviousLine);
-    LayoutUnit floatLogicalBottom = block.logicalBottomForFloat(lastFloatFromPreviousLine);
-
-    bool lineOverlapsWithFloat = (floatLogicalTop &lt; lineLogicalBottom) &amp;&amp; (lineLogicalTop &lt; floatLogicalBottom);
-    if (!lineOverlapsWithFloat)
-        return;
-
-    float minSegmentWidth = firstPositiveWidth(wordMeasurements);
-
-    LayoutUnit floatLogicalWidth = block.logicalWidthForFloat(lastFloatFromPreviousLine);
-    LayoutUnit availableLogicalWidth = block.logicalWidth() - block.logicalRightForFloat(lastFloatFromPreviousLine);
-    if (availableLogicalWidth &lt; minSegmentWidth)
-        block.setLogicalHeight(floatLogicalBottom);
-
-    if (block.logicalHeight() &lt; floatLogicalTop) {
-        shapeInsideInfo-&gt;adjustLogicalLineTop(minSegmentWidth + floatLogicalWidth);
-        block.setLogicalHeight(shapeInsideInfo-&gt;logicalLineTop() - logicalOffsetFromShapeContainer);
-    }
-
-    lineLogicalTop = block.logicalHeight() + logicalOffsetFromShapeContainer;
-
-    shapeInsideInfo-&gt;updateSegmentsForLine(lineLogicalTop, lineLogicalHeight);
-    width.updateCurrentShapeSegment();
-    width.updateAvailableWidth();
-}
-#endif
-
-class BreakingContext {
-public:
-    BreakingContext(LineBreaker&amp; lineBreaker, InlineBidiResolver&amp; resolver, LineInfo&amp; inLineInfo, LineWidth&amp; lineWidth, RenderTextInfo&amp; inRenderTextInfo, FloatingObject* inLastFloatFromPreviousLine, bool appliedStartWidth, RenderBlockFlow&amp; block)
-        : m_lineBreaker(lineBreaker)
-        , m_resolver(resolver)
-        , m_current(resolver.position())
-        , m_lineBreak(resolver.position())
-        , m_block(block)
-        , m_lastObject(m_current.m_obj)
-        , m_nextObject(0)
-        , m_currentStyle(0)
-        , m_blockStyle(block.style())
-        , m_lineInfo(inLineInfo)
-        , m_renderTextInfo(inRenderTextInfo)
-        , m_lastFloatFromPreviousLine(inLastFloatFromPreviousLine)
-        , m_width(lineWidth)
-        , m_currWS(NORMAL)
-        , m_lastWS(NORMAL)
-        , m_preservesNewline(false)
-        , m_atStart(true)
-        , m_ignoringSpaces(false)
-        , m_currentCharacterIsSpace(false)
-        , m_currentCharacterIsWS(false)
-        , m_appliedStartWidth(appliedStartWidth)
-        , m_includeEndWidth(true)
-        , m_autoWrap(false)
-        , m_autoWrapWasEverTrueOnLine(false)
-        , m_floatsFitOnLine(true)
-        , m_collapseWhiteSpace(false)
-        , m_startingNewParagraph(m_lineInfo.previousLineBrokeCleanly())
-        , m_allowImagesToBreak(!block.document().inQuirksMode() || !block.isTableCell() || !m_blockStyle.logicalWidth().isIntrinsicOrAuto())
-        , m_atEnd(false)
-        , m_hadUncommittedWidthBeforeCurrent(false)
-        , m_lineMidpointState(resolver.midpointState())
-    {
-        m_lineInfo.setPreviousLineBrokeCleanly(false);
-    }
-
-    RenderObject* currentObject() { return m_current.m_obj; }
-    InlineIterator lineBreak() { return m_lineBreak; }
-    InlineIterator&amp; lineBreakRef() {return m_lineBreak; }
-    LineWidth&amp; lineWidth() { return m_width; }
-    bool atEnd() { return m_atEnd; }
-
-    void initializeForCurrentObject();
-
-    void increment();
-
-    void handleBR(EClear&amp;);
-    void handleOutOfFlowPositioned(Vector&lt;RenderBox*&gt;&amp; positionedObjects);
-    void handleFloat();
-    void handleEmptyInline();
-    void handleReplaced();
-    bool handleText(WordMeasurements&amp;, bool&amp; hyphenated, unsigned&amp; consecutiveHyphenatedLines);
-    bool canBreakAtThisPosition();
-    void commitAndUpdateLineBreakIfNeeded();
-    InlineIterator handleEndOfLine();
-
-    void clearLineBreakIfFitsOnLine(bool ignoringTrailingSpace = false)
-    {
-        if (m_width.fitsOnLine(ignoringTrailingSpace) || m_lastWS == NOWRAP)
-            m_lineBreak.clear();
-    }
-
-    void commitLineBreakAtCurrentWidth(RenderObject* object, unsigned offset = 0, int nextBreak = -1)
-    {
-        m_width.commit();
-        m_lineBreak.moveTo(object, offset, nextBreak);
-    }
-
-private:
-    LineBreaker&amp; m_lineBreaker;
-    InlineBidiResolver&amp; m_resolver;
-
-    InlineIterator m_current;
-    InlineIterator m_lineBreak;
-    InlineIterator m_startOfIgnoredSpaces;
-
-    RenderBlockFlow&amp; m_block;
-    RenderObject* m_lastObject;
-    RenderObject* m_nextObject;
-
-    RenderStyle* m_currentStyle;
-
-    // Firefox and Opera will allow a table cell to grow to fit an image inside it under
-    // very specific circumstances (in order to match common WinIE renderings).
-    // Not supporting the quirk has caused us to mis-render some real sites. (See Bugzilla 10517.)
-    RenderStyle&amp; m_blockStyle;
-
-    LineInfo&amp; m_lineInfo;
-
-    RenderTextInfo&amp; m_renderTextInfo;
-
-    FloatingObject* m_lastFloatFromPreviousLine;
-
-    LineWidth m_width;
-
-    EWhiteSpace m_currWS;
-    EWhiteSpace m_lastWS;
-
-    bool m_preservesNewline;
-    bool m_atStart;
-
-    // This variable is used only if whitespace isn't set to PRE, and it tells us whether
-    // or not we are currently ignoring whitespace.
-    bool m_ignoringSpaces;
-
-    // This variable tracks whether the very last character we saw was a space.  We use
-    // this to detect when we encounter a second space so we know we have to terminate
-    // a run.
-    bool m_currentCharacterIsSpace;
-    bool m_currentCharacterIsWS;
-    bool m_appliedStartWidth;
-    bool m_includeEndWidth;
-    bool m_autoWrap;
-    bool m_autoWrapWasEverTrueOnLine;
-    bool m_floatsFitOnLine;
-    bool m_collapseWhiteSpace;
-    bool m_startingNewParagraph;
-    bool m_allowImagesToBreak;
-    bool m_atEnd;
-    bool m_hadUncommittedWidthBeforeCurrent;
-
-    LineMidpointState&amp; m_lineMidpointState;
-
-    TrailingObjects m_trailingObjects;
-};
-
-inline void BreakingContext::initializeForCurrentObject()
-{
-    m_hadUncommittedWidthBeforeCurrent = !!m_width.uncommittedWidth();
-
-    m_currentStyle = &amp;m_current.m_obj-&gt;style();
-
-    ASSERT(m_currentStyle);
-
-    m_nextObject = bidiNextSkippingEmptyInlines(m_block, m_current.m_obj);
-    if (m_nextObject &amp;&amp; m_nextObject-&gt;parent() &amp;&amp; !m_nextObject-&gt;parent()-&gt;isDescendantOf(m_current.m_obj-&gt;parent()))
-        m_includeEndWidth = true;
-
-    m_currWS = m_current.m_obj-&gt;isReplaced() ? m_current.m_obj-&gt;parent()-&gt;style().whiteSpace() : m_currentStyle-&gt;whiteSpace();
-    m_lastWS = m_lastObject-&gt;isReplaced() ? m_lastObject-&gt;parent()-&gt;style().whiteSpace() : m_lastObject-&gt;style().whiteSpace();
-
-    m_autoWrap = RenderStyle::autoWrap(m_currWS);
-    m_autoWrapWasEverTrueOnLine = m_autoWrapWasEverTrueOnLine || m_autoWrap;
-
-#if ENABLE(SVG)
-    m_preservesNewline = m_current.m_obj-&gt;isSVGInlineText() ? false : RenderStyle::preserveNewline(m_currWS);
-#else
-    m_preservesNewline = RenderStyle::preserveNewline(m_currWS);
-#endif
-
-    m_collapseWhiteSpace = RenderStyle::collapseWhiteSpace(m_currWS);
-}
-
-inline void BreakingContext::increment()
-{
-    // Clear out our character space bool, since inline &lt;pre&gt;s don't collapse whitespace
-    // with adjacent inline normal/nowrap spans.
-    if (!m_collapseWhiteSpace)
-        m_currentCharacterIsSpace = false;
-
-    m_current.moveToStartOf(m_nextObject);
-    m_atStart = false;
-}
-
-inline void BreakingContext::handleBR(EClear&amp; clear)
-{
-    if (m_width.fitsOnLine()) {
-        RenderObject* br = m_current.m_obj;
-        m_lineBreak.moveToStartOf(br);
-        m_lineBreak.increment();
-
-        // A &lt;br&gt; always breaks a line, so don't let the line be collapsed
-        // away. Also, the space at the end of a line with a &lt;br&gt; does not
-        // get collapsed away. It only does this if the previous line broke
-        // cleanly. Otherwise the &lt;br&gt; has no effect on whether the line is
-        // empty or not.
-        if (m_startingNewParagraph)
-            m_lineInfo.setEmpty(false, &amp;m_block, &amp;m_width);
-        m_trailingObjects.clear();
-        m_lineInfo.setPreviousLineBrokeCleanly(true);
-
-        // A &lt;br&gt; with clearance always needs a linebox in case the lines below it get dirtied later and
-        // need to check for floats to clear - so if we're ignoring spaces, stop ignoring them and add a
-        // run for this object.
-        if (m_ignoringSpaces &amp;&amp; m_currentStyle-&gt;clear() != CNONE)
-            ensureLineBoxInsideIgnoredSpaces(m_lineMidpointState, br);
-        // If we were preceded by collapsing space and are in a right-aligned container we need to ensure the space gets
-        // collapsed away so that it doesn't push the text out from the container's right-hand edge.
-        // FIXME: Do this regardless of the container's alignment - will require rebaselining a lot of test results.
-        else if (m_ignoringSpaces &amp;&amp; (m_blockStyle.textAlign() == RIGHT || m_blockStyle.textAlign() == WEBKIT_RIGHT))
-            stopIgnoringSpaces(m_lineMidpointState, InlineIterator(0, m_current.m_obj, m_current.m_pos));
-
-        if (!m_lineInfo.isEmpty())
-            clear = m_currentStyle-&gt;clear();
-    }
-    m_atEnd = true;
-}
-
-inline void BreakingContext::handleOutOfFlowPositioned(Vector&lt;RenderBox*&gt;&amp; positionedObjects)
-{
-    // If our original display wasn't an inline type, then we can
-    // go ahead and determine our static inline position now.
-    RenderBox* box = toRenderBox(m_current.m_obj);
-    bool isInlineType = box-&gt;style().isOriginalDisplayInlineType();
-    if (!isInlineType)
-        m_block.setStaticInlinePositionForChild(*box, m_block.logicalHeight(), m_block.startOffsetForContent(m_block.logicalHeight()));
-    else {
-        // If our original display was an INLINE type, then we can go ahead
-        // and determine our static y position now.
-        box-&gt;layer()-&gt;setStaticBlockPosition(m_block.logicalHeight());
-    }
-
-    // If we're ignoring spaces, we have to stop and include this object and
-    // then start ignoring spaces again.
-    if (isInlineType || box-&gt;container()-&gt;isRenderInline()) {
-        if (m_ignoringSpaces)
-            ensureLineBoxInsideIgnoredSpaces(m_lineMidpointState, box);
-        m_trailingObjects.appendBoxIfNeeded(box);
-    } else
-        positionedObjects.append(box);
-
-    m_width.addUncommittedWidth(inlineLogicalWidth(box));
-    // Reset prior line break context characters.
-    m_renderTextInfo.m_lineBreakIterator.resetPriorContext();
-}
-
-inline void BreakingContext::handleFloat()
-{
-    RenderBox&amp; floatBox = toRenderBox(*m_current.m_obj);
-    FloatingObject* floatingObject = m_block.insertFloatingObject(floatBox);
-    // check if it fits in the current line.
-    // If it does, position it now, otherwise, position
-    // it after moving to next line (in newLine() func)
-    // FIXME: Bug 110372: Properly position multiple stacked floats with non-rectangular shape outside.
-    if (m_floatsFitOnLine &amp;&amp; m_width.fitsOnLineExcludingTrailingWhitespace(m_block.logicalWidthForFloat(floatingObject))) {
-        m_block.positionNewFloatOnLine(floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width);
-        if (m_lineBreak.m_obj == m_current.m_obj) {
-            ASSERT(!m_lineBreak.m_pos);
-            m_lineBreak.increment();
-        }
-    } else
-        m_floatsFitOnLine = false;
-    // Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for floating element.
-    m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
-}
-
-inline void BreakingContext::handleEmptyInline()
-{
-    RenderInline&amp; flowBox = toRenderInline(*m_current.m_obj);
-
-    // This should only end up being called on empty inlines
-    ASSERT(isEmptyInline(flowBox));
-
-    // Now that some inline flows have line boxes, if we are already ignoring spaces, we need
-    // to make sure that we stop to include this object and then start ignoring spaces again.
-    // If this object is at the start of the line, we need to behave like list markers and
-    // start ignoring spaces.
-    bool requiresLineBox = alwaysRequiresLineBox(flowBox);
-    if (requiresLineBox || requiresLineBoxForContent(flowBox, m_lineInfo)) {
-        // An empty inline that only has line-height, vertical-align or font-metrics will only get a
-        // line box to affect the height of the line if the rest of the line is not empty.
-        if (requiresLineBox)
-            m_lineInfo.setEmpty(false, &amp;m_block, &amp;m_width);
-        if (m_ignoringSpaces) {
-            m_trailingObjects.clear();
-            ensureLineBoxInsideIgnoredSpaces(m_lineMidpointState, m_current.m_obj);
-        } else if (m_blockStyle.collapseWhiteSpace() &amp;&amp; m_resolver.position().m_obj == m_current.m_obj
-            &amp;&amp; shouldSkipWhitespaceAfterStartObject(m_block, m_current.m_obj, m_lineMidpointState)) {
-            // Like with list markers, we start ignoring spaces to make sure that any
-            // additional spaces we see will be discarded.
-            m_currentCharacterIsSpace = true;
-            m_currentCharacterIsWS = true;
-            m_ignoringSpaces = true;
-        } else
-            m_trailingObjects.appendBoxIfNeeded(&amp;flowBox);
-    }
-
-    m_width.addUncommittedWidth(inlineLogicalWidth(m_current.m_obj) + borderPaddingMarginStart(flowBox) + borderPaddingMarginEnd(flowBox));
-}
-
-inline void BreakingContext::handleReplaced()
-{
-    RenderBox&amp; replacedBox = toRenderBox(*m_current.m_obj);
-
-    if (m_atStart)
-        m_width.updateAvailableWidth(replacedBox.logicalHeight());
-
-    // Break on replaced elements if either has normal white-space.
-    if ((m_autoWrap || RenderStyle::autoWrap(m_lastWS)) &amp;&amp; (!m_current.m_obj-&gt;isImage() || m_allowImagesToBreak)) {
-        m_width.commit();
-        m_lineBreak.moveToStartOf(m_current.m_obj);
-    }
-
-    if (m_ignoringSpaces)
-        stopIgnoringSpaces(m_lineMidpointState, InlineIterator(0, m_current.m_obj, 0));
-
-    m_lineInfo.setEmpty(false, &amp;m_block, &amp;m_width);
-    m_ignoringSpaces = false;
-    m_currentCharacterIsSpace = false;
-    m_currentCharacterIsWS = false;
-    m_trailingObjects.clear();
-
-    // Optimize for a common case. If we can't find whitespace after the list
-    // item, then this is all moot.
-    LayoutUnit replacedLogicalWidth = m_block.logicalWidthForChild(replacedBox) + m_block.marginStartForChild(replacedBox) + m_block.marginEndForChild(replacedBox) + inlineLogicalWidth(m_current.m_obj);
-    if (m_current.m_obj-&gt;isListMarker()) {
-        if (m_blockStyle.collapseWhiteSpace() &amp;&amp; shouldSkipWhitespaceAfterStartObject(m_block, m_current.m_obj, m_lineMidpointState)) {
-            // Like with inline flows, we start ignoring spaces to make sure that any
-            // additional spaces we see will be discarded.
-            m_currentCharacterIsSpace = true;
-            m_currentCharacterIsWS = false;
-            m_ignoringSpaces = true;
-        }
-        if (toRenderListMarker(*m_current.m_obj).isInside())
-            m_width.addUncommittedWidth(replacedLogicalWidth);
-    } else
-        m_width.addUncommittedWidth(replacedLogicalWidth);
-    if (m_current.m_obj-&gt;isRubyRun())
-        m_width.applyOverhang(toRenderRubyRun(m_current.m_obj), m_lastObject, m_nextObject);
-    // Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for replaced element.
-    m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
-}
-
-
-static inline void nextCharacter(UChar&amp; currentCharacter, UChar&amp; lastCharacter, UChar&amp; secondToLastCharacter)
-{
-    secondToLastCharacter = lastCharacter;
-    lastCharacter = currentCharacter;
-}
-
-inline bool BreakingContext::handleText(WordMeasurements&amp; wordMeasurements, bool&amp; hyphenated,  unsigned&amp; consecutiveHyphenatedLines)
-{
-    if (!m_current.m_pos)
-        m_appliedStartWidth = false;
-
-    RenderText* renderText = toRenderText(m_current.m_obj);
-
-#if ENABLE(SVG)
-    bool isSVGText = renderText-&gt;isSVGInlineText();
-#endif
-
-    // If we have left a no-wrap inline and entered an autowrap inline while ignoring spaces
-    // then we need to mark the start of the autowrap inline as a potential linebreak now.
-    if (m_autoWrap &amp;&amp; !RenderStyle::autoWrap(m_lastWS) &amp;&amp; m_ignoringSpaces)
-        commitLineBreakAtCurrentWidth(m_current.m_obj);
-
-    if (renderText-&gt;style().hasTextCombine() &amp;&amp; m_current.m_obj-&gt;isCombineText() &amp;&amp; !toRenderCombineText(*m_current.m_obj).isCombined()) {
-        RenderCombineText&amp; combineRenderer = toRenderCombineText(*m_current.m_obj);
-        combineRenderer.combineText();
-        // The length of the renderer's text may have changed. Increment stale iterator positions
-        if (iteratorIsBeyondEndOfRenderCombineText(m_lineBreak, combineRenderer)) {
-            ASSERT(iteratorIsBeyondEndOfRenderCombineText(m_resolver.position(), combineRenderer));
-            m_lineBreak.increment();
-            m_resolver.increment();
-        }
-    }
-
-    const RenderStyle&amp; style = lineStyle(*renderText-&gt;parent(), m_lineInfo);
-    const Font&amp; font = style.font();
-    bool isFixedPitch = font.isFixedPitch();
-    bool canHyphenate = style.hyphens() == HyphensAuto &amp;&amp; WebCore::canHyphenate(style.locale());
-
-    unsigned lastSpace = m_current.m_pos;
-    float wordSpacing = m_currentStyle-&gt;wordSpacing();
-    float lastSpaceWordSpacing = 0;
-    float wordSpacingForWordMeasurement = 0;
-
-    float wrapW = m_width.uncommittedWidth() + inlineLogicalWidth(m_current.m_obj, !m_appliedStartWidth, true);
-    float charWidth = 0;
-    bool breakNBSP = m_autoWrap &amp;&amp; m_currentStyle-&gt;nbspMode() == SPACE;
-    // Auto-wrapping text should wrap in the middle of a word only if it could not wrap before the word,
-    // which is only possible if the word is the first thing on the line, that is, if |w| is zero.
-    bool breakWords = m_currentStyle-&gt;breakWords() &amp;&amp; ((m_autoWrap &amp;&amp; !m_width.committedWidth()) || m_currWS == PRE);
-    bool midWordBreak = false;
-    bool breakAll = m_currentStyle-&gt;wordBreak() == BreakAllWordBreak &amp;&amp; m_autoWrap;
-    float hyphenWidth = 0;
-#if ENABLE(SVG)
-    if (isSVGText) {
-        breakWords = false;
-        breakAll = false;
-    }
-#endif
-
-    if (m_renderTextInfo.m_text != renderText) {
-        updateCounterIfNeeded(*renderText);
-        m_renderTextInfo.m_text = renderText;
-        m_renderTextInfo.m_font = &amp;font;
-        m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
-        m_renderTextInfo.m_lineBreakIterator.resetStringAndReleaseIterator(renderText-&gt;text(), style.locale());
-    } else if (m_renderTextInfo.m_layout &amp;&amp; m_renderTextInfo.m_font != &amp;font) {
-        m_renderTextInfo.m_font = &amp;font;
-        m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
-    }
-
-    TextLayout* textLayout = m_renderTextInfo.m_layout.get();
-
-    // Non-zero only when kerning is enabled and TextLayout isn't used, in which case we measure
-    // words with their trailing space, then subtract its width.
-    HashSet&lt;const SimpleFontData*&gt; fallbackFonts;
-    float wordTrailingSpaceWidth = (font.typesettingFeatures() &amp; Kerning) &amp;&amp; !textLayout ? font.width(RenderBlock::constructTextRun(renderText, font, &amp;space, 1, style), &amp;fallbackFonts) + wordSpacing : 0;
-
-    UChar lastCharacter = m_renderTextInfo.m_lineBreakIterator.lastCharacter();
-    UChar secondToLastCharacter = m_renderTextInfo.m_lineBreakIterator.secondToLastCharacter();
-    for (; m_current.m_pos &lt; renderText-&gt;textLength(); m_current.fastIncrementInTextNode()) {
-        bool previousCharacterIsSpace = m_currentCharacterIsSpace;
-        bool previousCharacterIsWS = m_currentCharacterIsWS;
-        UChar c = m_current.current();
-        m_currentCharacterIsSpace = c == ' ' || c == '\t' || (!m_preservesNewline &amp;&amp; (c == '\n'));
-
-        if (!m_collapseWhiteSpace || !m_currentCharacterIsSpace)
-            m_lineInfo.setEmpty(false, &amp;m_block, &amp;m_width);
-
-        if (c == softHyphen &amp;&amp; m_autoWrap &amp;&amp; !hyphenWidth &amp;&amp; style.hyphens() != HyphensNone) {
-            hyphenWidth = measureHyphenWidth(renderText, font, &amp;fallbackFonts);
-            m_width.addUncommittedWidth(hyphenWidth);
-        }
-
-        bool applyWordSpacing = false;
-
-        m_currentCharacterIsWS = m_currentCharacterIsSpace || (breakNBSP &amp;&amp; c == noBreakSpace);
-
-        if ((breakAll || breakWords) &amp;&amp; !midWordBreak &amp;&amp; (!m_currentCharacterIsSpace || style.whiteSpace() != PRE_WRAP)) {
-            wrapW += charWidth;
-            bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) &amp;&amp; m_current.m_pos + 1 &lt; renderText-&gt;textLength() &amp;&amp; U16_IS_TRAIL((*renderText)[m_current.m_pos + 1]);
-            charWidth = textWidth(renderText, m_current.m_pos, midWordBreakIsBeforeSurrogatePair ? 2 : 1, font, m_width.committedWidth() + wrapW, isFixedPitch, m_collapseWhiteSpace, fallbackFonts, textLayout);
-            midWordBreak = m_width.committedWidth() + wrapW + charWidth &gt; m_width.availableWidth();
-        }
-
-        bool betweenWords = c == '\n' || (m_currWS != PRE &amp;&amp; !m_atStart &amp;&amp; isBreakable(m_renderTextInfo.m_lineBreakIterator, m_current.m_pos, m_current.m_nextBreakablePosition, breakNBSP)
-            &amp;&amp; (style.hyphens() != HyphensNone || (m_current.previousInSameNode() != softHyphen)));
-
-        if (betweenWords || midWordBreak) {
-            bool stoppedIgnoringSpaces = false;
-            if (m_ignoringSpaces) {
-                lastSpaceWordSpacing = 0;
-                if (!m_currentCharacterIsSpace) {
-                    // Stop ignoring spaces and begin at this
-                    // new point.
-                    m_ignoringSpaces = false;
-                    wordSpacingForWordMeasurement = 0;
-                    lastSpace = m_current.m_pos; // e.g., &quot;Foo    goo&quot;, don't add in any of the ignored spaces.
-                    stopIgnoringSpaces(m_lineMidpointState, InlineIterator(0, m_current.m_obj, m_current.m_pos));
-                    stoppedIgnoringSpaces = true;
-                } else {
-                    // Just keep ignoring these spaces.
-                    nextCharacter(c, lastCharacter, secondToLastCharacter);
-                    continue;
-                }
-            }
-
-            wordMeasurements.grow(wordMeasurements.size() + 1);
-            WordMeasurement&amp; wordMeasurement = wordMeasurements.last();
-
-            wordMeasurement.renderer = renderText;
-            wordMeasurement.endOffset = m_current.m_pos;
-            wordMeasurement.startOffset = lastSpace;
-
-            float additionalTempWidth;
-            if (wordTrailingSpaceWidth &amp;&amp; c == ' ')
-                additionalTempWidth = textWidth(renderText, lastSpace, m_current.m_pos + 1 - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout) - wordTrailingSpaceWidth;
-            else
-                additionalTempWidth = textWidth(renderText, lastSpace, m_current.m_pos - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout);
-
-            if (wordMeasurement.fallbackFonts.isEmpty() &amp;&amp; !fallbackFonts.isEmpty())
-                wordMeasurement.fallbackFonts.swap(fallbackFonts);
-            fallbackFonts.clear();
-
-            wordMeasurement.width = additionalTempWidth + wordSpacingForWordMeasurement;
-            additionalTempWidth += lastSpaceWordSpacing;
-            m_width.addUncommittedWidth(additionalTempWidth);
-
-            if (m_collapseWhiteSpace &amp;&amp; previousCharacterIsSpace &amp;&amp; m_currentCharacterIsSpace &amp;&amp; additionalTempWidth)
-                m_width.setTrailingWhitespaceWidth(additionalTempWidth);
-
-            if (!m_appliedStartWidth) {
-                m_width.addUncommittedWidth(inlineLogicalWidth(m_current.m_obj, true, false));
-                m_appliedStartWidth = true;
-            }
-
-#if ENABLE(CSS_SHAPES)
-            if (m_lastFloatFromPreviousLine)
-                updateSegmentsForShapes(m_block, m_lastFloatFromPreviousLine, wordMeasurements, m_width, m_lineInfo.isFirstLine());
-#endif
-            applyWordSpacing = wordSpacing &amp;&amp; m_currentCharacterIsSpace;
-
-            if (!m_width.committedWidth() &amp;&amp; m_autoWrap &amp;&amp; !m_width.fitsOnLine())
-                m_width.fitBelowFloats();
-
-            if (m_autoWrap || breakWords) {
-                // If we break only after white-space, consider the current character
-                // as candidate width for this line.
-                bool lineWasTooWide = false;
-                if (m_width.fitsOnLine() &amp;&amp; m_currentCharacterIsSpace &amp;&amp; m_currentStyle-&gt;breakOnlyAfterWhiteSpace() &amp;&amp; !midWordBreak) {
-                    float charWidth = textWidth(renderText, m_current.m_pos, 1, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout) + (applyWordSpacing ? wordSpacing : 0);
-                    // Check if line is too big even without the extra space
-                    // at the end of the line. If it is not, do nothing.
-                    // If the line needs the extra whitespace to be too long,
-                    // then move the line break to the space and skip all
-                    // additional whitespace.
-                    if (!m_width.fitsOnLineIncludingExtraWidth(charWidth)) {
-                        lineWasTooWide = true;
-                        m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
-                        m_lineBreaker.skipTrailingWhitespace(m_lineBreak, m_lineInfo);
-                    }
-                }
-                if (lineWasTooWide || !m_width.fitsOnLine()) {
-                    if (canHyphenate &amp;&amp; !m_width.fitsOnLine()) {
-                        tryHyphenating(renderText, font, style.locale(), consecutiveHyphenatedLines, m_blockStyle.hyphenationLimitLines(), style.hyphenationLimitBefore(), style.hyphenationLimitAfter(), lastSpace, m_current.m_pos, m_width.currentWidth() - additionalTempWidth, m_width.availableWidth(), isFixedPitch, m_collapseWhiteSpace, lastSpaceWordSpacing, m_lineBreak, m_current.m_nextBreakablePosition, m_lineBreaker.m_hyphenated);
-                        if (m_lineBreaker.m_hyphenated) {
-                            m_atEnd = true;
-                            return false;
-                        }
-                    }
-                    if (m_lineBreak.atTextParagraphSeparator()) {
-                        if (!stoppedIgnoringSpaces &amp;&amp; m_current.m_pos &gt; 0)
-                            ensureCharacterGetsLineBox(m_lineMidpointState, m_current);
-                        m_lineBreak.increment();
-                        m_lineInfo.setPreviousLineBrokeCleanly(true);
-                        wordMeasurement.endOffset = m_lineBreak.m_pos;
-                    }
-                    if (m_lineBreak.m_obj &amp;&amp; m_lineBreak.m_pos &amp;&amp; m_lineBreak.m_obj-&gt;isText() &amp;&amp; toRenderText(m_lineBreak.m_obj)-&gt;textLength() &amp;&amp; toRenderText(m_lineBreak.m_obj)-&gt;characterAt(m_lineBreak.m_pos - 1) == softHyphen &amp;&amp; style.hyphens() != HyphensNone)
-                        hyphenated = true;
-                    if (m_lineBreak.m_pos &amp;&amp; m_lineBreak.m_pos != (unsigned)wordMeasurement.endOffset &amp;&amp; !wordMeasurement.width) {
-                        if (charWidth) {
-                            wordMeasurement.endOffset = m_lineBreak.m_pos;
-                            wordMeasurement.width = charWidth;
-                        }
-                    }
-                    // Didn't fit. Jump to the end unless there's still an opportunity to collapse whitespace.
-                    if (m_ignoringSpaces || !m_collapseWhiteSpace || !m_currentCharacterIsSpace || !previousCharacterIsSpace) {
-                        m_atEnd = true;
-                        return false;
-                    }
-                } else {
-                    if (!betweenWords || (midWordBreak &amp;&amp; !m_autoWrap))
-                        m_width.addUncommittedWidth(-additionalTempWidth);
-                    if (hyphenWidth) {
-                        // Subtract the width of the soft hyphen out since we fit on a line.
-                        m_width.addUncommittedWidth(-hyphenWidth);
-                        hyphenWidth = 0;
-                    }
-                }
-            }
-
-            if (c == '\n' &amp;&amp; m_preservesNewline) {
-                if (!stoppedIgnoringSpaces &amp;&amp; m_current.m_pos &gt; 0)
-                    ensureCharacterGetsLineBox(m_lineMidpointState, m_current);
-                m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
-                m_lineBreak.increment();
-                m_lineInfo.setPreviousLineBrokeCleanly(true);
-                return true;
-            }
-
-            if (m_autoWrap &amp;&amp; betweenWords) {
-                m_width.commit();
-                wrapW = 0;
-                m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
-                // Auto-wrapping text should not wrap in the middle of a word once it has had an
-                // opportunity to break after a word.
-                breakWords = false;
-            }
-
-            if (midWordBreak &amp;&amp; !U16_IS_TRAIL(c) &amp;&amp; !(U_GET_GC_MASK(c) &amp; U_GC_M_MASK)) {
-                // Remember this as a breakable position in case
-                // adding the end width forces a break.
-                m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
-                midWordBreak &amp;= (breakWords || breakAll);
-            }
-
-            if (betweenWords) {
-                lastSpaceWordSpacing = applyWordSpacing ? wordSpacing : 0;
-                wordSpacingForWordMeasurement = (applyWordSpacing &amp;&amp; wordMeasurement.width) ? wordSpacing : 0;
-                lastSpace = m_current.m_pos;
-            }
-
-            if (!m_ignoringSpaces &amp;&amp; m_currentStyle-&gt;collapseWhiteSpace()) {
-                // If we encounter a newline, or if we encounter a
-                // second space, we need to go ahead and break up this
-                // run and enter a mode where we start collapsing spaces.
-                if (m_currentCharacterIsSpace &amp;&amp; previousCharacterIsSpace) {
-                    m_ignoringSpaces = true;
-
-                    // We just entered a mode where we are ignoring
-                    // spaces. Create a midpoint to terminate the run
-                    // before the second space.
-                    startIgnoringSpaces(m_lineMidpointState, m_startOfIgnoredSpaces);
-                    m_trailingObjects.updateMidpointsForTrailingBoxes(m_lineMidpointState, InlineIterator(), TrailingObjects::DoNotCollapseFirstSpace);
-                }
-            }
-        } else if (m_ignoringSpaces) {
-            // Stop ignoring spaces and begin at this
-            // new point.
-            m_ignoringSpaces = false;
-            lastSpaceWordSpacing = applyWordSpacing ? wordSpacing : 0;
-            wordSpacingForWordMeasurement = (applyWordSpacing &amp;&amp; wordMeasurements.last().width) ? wordSpacing : 0;
-            lastSpace = m_current.m_pos; // e.g., &quot;Foo    goo&quot;, don't add in any of the ignored spaces.
-            stopIgnoringSpaces(m_lineMidpointState, InlineIterator(0, m_current.m_obj, m_current.m_pos));
-        }
-#if ENABLE(SVG)
-        if (isSVGText &amp;&amp; m_current.m_pos &gt; 0) {
-            // Force creation of new InlineBoxes for each absolute positioned character (those that start new text chunks).
-            if (toRenderSVGInlineText(renderText)-&gt;characterStartsNewTextChunk(m_current.m_pos))
-                ensureCharacterGetsLineBox(m_lineMidpointState, m_current);
-        }
-#endif
-
-        if (m_currentCharacterIsSpace &amp;&amp; !previousCharacterIsSpace) {
-            m_startOfIgnoredSpaces.m_obj = m_current.m_obj;
-            m_startOfIgnoredSpaces.m_pos = m_current.m_pos;
-            // Spaces after right-aligned text and before a line-break get collapsed away completely so that the trailing
-            // space doesn't seem to push the text out from the right-hand edge.
-            // FIXME: Do this regardless of the container's alignment - will require rebaselining a lot of test results.
-            if (m_nextObject &amp;&amp; m_nextObject-&gt;isBR() &amp;&amp; (m_blockStyle.textAlign() == RIGHT || m_blockStyle.textAlign() == WEBKIT_RIGHT)) {
-                m_startOfIgnoredSpaces.m_pos--;
-                // If there's just a single trailing space start ignoring it now so it collapses away.
-                if (m_current.m_pos == renderText-&gt;textLength() - 1)
-                    startIgnoringSpaces(m_lineMidpointState, m_startOfIgnoredSpaces);
-            }
-        }
-
-        if (!m_currentCharacterIsSpace &amp;&amp; previousCharacterIsWS) {
-            if (m_autoWrap &amp;&amp; m_currentStyle-&gt;breakOnlyAfterWhiteSpace())
-                m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
-        }
-
-        if (m_collapseWhiteSpace &amp;&amp; m_currentCharacterIsSpace &amp;&amp; !m_ignoringSpaces)
-            m_trailingObjects.setTrailingWhitespace(toRenderText(m_current.m_obj));
-        else if (!m_currentStyle-&gt;collapseWhiteSpace() || !m_currentCharacterIsSpace)
-            m_trailingObjects.clear();
-
-        m_atStart = false;
-        nextCharacter(c, lastCharacter, secondToLastCharacter);
-    }
-
-    m_renderTextInfo.m_lineBreakIterator.setPriorContext(lastCharacter, secondToLastCharacter);
-
-    wordMeasurements.grow(wordMeasurements.size() + 1);
-    WordMeasurement&amp; wordMeasurement = wordMeasurements.last();
-    wordMeasurement.renderer = renderText;
-
-    // IMPORTANT: current.m_pos is &gt; length here!
-    float additionalTempWidth = m_ignoringSpaces ? 0 : textWidth(renderText, lastSpace, m_current.m_pos - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout);
-    wordMeasurement.startOffset = lastSpace;
-    wordMeasurement.endOffset = m_current.m_pos;
-    wordMeasurement.width = m_ignoringSpaces ? 0 : additionalTempWidth + wordSpacingForWordMeasurement;
-    additionalTempWidth += lastSpaceWordSpacing;
-
-    float inlineLogicalTempWidth = inlineLogicalWidth(m_current.m_obj, !m_appliedStartWidth, m_includeEndWidth);
-    m_width.addUncommittedWidth(additionalTempWidth + inlineLogicalTempWidth);
-
-    if (wordMeasurement.fallbackFonts.isEmpty() &amp;&amp; !fallbackFonts.isEmpty())
-        wordMeasurement.fallbackFonts.swap(fallbackFonts);
-    fallbackFonts.clear();
-
-    if (m_collapseWhiteSpace &amp;&amp; m_currentCharacterIsSpace &amp;&amp; additionalTempWidth)
-        m_width.setTrailingWhitespaceWidth(additionalTempWidth, inlineLogicalTempWidth);
-
-    m_includeEndWidth = false;
-
-    if (!m_width.fitsOnLine()) {
-        if (canHyphenate)
-            tryHyphenating(renderText, font, style.locale(), consecutiveHyphenatedLines, m_blockStyle.hyphenationLimitLines(), style.hyphenationLimitBefore(), style.hyphenationLimitAfter(), lastSpace, m_current.m_pos, m_width.currentWidth() - additionalTempWidth, m_width.availableWidth(), isFixedPitch, m_collapseWhiteSpace, lastSpaceWordSpacing, m_lineBreak, m_current.m_nextBreakablePosition, m_lineBreaker.m_hyphenated);
-
-        if (!hyphenated &amp;&amp; m_lineBreak.previousInSameNode() == softHyphen &amp;&amp; style.hyphens() != HyphensNone) {
-            hyphenated = true;
-            m_atEnd = true;
-        }
-    }
-    return false;
-}
-
-static bool textBeginsWithBreakablePosition(RenderObject* next)
-{
-    ASSERT(next-&gt;isText());
-    RenderText* nextText = toRenderText(next);
-    if (!nextText-&gt;textLength())
-        return false;
-    UChar c = nextText-&gt;characterAt(0);
-    return c == ' ' || c == '\t' || (c == '\n' &amp;&amp; !nextText-&gt;preservesNewline());
-}
-
-inline bool BreakingContext::canBreakAtThisPosition()
-{
-    // If we are no-wrap and have found a line-breaking opportunity already then we should take it.
-    if (m_width.committedWidth() &amp;&amp; !m_width.fitsOnLine(m_currentCharacterIsSpace) &amp;&amp; m_currWS == NOWRAP)
-        return true;
-
-    // Avoid breaking before empty inlines.
-    if (m_nextObject &amp;&amp; m_nextObject-&gt;isRenderInline() &amp;&amp; isEmptyInline(toRenderInline(*m_nextObject)))
-        return false;
-
-    // Return early if we autowrap and the current character is a space as we will always want to break at such a position.
-    if (m_autoWrap &amp;&amp; m_currentCharacterIsSpace)
-        return true;
-
-    if (m_nextObject &amp;&amp; m_nextObject-&gt;isLineBreakOpportunity())
-        return m_autoWrap;
-
-    bool nextIsAutoWrappingText = (m_nextObject &amp;&amp; m_nextObject-&gt;isText() &amp;&amp; (m_autoWrap || m_nextObject-&gt;style().autoWrap()));
-    if (!nextIsAutoWrappingText)
-        return m_autoWrap;
-    bool currentIsTextOrEmptyInline = m_current.m_obj-&gt;isText() || (m_current.m_obj-&gt;isRenderInline() &amp;&amp; isEmptyInline(toRenderInline(*m_current.m_obj)));
-    if (!currentIsTextOrEmptyInline)
-        return m_autoWrap;
-
-    bool canBreakHere = !m_currentCharacterIsSpace &amp;&amp; textBeginsWithBreakablePosition(m_nextObject);
-
-    // See if attempting to fit below floats creates more available width on the line.
-    if (!m_width.fitsOnLine() &amp;&amp; !m_width.committedWidth())
-        m_width.fitBelowFloats();
-
-    bool canPlaceOnLine = m_width.fitsOnLine() || !m_autoWrapWasEverTrueOnLine;
-
-    if (canPlaceOnLine &amp;&amp; canBreakHere)
-        commitLineBreakAtCurrentWidth(m_nextObject);
-
-    return canBreakHere;
-}
-
-inline void BreakingContext::commitAndUpdateLineBreakIfNeeded()
-{
-    bool checkForBreak = canBreakAtThisPosition();
-
-    if (checkForBreak &amp;&amp; !m_width.fitsOnLine(m_ignoringSpaces)) {
-        // if we have floats, try to get below them.
-        if (m_currentCharacterIsSpace &amp;&amp; !m_ignoringSpaces &amp;&amp; m_currentStyle-&gt;collapseWhiteSpace())
-            m_trailingObjects.clear();
-
-        if (m_width.committedWidth()) {
-            m_atEnd = true;
-            return;
-        }
-
-        m_width.fitBelowFloats();
-
-        // |width| may have been adjusted because we got shoved down past a float (thus
-        // giving us more room), so we need to retest, and only jump to
-        // the end label if we still don't fit on the line. -dwh
-        if (!m_width.fitsOnLine(m_ignoringSpaces)) {
-            m_atEnd = true;
-            return;
-        }
-    } else if (m_blockStyle.autoWrap() &amp;&amp; !m_width.fitsOnLine() &amp;&amp; !m_width.committedWidth()) {
-        // If the container autowraps but the current child does not then we still need to ensure that it
-        // wraps and moves below any floats.
-        m_width.fitBelowFloats();
-    }
-
-    if (!m_current.m_obj-&gt;isFloatingOrOutOfFlowPositioned()) {
-        m_lastObject = m_current.m_obj;
-        if (m_lastObject-&gt;isReplaced() &amp;&amp; m_autoWrap &amp;&amp; (!m_lastObject-&gt;isImage() || m_allowImagesToBreak) &amp;&amp; (!m_lastObject-&gt;isListMarker() || toRenderListMarker(*m_lastObject).isInside())) {
-            m_width.commit();
-            m_lineBreak.moveToStartOf(m_nextObject);
-        }
-    }
-}
-
-InlineIterator BreakingContext::handleEndOfLine()
-{
-#if ENABLE(CSS_SHAPES)
-    ShapeInsideInfo* shapeInfo = m_block.layoutShapeInsideInfo();
-    bool segmentAllowsOverflow = !shapeInfo || !shapeInfo-&gt;hasSegments();
-#else
-    bool segmentAllowsOverflow = true;
-#endif
-    if (segmentAllowsOverflow) {
-        if (m_lineBreak == m_resolver.position()) {
-            if (!m_lineBreak.m_obj || !m_lineBreak.m_obj-&gt;isBR()) {
-                // we just add as much as possible
-                if (m_blockStyle.whiteSpace() == PRE &amp;&amp; !m_current.m_pos) {
-                    m_lineBreak.moveTo(m_lastObject, m_lastObject-&gt;isText() ? m_lastObject-&gt;length() : 0);
-                } else if (m_lineBreak.m_obj) {
-                    // Don't ever break in the middle of a word if we can help it.
-                    // There's no room at all. We just have to be on this line,
-                    // even though we'll spill out.
-                    m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos);
-                }
-            }
-            // make sure we consume at least one char/object.
-            if (m_lineBreak == m_resolver.position())
-                m_lineBreak.increment();
-        } else if (!m_current.m_pos &amp;&amp; !m_width.committedWidth() &amp;&amp; m_width.uncommittedWidth() &amp;&amp; !m_hadUncommittedWidthBeforeCurrent) {
-            // Do not push the current object to the next line, when this line has some content, but it is still considered empty.
-            // Empty inline elements like &lt;span&gt;&lt;/span&gt; can produce such lines and now we just ignore these break opportunities
-            // at the start of a line, if no width has been committed yet.
-            // Behave as if it was actually empty and consume at least one object.
-            m_lineBreak.increment();
-        }
-    }
-
-    // Sanity check our midpoints.
-    checkMidpoints(m_lineMidpointState, m_lineBreak);
-
-    m_trailingObjects.updateMidpointsForTrailingBoxes(m_lineMidpointState, m_lineBreak, TrailingObjects::CollapseFirstSpace);
-
-    // We might have made lineBreak an iterator that points past the end
-    // of the object. Do this adjustment to make it point to the start
-    // of the next object instead to avoid confusing the rest of the
-    // code.
-    if (m_lineBreak.m_pos &gt; 0) {
-        m_lineBreak.m_pos--;
-        m_lineBreak.increment();
-    }
-
-    return m_lineBreak;
-}
-
</del><span class="cx"> InlineIterator LineBreaker::nextSegmentBreak(InlineBidiResolver&amp; resolver, LineInfo&amp; lineInfo, RenderTextInfo&amp; renderTextInfo, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&amp; wordMeasurements)
</span><span class="cx"> {
</span><span class="cx">     reset();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineBreakingContextInlineHeadersh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h (0 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h                                (rev 0)
+++ trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -0,0 +1,1248 @@
</span><ins>+/*
+ * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 ChangSeok Oh &lt;shivamidow@gmail.com&gt;
+ * Copyright (C) 2013 Adobe Systems Inc. All right reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef BreakingContextInlineHeaders_h
+#define BreakingContextInlineHeaders_h
+
+#include &quot;Hyphenation.h&quot;
+#include &quot;LineBreaker.h&quot;
+#include &quot;LineInfo.h&quot;
+#include &quot;LineWidth.h&quot;
+#include &quot;RenderCombineText.h&quot;
+#include &quot;RenderCounter.h&quot;
+#include &quot;RenderInline.h&quot;
+#include &quot;RenderListMarker.h&quot;
+#include &quot;RenderRubyRun.h&quot;
+#include &quot;break_lines.h&quot;
+#include &lt;wtf/unicode/CharacterNames.h&gt;
+
+#if ENABLE(SVG)
+#include &quot;RenderSVGInlineText.h&quot;
+#endif
+
+#if ENABLE(CSS_SHAPES)
+#include &quot;ShapeInsideInfo.h&quot;
+#endif
+
+namespace WebCore {
+
+// We don't let our line box tree for a single line get any deeper than this.
+const unsigned cMaxLineDepth = 200;
+
+class WordMeasurement {
+public:
+    WordMeasurement()
+        : renderer(0)
+        , width(0)
+        , startOffset(0)
+        , endOffset(0)
+    {
+    }
+
+    RenderText* renderer;
+    float width;
+    int startOffset;
+    int endOffset;
+    HashSet&lt;const SimpleFontData*&gt; fallbackFonts;
+};
+
+class TrailingObjects {
+public:
+    TrailingObjects();
+    void setTrailingWhitespace(RenderText*);
+    void clear();
+    void appendBoxIfNeeded(RenderBoxModelObject*);
+
+    enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace };
+
+    void updateMidpointsForTrailingBoxes(LineMidpointState&amp;, const InlineIterator&amp; lBreak, CollapseFirstSpaceOrNot);
+
+private:
+    RenderText* m_whitespace;
+    Vector&lt;RenderBoxModelObject*, 4&gt; m_boxes;
+};
+
+TrailingObjects::TrailingObjects()
+    : m_whitespace(0)
+{
+}
+
+inline void TrailingObjects::setTrailingWhitespace(RenderText* whitespace)
+{
+    ASSERT(whitespace);
+    m_whitespace = whitespace;
+}
+
+inline void TrailingObjects::clear()
+{
+    m_whitespace = 0;
+    m_boxes.shrink(0); // Use shrink(0) instead of clear() to retain our capacity.
+}
+
+inline void TrailingObjects::appendBoxIfNeeded(RenderBoxModelObject* box)
+{
+    if (m_whitespace)
+        m_boxes.append(box);
+}
+
+// Don't call this directly. Use one of the descriptive helper functions below.
+inline void deprecatedAddMidpoint(LineMidpointState&amp; lineMidpointState, const InlineIterator&amp; midpoint)
+{
+    if (lineMidpointState.midpoints.size() &lt;= lineMidpointState.numMidpoints)
+        lineMidpointState.midpoints.grow(lineMidpointState.numMidpoints + 10);
+
+    InlineIterator* midpoints = lineMidpointState.midpoints.data();
+    midpoints[lineMidpointState.numMidpoints++] = midpoint;
+}
+
+inline void startIgnoringSpaces(LineMidpointState&amp; lineMidpointState, const InlineIterator&amp; midpoint)
+{
+    ASSERT(!(lineMidpointState.numMidpoints % 2));
+    deprecatedAddMidpoint(lineMidpointState, midpoint);
+}
+
+inline void stopIgnoringSpaces(LineMidpointState&amp; lineMidpointState, const InlineIterator&amp; midpoint)
+{
+    ASSERT(lineMidpointState.numMidpoints % 2);
+    deprecatedAddMidpoint(lineMidpointState, midpoint);
+}
+
+// When ignoring spaces, this needs to be called for objects that need line boxes such as RenderInlines or
+// hard line breaks to ensure that they're not ignored.
+inline void ensureLineBoxInsideIgnoredSpaces(LineMidpointState&amp; lineMidpointState, RenderObject* renderer)
+{
+    InlineIterator midpoint(0, renderer, 0);
+    stopIgnoringSpaces(lineMidpointState, midpoint);
+    startIgnoringSpaces(lineMidpointState, midpoint);
+}
+
+void TrailingObjects::updateMidpointsForTrailingBoxes(LineMidpointState&amp; lineMidpointState, const InlineIterator&amp; lBreak, CollapseFirstSpaceOrNot collapseFirstSpace)
+{
+    if (!m_whitespace)
+        return;
+
+    // This object is either going to be part of the last midpoint, or it is going to be the actual endpoint.
+    // In both cases we just decrease our pos by 1 level to exclude the space, allowing it to - in effect - collapse into the newline.
+    if (lineMidpointState.numMidpoints % 2) {
+        // Find the trailing space object's midpoint.
+        int trailingSpaceMidpoint = lineMidpointState.numMidpoints - 1;
+        for ( ; trailingSpaceMidpoint &gt; 0 &amp;&amp; lineMidpointState.midpoints[trailingSpaceMidpoint].m_obj != m_whitespace; --trailingSpaceMidpoint) { }
+        ASSERT(trailingSpaceMidpoint &gt;= 0);
+        if (collapseFirstSpace == CollapseFirstSpace)
+            lineMidpointState.midpoints[trailingSpaceMidpoint].m_pos--;
+
+        // Now make sure every single trailingPositionedBox following the trailingSpaceMidpoint properly stops and starts
+        // ignoring spaces.
+        size_t currentMidpoint = trailingSpaceMidpoint + 1;
+        for (size_t i = 0; i &lt; m_boxes.size(); ++i) {
+            if (currentMidpoint &gt;= lineMidpointState.numMidpoints) {
+                // We don't have a midpoint for this box yet.
+                ensureLineBoxInsideIgnoredSpaces(lineMidpointState, m_boxes[i]);
+            } else {
+                ASSERT(lineMidpointState.midpoints[currentMidpoint].m_obj == m_boxes[i]);
+                ASSERT(lineMidpointState.midpoints[currentMidpoint + 1].m_obj == m_boxes[i]);
+            }
+            currentMidpoint += 2;
+        }
+    } else if (!lBreak.m_obj) {
+        ASSERT(m_whitespace-&gt;isText());
+        ASSERT(collapseFirstSpace == CollapseFirstSpace);
+        // Add a new end midpoint that stops right at the very end.
+        unsigned length = m_whitespace-&gt;textLength();
+        unsigned pos = length &gt;= 2 ? length - 2 : UINT_MAX;
+        InlineIterator endMid(0, m_whitespace, pos);
+        startIgnoringSpaces(lineMidpointState, endMid);
+        for (size_t i = 0; i &lt; m_boxes.size(); ++i)
+            ensureLineBoxInsideIgnoredSpaces(lineMidpointState, m_boxes[i]);
+    }
+}
+
+class BreakingContext {
+public:
+    BreakingContext(LineBreaker&amp; lineBreaker, InlineBidiResolver&amp; resolver, LineInfo&amp; inLineInfo, LineWidth&amp; lineWidth, RenderTextInfo&amp; inRenderTextInfo, FloatingObject* inLastFloatFromPreviousLine, bool appliedStartWidth, RenderBlockFlow&amp; block)
+        : m_lineBreaker(lineBreaker)
+        , m_resolver(resolver)
+        , m_current(resolver.position())
+        , m_lineBreak(resolver.position())
+        , m_block(block)
+        , m_lastObject(m_current.m_obj)
+        , m_nextObject(0)
+        , m_currentStyle(0)
+        , m_blockStyle(block.style())
+        , m_lineInfo(inLineInfo)
+        , m_renderTextInfo(inRenderTextInfo)
+        , m_lastFloatFromPreviousLine(inLastFloatFromPreviousLine)
+        , m_width(lineWidth)
+        , m_currWS(NORMAL)
+        , m_lastWS(NORMAL)
+        , m_preservesNewline(false)
+        , m_atStart(true)
+        , m_ignoringSpaces(false)
+        , m_currentCharacterIsSpace(false)
+        , m_currentCharacterIsWS(false)
+        , m_appliedStartWidth(appliedStartWidth)
+        , m_includeEndWidth(true)
+        , m_autoWrap(false)
+        , m_autoWrapWasEverTrueOnLine(false)
+        , m_floatsFitOnLine(true)
+        , m_collapseWhiteSpace(false)
+        , m_startingNewParagraph(m_lineInfo.previousLineBrokeCleanly())
+        , m_allowImagesToBreak(!block.document().inQuirksMode() || !block.isTableCell() || !m_blockStyle.logicalWidth().isIntrinsicOrAuto())
+        , m_atEnd(false)
+        , m_hadUncommittedWidthBeforeCurrent(false)
+        , m_lineMidpointState(resolver.midpointState())
+    {
+        m_lineInfo.setPreviousLineBrokeCleanly(false);
+    }
+
+    RenderObject* currentObject() { return m_current.m_obj; }
+    InlineIterator lineBreak() { return m_lineBreak; }
+    InlineIterator&amp; lineBreakRef() {return m_lineBreak; }
+    LineWidth&amp; lineWidth() { return m_width; }
+    bool atEnd() { return m_atEnd; }
+
+    void initializeForCurrentObject();
+
+    void increment();
+
+    void handleBR(EClear&amp;);
+    void handleOutOfFlowPositioned(Vector&lt;RenderBox*&gt;&amp; positionedObjects);
+    void handleFloat();
+    void handleEmptyInline();
+    void handleReplaced();
+    bool handleText(WordMeasurements&amp;, bool&amp; hyphenated, unsigned&amp; consecutiveHyphenatedLines);
+    bool canBreakAtThisPosition();
+    void commitAndUpdateLineBreakIfNeeded();
+    InlineIterator handleEndOfLine();
+
+    void clearLineBreakIfFitsOnLine(bool ignoringTrailingSpace = false)
+    {
+        if (m_width.fitsOnLine(ignoringTrailingSpace) || m_lastWS == NOWRAP)
+            m_lineBreak.clear();
+    }
+
+    void commitLineBreakAtCurrentWidth(RenderObject* object, unsigned offset = 0, int nextBreak = -1)
+    {
+        m_width.commit();
+        m_lineBreak.moveTo(object, offset, nextBreak);
+    }
+
+private:
+    LineBreaker&amp; m_lineBreaker;
+    InlineBidiResolver&amp; m_resolver;
+
+    InlineIterator m_current;
+    InlineIterator m_lineBreak;
+    InlineIterator m_startOfIgnoredSpaces;
+
+    RenderBlockFlow&amp; m_block;
+    RenderObject* m_lastObject;
+    RenderObject* m_nextObject;
+
+    RenderStyle* m_currentStyle;
+
+    // Firefox and Opera will allow a table cell to grow to fit an image inside it under
+    // very specific circumstances (in order to match common WinIE renderings).
+    // Not supporting the quirk has caused us to mis-render some real sites. (See Bugzilla 10517.)
+    RenderStyle&amp; m_blockStyle;
+
+    LineInfo&amp; m_lineInfo;
+
+    RenderTextInfo&amp; m_renderTextInfo;
+
+    FloatingObject* m_lastFloatFromPreviousLine;
+
+    LineWidth m_width;
+
+    EWhiteSpace m_currWS;
+    EWhiteSpace m_lastWS;
+
+    bool m_preservesNewline;
+    bool m_atStart;
+
+    // This variable is used only if whitespace isn't set to PRE, and it tells us whether
+    // or not we are currently ignoring whitespace.
+    bool m_ignoringSpaces;
+
+    // This variable tracks whether the very last character we saw was a space. We use
+    // this to detect when we encounter a second space so we know we have to terminate
+    // a run.
+    bool m_currentCharacterIsSpace;
+    bool m_currentCharacterIsWS;
+    bool m_appliedStartWidth;
+    bool m_includeEndWidth;
+    bool m_autoWrap;
+    bool m_autoWrapWasEverTrueOnLine;
+    bool m_floatsFitOnLine;
+    bool m_collapseWhiteSpace;
+    bool m_startingNewParagraph;
+    bool m_allowImagesToBreak;
+    bool m_atEnd;
+    bool m_hadUncommittedWidthBeforeCurrent;
+
+    LineMidpointState&amp; m_lineMidpointState;
+
+    TrailingObjects m_trailingObjects;
+};
+
+inline void BreakingContext::initializeForCurrentObject()
+{
+    m_hadUncommittedWidthBeforeCurrent = !!m_width.uncommittedWidth();
+
+    m_currentStyle = &amp;m_current.m_obj-&gt;style();
+
+    ASSERT(m_currentStyle);
+
+    m_nextObject = bidiNextSkippingEmptyInlines(m_block, m_current.m_obj);
+    if (m_nextObject &amp;&amp; m_nextObject-&gt;parent() &amp;&amp; !m_nextObject-&gt;parent()-&gt;isDescendantOf(m_current.m_obj-&gt;parent()))
+        m_includeEndWidth = true;
+
+    m_currWS = m_current.m_obj-&gt;isReplaced() ? m_current.m_obj-&gt;parent()-&gt;style().whiteSpace() : m_currentStyle-&gt;whiteSpace();
+    m_lastWS = m_lastObject-&gt;isReplaced() ? m_lastObject-&gt;parent()-&gt;style().whiteSpace() : m_lastObject-&gt;style().whiteSpace();
+
+    m_autoWrap = RenderStyle::autoWrap(m_currWS);
+    m_autoWrapWasEverTrueOnLine = m_autoWrapWasEverTrueOnLine || m_autoWrap;
+
+#if ENABLE(SVG)
+    m_preservesNewline = m_current.m_obj-&gt;isSVGInlineText() ? false : RenderStyle::preserveNewline(m_currWS);
+#else
+    m_preservesNewline = RenderStyle::preserveNewline(m_currWS);
+#endif
+
+    m_collapseWhiteSpace = RenderStyle::collapseWhiteSpace(m_currWS);
+}
+
+inline void BreakingContext::increment()
+{
+    // Clear out our character space bool, since inline &lt;pre&gt;s don't collapse whitespace
+    // with adjacent inline normal/nowrap spans.
+    if (!m_collapseWhiteSpace)
+        m_currentCharacterIsSpace = false;
+
+    m_current.moveToStartOf(m_nextObject);
+    m_atStart = false;
+}
+
+inline void BreakingContext::handleBR(EClear&amp; clear)
+{
+    if (m_width.fitsOnLine()) {
+        RenderObject* br = m_current.m_obj;
+        m_lineBreak.moveToStartOf(br);
+        m_lineBreak.increment();
+
+        // A &lt;br&gt; always breaks a line, so don't let the line be collapsed
+        // away. Also, the space at the end of a line with a &lt;br&gt; does not
+        // get collapsed away. It only does this if the previous line broke
+        // cleanly. Otherwise the &lt;br&gt; has no effect on whether the line is
+        // empty or not.
+        if (m_startingNewParagraph)
+            m_lineInfo.setEmpty(false, &amp;m_block, &amp;m_width);
+        m_trailingObjects.clear();
+        m_lineInfo.setPreviousLineBrokeCleanly(true);
+
+        // A &lt;br&gt; with clearance always needs a linebox in case the lines below it get dirtied later and
+        // need to check for floats to clear - so if we're ignoring spaces, stop ignoring them and add a
+        // run for this object.
+        if (m_ignoringSpaces &amp;&amp; m_currentStyle-&gt;clear() != CNONE)
+            ensureLineBoxInsideIgnoredSpaces(m_lineMidpointState, br);
+        // If we were preceded by collapsing space and are in a right-aligned container we need to ensure the space gets
+        // collapsed away so that it doesn't push the text out from the container's right-hand edge.
+        // FIXME: Do this regardless of the container's alignment - will require rebaselining a lot of test results.
+        else if (m_ignoringSpaces &amp;&amp; (m_blockStyle.textAlign() == RIGHT || m_blockStyle.textAlign() == WEBKIT_RIGHT))
+            stopIgnoringSpaces(m_lineMidpointState, InlineIterator(0, m_current.m_obj, m_current.m_pos));
+
+        if (!m_lineInfo.isEmpty())
+            clear = m_currentStyle-&gt;clear();
+    }
+    m_atEnd = true;
+}
+
+inline LayoutUnit borderPaddingMarginStart(const RenderInline&amp; child)
+{
+    return child.marginStart() + child.paddingStart() + child.borderStart();
+}
+
+inline LayoutUnit borderPaddingMarginEnd(const RenderInline&amp; child)
+{
+    return child.marginEnd() + child.paddingEnd() + child.borderEnd();
+}
+
+inline bool shouldAddBorderPaddingMargin(RenderObject* child)
+{
+    // When deciding whether we're at the edge of an inline, adjacent collapsed whitespace is the same as no sibling at all.
+    return !child || (child-&gt;isText() &amp;&amp; !toRenderText(child)-&gt;textLength());
+}
+
+inline RenderObject* previousInFlowSibling(RenderObject* child)
+{
+    child = child-&gt;previousSibling();
+    while (child &amp;&amp; child-&gt;isOutOfFlowPositioned())
+        child = child-&gt;previousSibling();
+    return child;
+}
+
+inline LayoutUnit inlineLogicalWidth(RenderObject* child, bool checkStartEdge = true, bool checkEndEdge = true)
+{
+    unsigned lineDepth = 1;
+    LayoutUnit extraWidth = 0;
+    RenderElement* parent = child-&gt;parent();
+    while (parent-&gt;isRenderInline() &amp;&amp; lineDepth++ &lt; cMaxLineDepth) {
+        const RenderInline&amp; parentAsRenderInline = toRenderInline(*parent);
+        if (!isEmptyInline(parentAsRenderInline)) {
+            checkStartEdge = checkStartEdge &amp;&amp; shouldAddBorderPaddingMargin(previousInFlowSibling(child));
+            if (checkStartEdge)
+                extraWidth += borderPaddingMarginStart(parentAsRenderInline);
+            checkEndEdge = checkEndEdge &amp;&amp; shouldAddBorderPaddingMargin(child-&gt;nextSibling());
+            if (checkEndEdge)
+                extraWidth += borderPaddingMarginEnd(parentAsRenderInline);
+            if (!checkStartEdge &amp;&amp; !checkEndEdge)
+                return extraWidth;
+        }
+        child = parent;
+        parent = child-&gt;parent();
+    }
+    return extraWidth;
+}
+
+inline void BreakingContext::handleOutOfFlowPositioned(Vector&lt;RenderBox*&gt;&amp; positionedObjects)
+{
+    // If our original display wasn't an inline type, then we can
+    // go ahead and determine our static inline position now.
+    RenderBox* box = toRenderBox(m_current.m_obj);
+    bool isInlineType = box-&gt;style().isOriginalDisplayInlineType();
+    if (!isInlineType)
+        m_block.setStaticInlinePositionForChild(*box, m_block.logicalHeight(), m_block.startOffsetForContent(m_block.logicalHeight()));
+    else {
+        // If our original display was an INLINE type, then we can go ahead
+        // and determine our static y position now.
+        box-&gt;layer()-&gt;setStaticBlockPosition(m_block.logicalHeight());
+    }
+
+    // If we're ignoring spaces, we have to stop and include this object and
+    // then start ignoring spaces again.
+    if (isInlineType || box-&gt;container()-&gt;isRenderInline()) {
+        if (m_ignoringSpaces)
+            ensureLineBoxInsideIgnoredSpaces(m_lineMidpointState, box);
+        m_trailingObjects.appendBoxIfNeeded(box);
+    } else
+        positionedObjects.append(box);
+
+    m_width.addUncommittedWidth(inlineLogicalWidth(box));
+    // Reset prior line break context characters.
+    m_renderTextInfo.m_lineBreakIterator.resetPriorContext();
+}
+
+inline void BreakingContext::handleFloat()
+{
+    RenderBox&amp; floatBox = toRenderBox(*m_current.m_obj);
+    FloatingObject* floatingObject = m_block.insertFloatingObject(floatBox);
+    // check if it fits in the current line.
+    // If it does, position it now, otherwise, position
+    // it after moving to next line (in newLine() func)
+    // FIXME: Bug 110372: Properly position multiple stacked floats with non-rectangular shape outside.
+    if (m_floatsFitOnLine &amp;&amp; m_width.fitsOnLineExcludingTrailingWhitespace(m_block.logicalWidthForFloat(floatingObject))) {
+        m_block.positionNewFloatOnLine(floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width);
+        if (m_lineBreak.m_obj == m_current.m_obj) {
+            ASSERT(!m_lineBreak.m_pos);
+            m_lineBreak.increment();
+        }
+    } else
+        m_floatsFitOnLine = false;
+    // Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for floating element.
+    m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
+}
+
+// This is currently just used for list markers and inline flows that have line boxes. Neither should
+// have an effect on whitespace at the start of the line.
+inline bool shouldSkipWhitespaceAfterStartObject(RenderBlockFlow&amp; block, RenderObject* o, LineMidpointState&amp; lineMidpointState)
+{
+    RenderObject* next = bidiNextSkippingEmptyInlines(block, o);
+    while (next &amp;&amp; next-&gt;isFloatingOrOutOfFlowPositioned())
+        next = bidiNextSkippingEmptyInlines(block, next);
+
+    if (next &amp;&amp; next-&gt;isText() &amp;&amp; toRenderText(next)-&gt;textLength() &gt; 0) {
+        RenderText* nextText = toRenderText(next);
+        UChar nextChar = nextText-&gt;characterAt(0);
+        if (nextText-&gt;style().isCollapsibleWhiteSpace(nextChar)) {
+            startIgnoringSpaces(lineMidpointState, InlineIterator(0, o, 0));
+            return true;
+        }
+    }
+
+    return false;
+}
+
+inline void BreakingContext::handleEmptyInline()
+{
+    RenderInline&amp; flowBox = toRenderInline(*m_current.m_obj);
+
+    // This should only end up being called on empty inlines
+    ASSERT(isEmptyInline(flowBox));
+
+    // Now that some inline flows have line boxes, if we are already ignoring spaces, we need
+    // to make sure that we stop to include this object and then start ignoring spaces again.
+    // If this object is at the start of the line, we need to behave like list markers and
+    // start ignoring spaces.
+    bool requiresLineBox = alwaysRequiresLineBox(flowBox);
+    if (requiresLineBox || requiresLineBoxForContent(flowBox, m_lineInfo)) {
+        // An empty inline that only has line-height, vertical-align or font-metrics will only get a
+        // line box to affect the height of the line if the rest of the line is not empty.
+        if (requiresLineBox)
+            m_lineInfo.setEmpty(false, &amp;m_block, &amp;m_width);
+        if (m_ignoringSpaces) {
+            m_trailingObjects.clear();
+            ensureLineBoxInsideIgnoredSpaces(m_lineMidpointState, m_current.m_obj);
+        } else if (m_blockStyle.collapseWhiteSpace() &amp;&amp; m_resolver.position().m_obj == m_current.m_obj
+            &amp;&amp; shouldSkipWhitespaceAfterStartObject(m_block, m_current.m_obj, m_lineMidpointState)) {
+            // Like with list markers, we start ignoring spaces to make sure that any
+            // additional spaces we see will be discarded.
+            m_currentCharacterIsSpace = true;
+            m_currentCharacterIsWS = true;
+            m_ignoringSpaces = true;
+        } else
+            m_trailingObjects.appendBoxIfNeeded(&amp;flowBox);
+    }
+
+    m_width.addUncommittedWidth(inlineLogicalWidth(m_current.m_obj) + borderPaddingMarginStart(flowBox) + borderPaddingMarginEnd(flowBox));
+}
+
+inline void BreakingContext::handleReplaced()
+{
+    RenderBox&amp; replacedBox = toRenderBox(*m_current.m_obj);
+
+    if (m_atStart)
+        m_width.updateAvailableWidth(replacedBox.logicalHeight());
+
+    // Break on replaced elements if either has normal white-space.
+    if ((m_autoWrap || RenderStyle::autoWrap(m_lastWS)) &amp;&amp; (!m_current.m_obj-&gt;isImage() || m_allowImagesToBreak)) {
+        m_width.commit();
+        m_lineBreak.moveToStartOf(m_current.m_obj);
+    }
+
+    if (m_ignoringSpaces)
+        stopIgnoringSpaces(m_lineMidpointState, InlineIterator(0, m_current.m_obj, 0));
+
+    m_lineInfo.setEmpty(false, &amp;m_block, &amp;m_width);
+    m_ignoringSpaces = false;
+    m_currentCharacterIsSpace = false;
+    m_currentCharacterIsWS = false;
+    m_trailingObjects.clear();
+
+    // Optimize for a common case. If we can't find whitespace after the list
+    // item, then this is all moot.
+    LayoutUnit replacedLogicalWidth = m_block.logicalWidthForChild(replacedBox) + m_block.marginStartForChild(replacedBox) + m_block.marginEndForChild(replacedBox) + inlineLogicalWidth(m_current.m_obj);
+    if (m_current.m_obj-&gt;isListMarker()) {
+        if (m_blockStyle.collapseWhiteSpace() &amp;&amp; shouldSkipWhitespaceAfterStartObject(m_block, m_current.m_obj, m_lineMidpointState)) {
+            // Like with inline flows, we start ignoring spaces to make sure that any
+            // additional spaces we see will be discarded.
+            m_currentCharacterIsSpace = true;
+            m_currentCharacterIsWS = false;
+            m_ignoringSpaces = true;
+        }
+        if (toRenderListMarker(*m_current.m_obj).isInside())
+            m_width.addUncommittedWidth(replacedLogicalWidth);
+    } else
+        m_width.addUncommittedWidth(replacedLogicalWidth);
+    if (m_current.m_obj-&gt;isRubyRun())
+        m_width.applyOverhang(toRenderRubyRun(m_current.m_obj), m_lastObject, m_nextObject);
+    // Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for replaced element.
+    m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
+}
+
+inline float firstPositiveWidth(const WordMeasurements&amp; wordMeasurements)
+{
+    for (size_t i = 0; i &lt; wordMeasurements.size(); ++i) {
+        if (wordMeasurements[i].width &gt; 0)
+            return wordMeasurements[i].width;
+    }
+    return 0;
+}
+
+#if ENABLE(CSS_SHAPES)
+inline void updateSegmentsForShapes(RenderBlockFlow&amp; block, const FloatingObject* lastFloatFromPreviousLine, const WordMeasurements&amp; wordMeasurements, LineWidth&amp; width, bool isFirstLine)
+{
+    ASSERT(lastFloatFromPreviousLine);
+
+    ShapeInsideInfo* shapeInsideInfo = block.layoutShapeInsideInfo();
+    if (!lastFloatFromPreviousLine-&gt;isPlaced() || !shapeInsideInfo)
+        return;
+
+    bool isHorizontalWritingMode = block.isHorizontalWritingMode();
+    LayoutUnit logicalOffsetFromShapeContainer = block.logicalOffsetFromShapeAncestorContainer(shapeInsideInfo-&gt;owner()).height();
+
+    LayoutUnit lineLogicalTop = block.logicalHeight() + logicalOffsetFromShapeContainer;
+    LayoutUnit lineLogicalHeight = block.lineHeight(isFirstLine, isHorizontalWritingMode ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
+    LayoutUnit lineLogicalBottom = lineLogicalTop + lineLogicalHeight;
+
+    LayoutUnit floatLogicalTop = block.logicalTopForFloat(lastFloatFromPreviousLine);
+    LayoutUnit floatLogicalBottom = block.logicalBottomForFloat(lastFloatFromPreviousLine);
+
+    bool lineOverlapsWithFloat = (floatLogicalTop &lt; lineLogicalBottom) &amp;&amp; (lineLogicalTop &lt; floatLogicalBottom);
+    if (!lineOverlapsWithFloat)
+        return;
+
+    float minSegmentWidth = firstPositiveWidth(wordMeasurements);
+
+    LayoutUnit floatLogicalWidth = block.logicalWidthForFloat(lastFloatFromPreviousLine);
+    LayoutUnit availableLogicalWidth = block.logicalWidth() - block.logicalRightForFloat(lastFloatFromPreviousLine);
+    if (availableLogicalWidth &lt; minSegmentWidth)
+        block.setLogicalHeight(floatLogicalBottom);
+
+    if (block.logicalHeight() &lt; floatLogicalTop) {
+        shapeInsideInfo-&gt;adjustLogicalLineTop(minSegmentWidth + floatLogicalWidth);
+        block.setLogicalHeight(shapeInsideInfo-&gt;logicalLineTop() - logicalOffsetFromShapeContainer);
+    }
+
+    lineLogicalTop = block.logicalHeight() + logicalOffsetFromShapeContainer;
+
+    shapeInsideInfo-&gt;updateSegmentsForLine(lineLogicalTop, lineLogicalHeight);
+    width.updateCurrentShapeSegment();
+    width.updateAvailableWidth();
+}
+#endif
+
+inline bool iteratorIsBeyondEndOfRenderCombineText(const InlineIterator&amp; iter, RenderCombineText&amp; renderer)
+{
+    return iter.m_obj == &amp;renderer &amp;&amp; iter.m_pos &gt;= renderer.textLength();
+}
+
+inline void nextCharacter(UChar&amp; currentCharacter, UChar&amp; lastCharacter, UChar&amp; secondToLastCharacter)
+{
+    secondToLastCharacter = lastCharacter;
+    lastCharacter = currentCharacter;
+}
+
+// FIXME: Don't let counters mark themselves as needing pref width recalcs during layout
+// so we don't need this hack.
+inline void updateCounterIfNeeded(RenderText&amp; renderText)
+{
+    if (!renderText.preferredLogicalWidthsDirty() || !renderText.isCounter())
+        return;
+    toRenderCounter(renderText).updateCounter();
+}
+
+inline float measureHyphenWidth(RenderText* renderer, const Font&amp; font, HashSet&lt;const SimpleFontData*&gt;* fallbackFonts = 0)
+{
+    const RenderStyle&amp; style = renderer-&gt;style();
+    return font.width(RenderBlock::constructTextRun(renderer, font, style.hyphenString().string(), style), fallbackFonts);
+}
+
+ALWAYS_INLINE float textWidth(RenderText* text, unsigned from, unsigned len, const Font&amp; font, float xPos, bool isFixedPitch, bool collapseWhiteSpace, HashSet&lt;const SimpleFontData*&gt;&amp; fallbackFonts, TextLayout* layout = 0)
+{
+    const RenderStyle&amp; style = text-&gt;style();
+
+    GlyphOverflow glyphOverflow;
+    if (isFixedPitch || (!from &amp;&amp; len == text-&gt;textLength()) || style.hasTextCombine())
+        return text-&gt;width(from, len, font, xPos, &amp;fallbackFonts, &amp;glyphOverflow);
+
+    if (layout)
+        return Font::width(*layout, from, len, &amp;fallbackFonts);
+
+    TextRun run = RenderBlock::constructTextRun(text, font, text, from, len, style);
+    run.setCharactersLength(text-&gt;textLength() - from);
+    ASSERT(run.charactersLength() &gt;= run.length());
+
+    run.setCharacterScanForCodePath(!text-&gt;canUseSimpleFontCodePath());
+    run.setTabSize(!collapseWhiteSpace, style.tabSize());
+    run.setXPos(xPos);
+    return font.width(run, &amp;fallbackFonts, &amp;glyphOverflow);
+}
+
+// Adding a pair of midpoints before a character will split it out into a new line box.
+inline void ensureCharacterGetsLineBox(LineMidpointState&amp; lineMidpointState, InlineIterator&amp; textParagraphSeparator)
+{
+    InlineIterator midpoint(0, textParagraphSeparator.m_obj, textParagraphSeparator.m_pos);
+    startIgnoringSpaces(lineMidpointState, InlineIterator(0, textParagraphSeparator.m_obj, textParagraphSeparator.m_pos - 1));
+    stopIgnoringSpaces(lineMidpointState, InlineIterator(0, textParagraphSeparator.m_obj, textParagraphSeparator.m_pos));
+}
+
+inline void tryHyphenating(RenderText* text, const Font&amp; font, const AtomicString&amp; localeIdentifier, unsigned consecutiveHyphenatedLines, int consecutiveHyphenatedLinesLimit, int minimumPrefixLimit, int minimumSuffixLimit, unsigned lastSpace, unsigned pos, float xPos, int availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator&amp; lineBreak, int nextBreakable, bool&amp; hyphenated)
+{
+    // Map 'hyphenate-limit-{before,after}: auto;' to 2.
+    unsigned minimumPrefixLength;
+    unsigned minimumSuffixLength;
+
+    if (minimumPrefixLimit &lt; 0)
+        minimumPrefixLength = 2;
+    else
+        minimumPrefixLength = static_cast&lt;unsigned&gt;(minimumPrefixLimit);
+
+    if (minimumSuffixLimit &lt; 0)
+        minimumSuffixLength = 2;
+    else
+        minimumSuffixLength = static_cast&lt;unsigned&gt;(minimumSuffixLimit);
+
+    if (pos - lastSpace &lt;= minimumSuffixLength)
+        return;
+
+    if (consecutiveHyphenatedLinesLimit &gt;= 0 &amp;&amp; consecutiveHyphenatedLines &gt;= static_cast&lt;unsigned&gt;(consecutiveHyphenatedLinesLimit))
+        return;
+
+    int hyphenWidth = measureHyphenWidth(text, font);
+
+    float maxPrefixWidth = availableWidth - xPos - hyphenWidth - lastSpaceWordSpacing;
+    // If the maximum width available for the prefix before the hyphen is small, then it is very unlikely
+    // that an hyphenation opportunity exists, so do not bother to look for it.
+    if (maxPrefixWidth &lt;= font.pixelSize() * 5 / 4)
+        return;
+
+    const RenderStyle&amp; style = text-&gt;style();
+    TextRun run = RenderBlock::constructTextRun(text, font, text, lastSpace, pos - lastSpace, style);
+    run.setCharactersLength(text-&gt;textLength() - lastSpace);
+    ASSERT(run.charactersLength() &gt;= run.length());
+
+    run.setTabSize(!collapseWhiteSpace, style.tabSize());
+    run.setXPos(xPos + lastSpaceWordSpacing);
+
+    unsigned prefixLength = font.offsetForPosition(run, maxPrefixWidth, false);
+    if (prefixLength &lt; minimumPrefixLength)
+        return;
+
+    prefixLength = lastHyphenLocation(text-&gt;characters() + lastSpace, pos - lastSpace, std::min(prefixLength, pos - lastSpace - minimumSuffixLength) + 1, localeIdentifier);
+    if (!prefixLength || prefixLength &lt; minimumPrefixLength)
+        return;
+
+    // When lastSapce is a space, which it always is except sometimes at the beginning of a line or after collapsed
+    // space, it should not count towards hyphenate-limit-before.
+    if (prefixLength == minimumPrefixLength) {
+        UChar characterAtLastSpace = text-&gt;characterAt(lastSpace);
+        if (characterAtLastSpace == ' ' || characterAtLastSpace == '\n' || characterAtLastSpace == '\t' || characterAtLastSpace == noBreakSpace)
+            return;
+    }
+
+    ASSERT(pos - lastSpace - prefixLength &gt;= minimumSuffixLength);
+
+#if !ASSERT_DISABLED
+    HashSet&lt;const SimpleFontData*&gt; fallbackFonts;
+    float prefixWidth = hyphenWidth + textWidth(text, lastSpace, prefixLength, font, xPos, isFixedPitch, collapseWhiteSpace, fallbackFonts) + lastSpaceWordSpacing;
+    ASSERT(xPos + prefixWidth &lt;= availableWidth);
+#else
+    UNUSED_PARAM(isFixedPitch);
+#endif
+
+    lineBreak.moveTo(text, lastSpace + prefixLength, nextBreakable);
+    hyphenated = true;
+}
+
+inline bool BreakingContext::handleText(WordMeasurements&amp; wordMeasurements, bool&amp; hyphenated,  unsigned&amp; consecutiveHyphenatedLines)
+{
+    if (!m_current.m_pos)
+        m_appliedStartWidth = false;
+
+    RenderText* renderText = toRenderText(m_current.m_obj);
+
+#if ENABLE(SVG)
+    bool isSVGText = renderText-&gt;isSVGInlineText();
+#endif
+
+    // If we have left a no-wrap inline and entered an autowrap inline while ignoring spaces
+    // then we need to mark the start of the autowrap inline as a potential linebreak now.
+    if (m_autoWrap &amp;&amp; !RenderStyle::autoWrap(m_lastWS) &amp;&amp; m_ignoringSpaces)
+        commitLineBreakAtCurrentWidth(m_current.m_obj);
+
+    if (renderText-&gt;style().hasTextCombine() &amp;&amp; m_current.m_obj-&gt;isCombineText() &amp;&amp; !toRenderCombineText(*m_current.m_obj).isCombined()) {
+        RenderCombineText&amp; combineRenderer = toRenderCombineText(*m_current.m_obj);
+        combineRenderer.combineText();
+        // The length of the renderer's text may have changed. Increment stale iterator positions
+        if (iteratorIsBeyondEndOfRenderCombineText(m_lineBreak, combineRenderer)) {
+            ASSERT(iteratorIsBeyondEndOfRenderCombineText(m_resolver.position(), combineRenderer));
+            m_lineBreak.increment();
+            m_resolver.increment();
+        }
+    }
+
+    const RenderStyle&amp; style = lineStyle(*renderText-&gt;parent(), m_lineInfo);
+    const Font&amp; font = style.font();
+    bool isFixedPitch = font.isFixedPitch();
+    bool canHyphenate = style.hyphens() == HyphensAuto &amp;&amp; WebCore::canHyphenate(style.locale());
+
+    unsigned lastSpace = m_current.m_pos;
+    float wordSpacing = m_currentStyle-&gt;wordSpacing();
+    float lastSpaceWordSpacing = 0;
+    float wordSpacingForWordMeasurement = 0;
+
+    float wrapW = m_width.uncommittedWidth() + inlineLogicalWidth(m_current.m_obj, !m_appliedStartWidth, true);
+    float charWidth = 0;
+    bool breakNBSP = m_autoWrap &amp;&amp; m_currentStyle-&gt;nbspMode() == SPACE;
+    // Auto-wrapping text should wrap in the middle of a word only if it could not wrap before the word,
+    // which is only possible if the word is the first thing on the line, that is, if |w| is zero.
+    bool breakWords = m_currentStyle-&gt;breakWords() &amp;&amp; ((m_autoWrap &amp;&amp; !m_width.committedWidth()) || m_currWS == PRE);
+    bool midWordBreak = false;
+    bool breakAll = m_currentStyle-&gt;wordBreak() == BreakAllWordBreak &amp;&amp; m_autoWrap;
+    float hyphenWidth = 0;
+#if ENABLE(SVG)
+    if (isSVGText) {
+        breakWords = false;
+        breakAll = false;
+    }
+#endif
+
+    if (m_renderTextInfo.m_text != renderText) {
+        updateCounterIfNeeded(*renderText);
+        m_renderTextInfo.m_text = renderText;
+        m_renderTextInfo.m_font = &amp;font;
+        m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
+        m_renderTextInfo.m_lineBreakIterator.resetStringAndReleaseIterator(renderText-&gt;text(), style.locale());
+    } else if (m_renderTextInfo.m_layout &amp;&amp; m_renderTextInfo.m_font != &amp;font) {
+        m_renderTextInfo.m_font = &amp;font;
+        m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
+    }
+
+    TextLayout* textLayout = m_renderTextInfo.m_layout.get();
+
+    // Non-zero only when kerning is enabled and TextLayout isn't used, in which case we measure
+    // words with their trailing space, then subtract its width.
+    HashSet&lt;const SimpleFontData*&gt; fallbackFonts;
+    float wordTrailingSpaceWidth = (font.typesettingFeatures() &amp; Kerning) &amp;&amp; !textLayout ? font.width(RenderBlock::constructTextRun(renderText, font, &amp;space, 1, style), &amp;fallbackFonts) + wordSpacing : 0;
+
+    UChar lastCharacter = m_renderTextInfo.m_lineBreakIterator.lastCharacter();
+    UChar secondToLastCharacter = m_renderTextInfo.m_lineBreakIterator.secondToLastCharacter();
+    for (; m_current.m_pos &lt; renderText-&gt;textLength(); m_current.fastIncrementInTextNode()) {
+        bool previousCharacterIsSpace = m_currentCharacterIsSpace;
+        bool previousCharacterIsWS = m_currentCharacterIsWS;
+        UChar c = m_current.current();
+        m_currentCharacterIsSpace = c == ' ' || c == '\t' || (!m_preservesNewline &amp;&amp; (c == '\n'));
+
+        if (!m_collapseWhiteSpace || !m_currentCharacterIsSpace)
+            m_lineInfo.setEmpty(false, &amp;m_block, &amp;m_width);
+
+        if (c == softHyphen &amp;&amp; m_autoWrap &amp;&amp; !hyphenWidth &amp;&amp; style.hyphens() != HyphensNone) {
+            hyphenWidth = measureHyphenWidth(renderText, font, &amp;fallbackFonts);
+            m_width.addUncommittedWidth(hyphenWidth);
+        }
+
+        bool applyWordSpacing = false;
+
+        m_currentCharacterIsWS = m_currentCharacterIsSpace || (breakNBSP &amp;&amp; c == noBreakSpace);
+
+        if ((breakAll || breakWords) &amp;&amp; !midWordBreak &amp;&amp; (!m_currentCharacterIsSpace || style.whiteSpace() != PRE_WRAP)) {
+            wrapW += charWidth;
+            bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) &amp;&amp; m_current.m_pos + 1 &lt; renderText-&gt;textLength() &amp;&amp; U16_IS_TRAIL((*renderText)[m_current.m_pos + 1]);
+            charWidth = textWidth(renderText, m_current.m_pos, midWordBreakIsBeforeSurrogatePair ? 2 : 1, font, m_width.committedWidth() + wrapW, isFixedPitch, m_collapseWhiteSpace, fallbackFonts, textLayout);
+            midWordBreak = m_width.committedWidth() + wrapW + charWidth &gt; m_width.availableWidth();
+        }
+
+        bool betweenWords = c == '\n' || (m_currWS != PRE &amp;&amp; !m_atStart &amp;&amp; isBreakable(m_renderTextInfo.m_lineBreakIterator, m_current.m_pos, m_current.m_nextBreakablePosition, breakNBSP)
+            &amp;&amp; (style.hyphens() != HyphensNone || (m_current.previousInSameNode() != softHyphen)));
+
+        if (betweenWords || midWordBreak) {
+            bool stoppedIgnoringSpaces = false;
+            if (m_ignoringSpaces) {
+                lastSpaceWordSpacing = 0;
+                if (!m_currentCharacterIsSpace) {
+                    // Stop ignoring spaces and begin at this
+                    // new point.
+                    m_ignoringSpaces = false;
+                    wordSpacingForWordMeasurement = 0;
+                    lastSpace = m_current.m_pos; // e.g., &quot;Foo    goo&quot;, don't add in any of the ignored spaces.
+                    stopIgnoringSpaces(m_lineMidpointState, InlineIterator(0, m_current.m_obj, m_current.m_pos));
+                    stoppedIgnoringSpaces = true;
+                } else {
+                    // Just keep ignoring these spaces.
+                    nextCharacter(c, lastCharacter, secondToLastCharacter);
+                    continue;
+                }
+            }
+
+            wordMeasurements.grow(wordMeasurements.size() + 1);
+            WordMeasurement&amp; wordMeasurement = wordMeasurements.last();
+
+            wordMeasurement.renderer = renderText;
+            wordMeasurement.endOffset = m_current.m_pos;
+            wordMeasurement.startOffset = lastSpace;
+
+            float additionalTempWidth;
+            if (wordTrailingSpaceWidth &amp;&amp; c == ' ')
+                additionalTempWidth = textWidth(renderText, lastSpace, m_current.m_pos + 1 - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout) - wordTrailingSpaceWidth;
+            else
+                additionalTempWidth = textWidth(renderText, lastSpace, m_current.m_pos - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout);
+
+            if (wordMeasurement.fallbackFonts.isEmpty() &amp;&amp; !fallbackFonts.isEmpty())
+                wordMeasurement.fallbackFonts.swap(fallbackFonts);
+            fallbackFonts.clear();
+
+            wordMeasurement.width = additionalTempWidth + wordSpacingForWordMeasurement;
+            additionalTempWidth += lastSpaceWordSpacing;
+            m_width.addUncommittedWidth(additionalTempWidth);
+
+            if (m_collapseWhiteSpace &amp;&amp; previousCharacterIsSpace &amp;&amp; m_currentCharacterIsSpace &amp;&amp; additionalTempWidth)
+                m_width.setTrailingWhitespaceWidth(additionalTempWidth);
+
+            if (!m_appliedStartWidth) {
+                m_width.addUncommittedWidth(inlineLogicalWidth(m_current.m_obj, true, false));
+                m_appliedStartWidth = true;
+            }
+
+#if ENABLE(CSS_SHAPES)
+            if (m_lastFloatFromPreviousLine)
+                updateSegmentsForShapes(m_block, m_lastFloatFromPreviousLine, wordMeasurements, m_width, m_lineInfo.isFirstLine());
+#endif
+            applyWordSpacing = wordSpacing &amp;&amp; m_currentCharacterIsSpace;
+
+            if (!m_width.committedWidth() &amp;&amp; m_autoWrap &amp;&amp; !m_width.fitsOnLine())
+                m_width.fitBelowFloats();
+
+            if (m_autoWrap || breakWords) {
+                // If we break only after white-space, consider the current character
+                // as candidate width for this line.
+                bool lineWasTooWide = false;
+                if (m_width.fitsOnLine() &amp;&amp; m_currentCharacterIsSpace &amp;&amp; m_currentStyle-&gt;breakOnlyAfterWhiteSpace() &amp;&amp; !midWordBreak) {
+                    float charWidth = textWidth(renderText, m_current.m_pos, 1, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout) + (applyWordSpacing ? wordSpacing : 0);
+                    // Check if line is too big even without the extra space
+                    // at the end of the line. If it is not, do nothing.
+                    // If the line needs the extra whitespace to be too long,
+                    // then move the line break to the space and skip all
+                    // additional whitespace.
+                    if (!m_width.fitsOnLineIncludingExtraWidth(charWidth)) {
+                        lineWasTooWide = true;
+                        m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
+                        m_lineBreaker.skipTrailingWhitespace(m_lineBreak, m_lineInfo);
+                    }
+                }
+                if (lineWasTooWide || !m_width.fitsOnLine()) {
+                    if (canHyphenate &amp;&amp; !m_width.fitsOnLine()) {
+                        tryHyphenating(renderText, font, style.locale(), consecutiveHyphenatedLines, m_blockStyle.hyphenationLimitLines(), style.hyphenationLimitBefore(), style.hyphenationLimitAfter(), lastSpace, m_current.m_pos, m_width.currentWidth() - additionalTempWidth, m_width.availableWidth(), isFixedPitch, m_collapseWhiteSpace, lastSpaceWordSpacing, m_lineBreak, m_current.m_nextBreakablePosition, m_lineBreaker.m_hyphenated);
+                        if (m_lineBreaker.m_hyphenated) {
+                            m_atEnd = true;
+                            return false;
+                        }
+                    }
+                    if (m_lineBreak.atTextParagraphSeparator()) {
+                        if (!stoppedIgnoringSpaces &amp;&amp; m_current.m_pos &gt; 0)
+                            ensureCharacterGetsLineBox(m_lineMidpointState, m_current);
+                        m_lineBreak.increment();
+                        m_lineInfo.setPreviousLineBrokeCleanly(true);
+                        wordMeasurement.endOffset = m_lineBreak.m_pos;
+                    }
+                    if (m_lineBreak.m_obj &amp;&amp; m_lineBreak.m_pos &amp;&amp; m_lineBreak.m_obj-&gt;isText() &amp;&amp; toRenderText(m_lineBreak.m_obj)-&gt;textLength() &amp;&amp; toRenderText(m_lineBreak.m_obj)-&gt;characterAt(m_lineBreak.m_pos - 1) == softHyphen &amp;&amp; style.hyphens() != HyphensNone)
+                        hyphenated = true;
+                    if (m_lineBreak.m_pos &amp;&amp; m_lineBreak.m_pos != (unsigned)wordMeasurement.endOffset &amp;&amp; !wordMeasurement.width) {
+                        if (charWidth) {
+                            wordMeasurement.endOffset = m_lineBreak.m_pos;
+                            wordMeasurement.width = charWidth;
+                        }
+                    }
+                    // Didn't fit. Jump to the end unless there's still an opportunity to collapse whitespace.
+                    if (m_ignoringSpaces || !m_collapseWhiteSpace || !m_currentCharacterIsSpace || !previousCharacterIsSpace) {
+                        m_atEnd = true;
+                        return false;
+                    }
+                } else {
+                    if (!betweenWords || (midWordBreak &amp;&amp; !m_autoWrap))
+                        m_width.addUncommittedWidth(-additionalTempWidth);
+                    if (hyphenWidth) {
+                        // Subtract the width of the soft hyphen out since we fit on a line.
+                        m_width.addUncommittedWidth(-hyphenWidth);
+                        hyphenWidth = 0;
+                    }
+                }
+            }
+
+            if (c == '\n' &amp;&amp; m_preservesNewline) {
+                if (!stoppedIgnoringSpaces &amp;&amp; m_current.m_pos &gt; 0)
+                    ensureCharacterGetsLineBox(m_lineMidpointState, m_current);
+                m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
+                m_lineBreak.increment();
+                m_lineInfo.setPreviousLineBrokeCleanly(true);
+                return true;
+            }
+
+            if (m_autoWrap &amp;&amp; betweenWords) {
+                m_width.commit();
+                wrapW = 0;
+                m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
+                // Auto-wrapping text should not wrap in the middle of a word once it has had an
+                // opportunity to break after a word.
+                breakWords = false;
+            }
+
+            if (midWordBreak &amp;&amp; !U16_IS_TRAIL(c) &amp;&amp; !(U_GET_GC_MASK(c) &amp; U_GC_M_MASK)) {
+                // Remember this as a breakable position in case
+                // adding the end width forces a break.
+                m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
+                midWordBreak &amp;= (breakWords || breakAll);
+            }
+
+            if (betweenWords) {
+                lastSpaceWordSpacing = applyWordSpacing ? wordSpacing : 0;
+                wordSpacingForWordMeasurement = (applyWordSpacing &amp;&amp; wordMeasurement.width) ? wordSpacing : 0;
+                lastSpace = m_current.m_pos;
+            }
+
+            if (!m_ignoringSpaces &amp;&amp; m_currentStyle-&gt;collapseWhiteSpace()) {
+                // If we encounter a newline, or if we encounter a
+                // second space, we need to go ahead and break up this
+                // run and enter a mode where we start collapsing spaces.
+                if (m_currentCharacterIsSpace &amp;&amp; previousCharacterIsSpace) {
+                    m_ignoringSpaces = true;
+
+                    // We just entered a mode where we are ignoring
+                    // spaces. Create a midpoint to terminate the run
+                    // before the second space.
+                    startIgnoringSpaces(m_lineMidpointState, m_startOfIgnoredSpaces);
+                    m_trailingObjects.updateMidpointsForTrailingBoxes(m_lineMidpointState, InlineIterator(), TrailingObjects::DoNotCollapseFirstSpace);
+                }
+            }
+        } else if (m_ignoringSpaces) {
+            // Stop ignoring spaces and begin at this
+            // new point.
+            m_ignoringSpaces = false;
+            lastSpaceWordSpacing = applyWordSpacing ? wordSpacing : 0;
+            wordSpacingForWordMeasurement = (applyWordSpacing &amp;&amp; wordMeasurements.last().width) ? wordSpacing : 0;
+            lastSpace = m_current.m_pos; // e.g., &quot;Foo    goo&quot;, don't add in any of the ignored spaces.
+            stopIgnoringSpaces(m_lineMidpointState, InlineIterator(0, m_current.m_obj, m_current.m_pos));
+        }
+#if ENABLE(SVG)
+        if (isSVGText &amp;&amp; m_current.m_pos &gt; 0) {
+            // Force creation of new InlineBoxes for each absolute positioned character (those that start new text chunks).
+            if (toRenderSVGInlineText(renderText)-&gt;characterStartsNewTextChunk(m_current.m_pos))
+                ensureCharacterGetsLineBox(m_lineMidpointState, m_current);
+        }
+#endif
+
+        if (m_currentCharacterIsSpace &amp;&amp; !previousCharacterIsSpace) {
+            m_startOfIgnoredSpaces.m_obj = m_current.m_obj;
+            m_startOfIgnoredSpaces.m_pos = m_current.m_pos;
+            // Spaces after right-aligned text and before a line-break get collapsed away completely so that the trailing
+            // space doesn't seem to push the text out from the right-hand edge.
+            // FIXME: Do this regardless of the container's alignment - will require rebaselining a lot of test results.
+            if (m_nextObject &amp;&amp; m_nextObject-&gt;isBR() &amp;&amp; (m_blockStyle.textAlign() == RIGHT || m_blockStyle.textAlign() == WEBKIT_RIGHT)) {
+                m_startOfIgnoredSpaces.m_pos--;
+                // If there's just a single trailing space start ignoring it now so it collapses away.
+                if (m_current.m_pos == renderText-&gt;textLength() - 1)
+                    startIgnoringSpaces(m_lineMidpointState, m_startOfIgnoredSpaces);
+            }
+        }
+
+        if (!m_currentCharacterIsSpace &amp;&amp; previousCharacterIsWS) {
+            if (m_autoWrap &amp;&amp; m_currentStyle-&gt;breakOnlyAfterWhiteSpace())
+                m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos, m_current.m_nextBreakablePosition);
+        }
+
+        if (m_collapseWhiteSpace &amp;&amp; m_currentCharacterIsSpace &amp;&amp; !m_ignoringSpaces)
+            m_trailingObjects.setTrailingWhitespace(toRenderText(m_current.m_obj));
+        else if (!m_currentStyle-&gt;collapseWhiteSpace() || !m_currentCharacterIsSpace)
+            m_trailingObjects.clear();
+
+        m_atStart = false;
+        nextCharacter(c, lastCharacter, secondToLastCharacter);
+    }
+
+    m_renderTextInfo.m_lineBreakIterator.setPriorContext(lastCharacter, secondToLastCharacter);
+
+    wordMeasurements.grow(wordMeasurements.size() + 1);
+    WordMeasurement&amp; wordMeasurement = wordMeasurements.last();
+    wordMeasurement.renderer = renderText;
+
+    // IMPORTANT: current.m_pos is &gt; length here!
+    float additionalTempWidth = m_ignoringSpaces ? 0 : textWidth(renderText, lastSpace, m_current.m_pos - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout);
+    wordMeasurement.startOffset = lastSpace;
+    wordMeasurement.endOffset = m_current.m_pos;
+    wordMeasurement.width = m_ignoringSpaces ? 0 : additionalTempWidth + wordSpacingForWordMeasurement;
+    additionalTempWidth += lastSpaceWordSpacing;
+
+    float inlineLogicalTempWidth = inlineLogicalWidth(m_current.m_obj, !m_appliedStartWidth, m_includeEndWidth);
+    m_width.addUncommittedWidth(additionalTempWidth + inlineLogicalTempWidth);
+
+    if (wordMeasurement.fallbackFonts.isEmpty() &amp;&amp; !fallbackFonts.isEmpty())
+        wordMeasurement.fallbackFonts.swap(fallbackFonts);
+    fallbackFonts.clear();
+
+    if (m_collapseWhiteSpace &amp;&amp; m_currentCharacterIsSpace &amp;&amp; additionalTempWidth)
+        m_width.setTrailingWhitespaceWidth(additionalTempWidth, inlineLogicalTempWidth);
+
+    m_includeEndWidth = false;
+
+    if (!m_width.fitsOnLine()) {
+        if (canHyphenate)
+            tryHyphenating(renderText, font, style.locale(), consecutiveHyphenatedLines, m_blockStyle.hyphenationLimitLines(), style.hyphenationLimitBefore(), style.hyphenationLimitAfter(), lastSpace, m_current.m_pos, m_width.currentWidth() - additionalTempWidth, m_width.availableWidth(), isFixedPitch, m_collapseWhiteSpace, lastSpaceWordSpacing, m_lineBreak, m_current.m_nextBreakablePosition, m_lineBreaker.m_hyphenated);
+
+        if (!hyphenated &amp;&amp; m_lineBreak.previousInSameNode() == softHyphen &amp;&amp; style.hyphens() != HyphensNone) {
+            hyphenated = true;
+            m_atEnd = true;
+        }
+    }
+    return false;
+}
+
+inline bool textBeginsWithBreakablePosition(RenderObject* next)
+{
+    ASSERT(next-&gt;isText());
+    RenderText* nextText = toRenderText(next);
+    if (!nextText-&gt;textLength())
+        return false;
+    UChar c = nextText-&gt;characterAt(0);
+    return c == ' ' || c == '\t' || (c == '\n' &amp;&amp; !nextText-&gt;preservesNewline());
+}
+
+inline bool BreakingContext::canBreakAtThisPosition()
+{
+    // If we are no-wrap and have found a line-breaking opportunity already then we should take it.
+    if (m_width.committedWidth() &amp;&amp; !m_width.fitsOnLine(m_currentCharacterIsSpace) &amp;&amp; m_currWS == NOWRAP)
+        return true;
+
+    // Avoid breaking before empty inlines.
+    if (m_nextObject &amp;&amp; m_nextObject-&gt;isRenderInline() &amp;&amp; isEmptyInline(toRenderInline(*m_nextObject)))
+        return false;
+
+    // Return early if we autowrap and the current character is a space as we will always want to break at such a position.
+    if (m_autoWrap &amp;&amp; m_currentCharacterIsSpace)
+        return true;
+
+    if (m_nextObject &amp;&amp; m_nextObject-&gt;isLineBreakOpportunity())
+        return m_autoWrap;
+
+    bool nextIsAutoWrappingText = (m_nextObject &amp;&amp; m_nextObject-&gt;isText() &amp;&amp; (m_autoWrap || m_nextObject-&gt;style().autoWrap()));
+    if (!nextIsAutoWrappingText)
+        return m_autoWrap;
+    bool currentIsTextOrEmptyInline = m_current.m_obj-&gt;isText() || (m_current.m_obj-&gt;isRenderInline() &amp;&amp; isEmptyInline(toRenderInline(*m_current.m_obj)));
+    if (!currentIsTextOrEmptyInline)
+        return m_autoWrap;
+
+    bool canBreakHere = !m_currentCharacterIsSpace &amp;&amp; textBeginsWithBreakablePosition(m_nextObject);
+
+    // See if attempting to fit below floats creates more available width on the line.
+    if (!m_width.fitsOnLine() &amp;&amp; !m_width.committedWidth())
+        m_width.fitBelowFloats();
+
+    bool canPlaceOnLine = m_width.fitsOnLine() || !m_autoWrapWasEverTrueOnLine;
+
+    if (canPlaceOnLine &amp;&amp; canBreakHere)
+        commitLineBreakAtCurrentWidth(m_nextObject);
+
+    return canBreakHere;
+}
+
+inline void BreakingContext::commitAndUpdateLineBreakIfNeeded()
+{
+    bool checkForBreak = canBreakAtThisPosition();
+
+    if (checkForBreak &amp;&amp; !m_width.fitsOnLine(m_ignoringSpaces)) {
+        // if we have floats, try to get below them.
+        if (m_currentCharacterIsSpace &amp;&amp; !m_ignoringSpaces &amp;&amp; m_currentStyle-&gt;collapseWhiteSpace())
+            m_trailingObjects.clear();
+
+        if (m_width.committedWidth()) {
+            m_atEnd = true;
+            return;
+        }
+
+        m_width.fitBelowFloats();
+
+        // |width| may have been adjusted because we got shoved down past a float (thus
+        // giving us more room), so we need to retest, and only jump to
+        // the end label if we still don't fit on the line. -dwh
+        if (!m_width.fitsOnLine(m_ignoringSpaces)) {
+            m_atEnd = true;
+            return;
+        }
+    } else if (m_blockStyle.autoWrap() &amp;&amp; !m_width.fitsOnLine() &amp;&amp; !m_width.committedWidth()) {
+        // If the container autowraps but the current child does not then we still need to ensure that it
+        // wraps and moves below any floats.
+        m_width.fitBelowFloats();
+    }
+
+    if (!m_current.m_obj-&gt;isFloatingOrOutOfFlowPositioned()) {
+        m_lastObject = m_current.m_obj;
+        if (m_lastObject-&gt;isReplaced() &amp;&amp; m_autoWrap &amp;&amp; (!m_lastObject-&gt;isImage() || m_allowImagesToBreak) &amp;&amp; (!m_lastObject-&gt;isListMarker() || toRenderListMarker(*m_lastObject).isInside())) {
+            m_width.commit();
+            m_lineBreak.moveToStartOf(m_nextObject);
+        }
+    }
+}
+
+inline void checkMidpoints(LineMidpointState&amp; lineMidpointState, InlineIterator&amp; lBreak)
+{
+    // Check to see if our last midpoint is a start point beyond the line break. If so,
+    // shave it off the list, and shave off a trailing space if the previous end point doesn't
+    // preserve whitespace.
+    if (lBreak.m_obj &amp;&amp; lineMidpointState.numMidpoints &amp;&amp; !(lineMidpointState.numMidpoints % 2)) {
+        InlineIterator* midpoints = lineMidpointState.midpoints.data();
+        InlineIterator&amp; endpoint = midpoints[lineMidpointState.numMidpoints - 2];
+        const InlineIterator&amp; startpoint = midpoints[lineMidpointState.numMidpoints - 1];
+        InlineIterator currpoint = endpoint;
+        while (!currpoint.atEnd() &amp;&amp; currpoint != startpoint &amp;&amp; currpoint != lBreak)
+            currpoint.increment();
+        if (currpoint == lBreak) {
+            // We hit the line break before the start point. Shave off the start point.
+            lineMidpointState.numMidpoints--;
+            if (endpoint.m_obj-&gt;style().collapseWhiteSpace() &amp;&amp; endpoint.m_obj-&gt;isText())
+                endpoint.m_pos--;
+        }
+    }
+}
+
+InlineIterator BreakingContext::handleEndOfLine()
+{
+#if ENABLE(CSS_SHAPES)
+    ShapeInsideInfo* shapeInfo = m_block.layoutShapeInsideInfo();
+    bool segmentAllowsOverflow = !shapeInfo || !shapeInfo-&gt;hasSegments();
+#else
+    bool segmentAllowsOverflow = true;
+#endif
+    if (segmentAllowsOverflow) {
+        if (m_lineBreak == m_resolver.position()) {
+            if (!m_lineBreak.m_obj || !m_lineBreak.m_obj-&gt;isBR()) {
+                // we just add as much as possible
+                if (m_blockStyle.whiteSpace() == PRE &amp;&amp; !m_current.m_pos) {
+                    m_lineBreak.moveTo(m_lastObject, m_lastObject-&gt;isText() ? m_lastObject-&gt;length() : 0);
+                } else if (m_lineBreak.m_obj) {
+                    // Don't ever break in the middle of a word if we can help it.
+                    // There's no room at all. We just have to be on this line,
+                    // even though we'll spill out.
+                    m_lineBreak.moveTo(m_current.m_obj, m_current.m_pos);
+                }
+            }
+            // make sure we consume at least one char/object.
+            if (m_lineBreak == m_resolver.position())
+                m_lineBreak.increment();
+        } else if (!m_current.m_pos &amp;&amp; !m_width.committedWidth() &amp;&amp; m_width.uncommittedWidth() &amp;&amp; !m_hadUncommittedWidthBeforeCurrent) {
+            // Do not push the current object to the next line, when this line has some content, but it is still considered empty.
+            // Empty inline elements like &lt;span&gt;&lt;/span&gt; can produce such lines and now we just ignore these break opportunities
+            // at the start of a line, if no width has been committed yet.
+            // Behave as if it was actually empty and consume at least one object.
+            m_lineBreak.increment();
+        }
+    }
+
+    // Sanity check our midpoints.
+    checkMidpoints(m_lineMidpointState, m_lineBreak);
+
+    m_trailingObjects.updateMidpointsForTrailingBoxes(m_lineMidpointState, m_lineBreak, TrailingObjects::CollapseFirstSpace);
+
+    // We might have made lineBreak an iterator that points past the end
+    // of the object. Do this adjustment to make it point to the start
+    // of the next object instead to avoid confusing the rest of the
+    // code.
+    if (m_lineBreak.m_pos &gt; 0) {
+        m_lineBreak.m_pos--;
+        m_lineBreak.increment();
+    }
+
+    return m_lineBreak;
+}
+
+}
+
+#endif // BreakingContextInlineHeaders_h
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineBreakercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/line/LineBreaker.cpp (0 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineBreaker.cpp                                (rev 0)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.cpp        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+/*
+ * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 ChangSeok Oh &lt;shivamidow@gmail.com&gt;
+ * Copyright (C) 2013 Adobe Systems Inc. All right reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include &quot;config.h&quot;
+#include &quot;LineBreaker.h&quot;
+
+#include &quot;RenderCombineText.h&quot;
+
+namespace WebCore {
+
+void LineBreaker::reset()
+{
+    m_positionedObjects.clear();
+    m_hyphenated = false;
+    m_clear = CNONE;
+}
+
+// FIXME: The entire concept of the skipTrailingWhitespace function is flawed, since we really need to be building
+// line boxes even for containers that may ultimately collapse away. Otherwise we'll never get positioned
+// elements quite right. In other words, we need to build this function's work into the normal line
+// object iteration process.
+// NB. this function will insert any floating elements that would otherwise
+// be skipped but it will not position them.
+void LineBreaker::skipTrailingWhitespace(InlineIterator&amp; iterator, const LineInfo&amp; lineInfo)
+{
+    while (!iterator.atEnd() &amp;&amp; !requiresLineBox(iterator, lineInfo, TrailingWhitespace)) {
+        RenderObject&amp; object = *iterator.m_obj;
+        if (object.isOutOfFlowPositioned())
+            setStaticPositions(m_block, toRenderBox(object));
+        else if (object.isFloating())
+            m_block.insertFloatingObject(toRenderBox(object));
+        iterator.increment();
+    }
+}
+
+void LineBreaker::skipLeadingWhitespace(InlineBidiResolver&amp; resolver, LineInfo&amp; lineInfo, FloatingObject* lastFloatFromPreviousLine, LineWidth&amp; width)
+{
+    while (!resolver.position().atEnd() &amp;&amp; !requiresLineBox(resolver.position(), lineInfo, LeadingWhitespace)) {
+        RenderObject&amp; object = *resolver.position().m_obj;
+        if (object.isOutOfFlowPositioned()) {
+            setStaticPositions(m_block, toRenderBox(object));
+            if (object.style().isOriginalDisplayInlineType()) {
+                resolver.runs().addRun(new BidiRun(0, 1, object, resolver.context(), resolver.dir()));
+                lineInfo.incrementRunsFromLeadingWhitespace();
+            }
+        } else if (object.isFloating()) {
+            // The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
+            // so in order to place this first child float at the top content edge of the self-collapsing block add the margin back in before placement.
+            LayoutUnit marginOffset = (!object.previousSibling() &amp;&amp; m_block.isSelfCollapsingBlock() &amp;&amp; m_block.style().clear() &amp;&amp; m_block.getClearDelta(m_block, LayoutUnit())) ? m_block.collapsedMarginBeforeForChild(m_block) : LayoutUnit();
+            LayoutUnit oldLogicalHeight = m_block.logicalHeight();
+            m_block.setLogicalHeight(oldLogicalHeight + marginOffset);
+            m_block.positionNewFloatOnLine(m_block.insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width);
+            m_block.setLogicalHeight(oldLogicalHeight);
+        } else if (object.isText() &amp;&amp; object.style().hasTextCombine() &amp;&amp; object.isCombineText() &amp;&amp; !toRenderCombineText(object).isCombined()) {
+            toRenderCombineText(object).combineText();
+            if (toRenderCombineText(object).isCombined())
+                continue;
+        }
+        resolver.increment();
+    }
+    resolver.commitExplicitEmbedding();
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineBreakerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/line/LineBreaker.h (0 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineBreaker.h                                (rev 0)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.h        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 ChangSeok Oh &lt;shivamidow@gmail.com&gt;
+ * Copyright (C) 2013 Adobe Systems Inc. All right reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef LineBreaker_h
+#define LineBreaker_h
+
+#include &quot;InlineIterator.h&quot;
+#include &quot;LineInfo.h&quot;
+#include &quot;LineInlineHeaders.h&quot;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+
+class RenderText;
+
+struct RenderTextInfo {
+    // Destruction of m_layout requires TextLayout to be a complete type, so the constructor and destructor are made non-inline to avoid compilation errors.
+    RenderTextInfo();
+    ~RenderTextInfo();
+
+    RenderText* m_text;
+    OwnPtr&lt;TextLayout&gt; m_layout;
+    LazyLineBreakIterator m_lineBreakIterator;
+    const Font* m_font;
+};
+
+class LineBreaker {
+public:
+    friend class BreakingContext;
+    LineBreaker(RenderBlockFlow&amp; block)
+        : m_block(block)
+    {
+        reset();
+    }
+
+    InlineIterator nextLineBreak(InlineBidiResolver&amp;, LineInfo&amp;, RenderTextInfo&amp;, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&amp;);
+
+    bool lineWasHyphenated() { return m_hyphenated; }
+    const Vector&lt;RenderBox*&gt;&amp; positionedObjects() { return m_positionedObjects; }
+    EClear clear() { return m_clear; }
+
+private:
+    void reset();
+
+    InlineIterator nextSegmentBreak(InlineBidiResolver&amp;, LineInfo&amp;, RenderTextInfo&amp;, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&amp;);
+    void skipTrailingWhitespace(InlineIterator&amp;, const LineInfo&amp;);
+    void skipLeadingWhitespace(InlineBidiResolver&amp;, LineInfo&amp;, FloatingObject* lastFloatFromPreviousLine, LineWidth&amp;);
+
+    RenderBlockFlow&amp; m_block;
+    bool m_hyphenated;
+    EClear m_clear;
+    Vector&lt;RenderBox*&gt; m_positionedObjects;
+};
+
+}
+
+#endif // LineBreaker_h
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineInfocpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/line/LineInfo.cpp (0 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineInfo.cpp                                (rev 0)
+++ trunk/Source/WebCore/rendering/line/LineInfo.cpp        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;LineInfo.h&quot;
+
+#include &quot;RenderBlock.h&quot;
+
+namespace WebCore {
+
+void LineInfo::setEmpty(bool empty, RenderBlock* block, LineWidth* lineWidth)
+{
+    if (m_isEmpty == empty)
+        return;
+    m_isEmpty = empty;
+    if (!empty &amp;&amp; block &amp;&amp; floatPaginationStrut()) {
+        block-&gt;setLogicalHeight(block-&gt;logicalHeight() + floatPaginationStrut());
+        setFloatPaginationStrut(0);
+        lineWidth-&gt;updateAvailableWidth();
+    }
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineInfohfromrev159353trunkSourceWebCorerenderingLineInfoh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/rendering/line/LineInfo.h (from rev 159353, trunk/Source/WebCore/rendering/LineInfo.h) (0 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineInfo.h                                (rev 0)
+++ trunk/Source/WebCore/rendering/line/LineInfo.h        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LineInfo_h
+#define LineInfo_h
+
+#include &quot;LineWidth.h&quot;
+
+namespace WebCore {
+
+class RenderBlock;
+
+class LineInfo {
+public:
+    LineInfo()
+        : m_isFirstLine(true)
+        , m_isLastLine(false)
+        , m_isEmpty(true)
+        , m_previousLineBrokeCleanly(true)
+        , m_floatPaginationStrut(0)
+        , m_runsFromLeadingWhitespace(0)
+    { }
+
+    bool isFirstLine() const { return m_isFirstLine; }
+    bool isLastLine() const { return m_isLastLine; }
+    bool isEmpty() const { return m_isEmpty; }
+    bool previousLineBrokeCleanly() const { return m_previousLineBrokeCleanly; }
+    LayoutUnit floatPaginationStrut() const { return m_floatPaginationStrut; }
+    unsigned runsFromLeadingWhitespace() const { return m_runsFromLeadingWhitespace; }
+    void resetRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace = 0; }
+    void incrementRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace++; }
+
+    void setFirstLine(bool firstLine) { m_isFirstLine = firstLine; }
+    void setLastLine(bool lastLine) { m_isLastLine = lastLine; }
+    void setEmpty(bool empty, RenderBlock* block = 0, LineWidth* lineWidth = 0);
+    void setPreviousLineBrokeCleanly(bool previousLineBrokeCleanly) { m_previousLineBrokeCleanly = previousLineBrokeCleanly; }
+    void setFloatPaginationStrut(LayoutUnit strut) { m_floatPaginationStrut = strut; }
+
+private:
+    bool m_isFirstLine;
+    bool m_isLastLine;
+    bool m_isEmpty;
+    bool m_previousLineBrokeCleanly;
+    LayoutUnit m_floatPaginationStrut;
+    unsigned m_runsFromLeadingWhitespace;
+};
+
+}
+
+#endif // LineInfo_h
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineInlineHeadersh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/line/LineInlineHeaders.h (0 => 159354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineInlineHeaders.h                                (rev 0)
+++ trunk/Source/WebCore/rendering/line/LineInlineHeaders.h        2013-11-15 21:40:59 UTC (rev 159354)
</span><span class="lines">@@ -0,0 +1,142 @@
</span><ins>+/*
+ * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 ChangSeok Oh &lt;shivamidow@gmail.com&gt;
+ * Copyright (C) 2013 Adobe Systems Inc. All right reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef LineInlineHeaders_h
+#define LineInlineHeaders_h
+
+#include &quot;RenderLayer.h&quot;
+
+namespace WebCore {
+
+enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace };
+
+inline bool hasInlineDirectionBordersPaddingOrMargin(const RenderInline&amp; flow)
+{
+    // Where an empty inline is split across anonymous blocks we should only give lineboxes to the 'sides' of the
+    // inline that have borders, padding or margin.
+    bool shouldApplyStartBorderPaddingOrMargin = !flow.parent()-&gt;isAnonymousBlock() || !flow.isInlineElementContinuation();
+    if (shouldApplyStartBorderPaddingOrMargin &amp;&amp; (flow.borderStart() || flow.marginStart() || flow.paddingStart()))
+        return true;
+
+    bool shouldApplyEndBorderPaddingOrMargin = !flow.parent()-&gt;isAnonymousBlock() || flow.isInlineElementContinuation() || !flow.inlineElementContinuation();
+    return shouldApplyEndBorderPaddingOrMargin &amp;&amp; (flow.borderEnd() || flow.marginEnd() || flow.paddingEnd());
+}
+
+inline const RenderStyle&amp; lineStyle(const RenderElement&amp; renderer, const LineInfo&amp; lineInfo)
+{
+    return lineInfo.isFirstLine() ? renderer.firstLineStyle() : renderer.style();
+}
+
+inline bool requiresLineBoxForContent(const RenderInline&amp; flow, const LineInfo&amp; lineInfo)
+{
+    RenderElement* parent = flow.parent();
+    if (flow.document().inNoQuirksMode()) {
+        const RenderStyle&amp; flowStyle = lineStyle(flow, lineInfo);
+        const RenderStyle&amp; parentStyle = lineStyle(*parent, lineInfo);
+        if (flowStyle.lineHeight() != parentStyle.lineHeight()
+            || flowStyle.verticalAlign() != parentStyle.verticalAlign()
+            || !parentStyle.font().fontMetrics().hasIdenticalAscentDescentAndLineGap(flowStyle.font().fontMetrics()))
+        return true;
+    }
+    return false;
+}
+
+inline bool shouldCollapseWhiteSpace(const RenderStyle* style, const LineInfo&amp; lineInfo, WhitespacePosition whitespacePosition)
+{
+    // CSS2 16.6.1
+    // If a space (U+0020) at the beginning of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is removed.
+    // If a space (U+0020) at the end of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is also removed.
+    // If spaces (U+0020) or tabs (U+0009) at the end of a line have 'white-space' set to 'pre-wrap', UAs may visually collapse them.
+    return style-&gt;collapseWhiteSpace()
+        || (whitespacePosition == TrailingWhitespace &amp;&amp; style-&gt;whiteSpace() == PRE_WRAP &amp;&amp; (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
+}
+
+inline bool skipNonBreakingSpace(const InlineIterator&amp; it, const LineInfo&amp; lineInfo)
+{
+    if (it.m_obj-&gt;style().nbspMode() != SPACE || it.current() != noBreakSpace)
+        return false;
+
+    // FIXME: This is bad. It makes nbsp inconsistent with space and won't work correctly
+    // with m_minWidth/m_maxWidth.
+    // Do not skip a non-breaking space if it is the first character
+    // on a line after a clean line break (or on the first line, since previousLineBrokeCleanly starts off
+    // |true|).
+    if (lineInfo.isEmpty() &amp;&amp; lineInfo.previousLineBrokeCleanly())
+        return false;
+
+    return true;
+}
+
+inline bool alwaysRequiresLineBox(const RenderInline&amp; flow)
+{
+    // FIXME: Right now, we only allow line boxes for inlines that are truly empty.
+    // We need to fix this, though, because at the very least, inlines containing only
+    // ignorable whitespace should should also have line boxes.
+    return isEmptyInline(flow) &amp;&amp; hasInlineDirectionBordersPaddingOrMargin(flow);
+}
+
+inline bool requiresLineBox(const InlineIterator&amp; it, const LineInfo&amp; lineInfo = LineInfo(), WhitespacePosition whitespacePosition = LeadingWhitespace)
+{
+    if (it.m_obj-&gt;isFloatingOrOutOfFlowPositioned())
+        return false;
+
+    if (it.m_obj-&gt;isBR())
+        return true;
+
+    bool rendererIsEmptyInline = false;
+    if (it.m_obj-&gt;isRenderInline()) {
+        const RenderInline&amp; inlineRenderer = toRenderInline(*it.m_obj);
+        if (!alwaysRequiresLineBox(inlineRenderer) &amp;&amp; !requiresLineBoxForContent(inlineRenderer, lineInfo))
+            return false;
+        rendererIsEmptyInline = isEmptyInline(inlineRenderer);
+    }
+
+    if (!shouldCollapseWhiteSpace(&amp;it.m_obj-&gt;style(), lineInfo, whitespacePosition))
+        return true;
+
+    UChar current = it.current();
+    bool notJustWhitespace = current != ' ' &amp;&amp; current != '\t' &amp;&amp; current != softHyphen &amp;&amp; (current != '\n' || it.m_obj-&gt;preservesNewline()) &amp;&amp; !skipNonBreakingSpace(it, lineInfo);
+    return notJustWhitespace || rendererIsEmptyInline;
+}
+
+inline void setStaticPositions(RenderBlockFlow&amp; block, RenderBox&amp; child)
+{
+    // FIXME: The math here is actually not really right. It's a best-guess approximation that
+    // will work for the common cases
+    RenderElement* containerBlock = child.container();
+    LayoutUnit blockHeight = block.logicalHeight();
+    if (containerBlock-&gt;isRenderInline()) {
+        // A relative positioned inline encloses us. In this case, we also have to determine our
+        // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned
+        // inline so that we can obtain the value later.
+        toRenderInline(containerBlock)-&gt;layer()-&gt;setStaticInlinePosition(block.startAlignedOffsetForLine(blockHeight, false));
+        toRenderInline(containerBlock)-&gt;layer()-&gt;setStaticBlockPosition(blockHeight);
+    }
+    block.updateStaticInlinePositionForChild(child, blockHeight);
+    child.layer()-&gt;setStaticBlockPosition(blockHeight);
+}
+
+}
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>