<!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>[169593] 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/169593">169593</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-06-04 13:42:33 -0700 (Wed, 04 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use references instead of pointers for non-optional arguments during text layout
https://bugs.webkit.org/show_bug.cgi?id=133501

Patch by Myles C. Maxfield &lt;litherum@gmail.com&gt; on 2014-06-04
Reviewed by Tim Horton.

This patch applies some cleanup to InlineBox layout functions to take
references instead of pointers where appropriate.

No new tests are necessary because there is no behavior change.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::computeLogicalBoxHeights): Make the function take a
reference to the RootInlineBox instead of a pointer. This function does some
rounding.
(WebCore::InlineFlowBox::addTextBoxVisualOverflow): Make the function take a
reference to the InlineTextBox instead of a pointer.
(WebCore::InlineFlowBox::computeOverflow): Update call to addTextBoxVisualOverflow
to pass a reference instead of a pointer.
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::alignBoxesInBlockDirection): Update call to
computeLogicalBoxHeights to pass a reference instead of a pointer.
(WebCore::RootInlineBox::ascentAndDescentForBox): Make the function take a
reference to the InlineBox instead of a pointer.
(WebCore::RootInlineBox::includeLeadingForBox): Make the function take a reference
instead of a pointer.
(WebCore::RootInlineBox::includeFontForBox): Ditto.
(WebCore::RootInlineBox::includeGlyphsForBox): Ditto.
(WebCore::RootInlineBox::includeMarginForBox): Ditto.
* rendering/RootInlineBox.h: Move functions that are not externally called into
a private: section. In addition, update function signatures to take references
instead of pointers.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineFlowBoxcpp">trunk/Source/WebCore/rendering/InlineFlowBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineFlowBoxh">trunk/Source/WebCore/rendering/InlineFlowBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRootInlineBoxcpp">trunk/Source/WebCore/rendering/RootInlineBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRootInlineBoxh">trunk/Source/WebCore/rendering/RootInlineBox.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169592 => 169593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-04 20:25:11 UTC (rev 169592)
+++ trunk/Source/WebCore/ChangeLog        2014-06-04 20:42:33 UTC (rev 169593)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2014-06-04  Myles C. Maxfield  &lt;litherum@gmail.com&gt;
+
+        Use references instead of pointers for non-optional arguments during text layout
+        https://bugs.webkit.org/show_bug.cgi?id=133501
+
+        Reviewed by Tim Horton.
+
+        This patch applies some cleanup to InlineBox layout functions to take
+        references instead of pointers where appropriate.
+
+        No new tests are necessary because there is no behavior change.
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::computeLogicalBoxHeights): Make the function take a
+        reference to the RootInlineBox instead of a pointer. This function does some
+        rounding.
+        (WebCore::InlineFlowBox::addTextBoxVisualOverflow): Make the function take a
+        reference to the InlineTextBox instead of a pointer.
+        (WebCore::InlineFlowBox::computeOverflow): Update call to addTextBoxVisualOverflow
+        to pass a reference instead of a pointer.
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::alignBoxesInBlockDirection): Update call to
+        computeLogicalBoxHeights to pass a reference instead of a pointer.
+        (WebCore::RootInlineBox::ascentAndDescentForBox): Make the function take a
+        reference to the InlineBox instead of a pointer.
+        (WebCore::RootInlineBox::includeLeadingForBox): Make the function take a reference
+        instead of a pointer.
+        (WebCore::RootInlineBox::includeFontForBox): Ditto.
+        (WebCore::RootInlineBox::includeGlyphsForBox): Ditto.
+        (WebCore::RootInlineBox::includeMarginForBox): Ditto.
+        * rendering/RootInlineBox.h: Move functions that are not externally called into
+        a private: section. In addition, update function signatures to take references
+        instead of pointers.
+
</ins><span class="cx"> 2014-05-27  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Lists styled with SVG fonts are not rendered as expected
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineFlowBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (169592 => 169593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2014-06-04 20:25:11 UTC (rev 169592)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2014-06-04 20:42:33 UTC (rev 169593)
</span><span class="lines">@@ -518,10 +518,10 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InlineFlowBox::computeLogicalBoxHeights(RootInlineBox* rootBox, LayoutUnit&amp; maxPositionTop, LayoutUnit&amp; maxPositionBottom,
-                                             int&amp; maxAscent, int&amp; maxDescent, bool&amp; setMaxAscent, bool&amp; setMaxDescent,
-                                             bool strictMode, GlyphOverflowAndFallbackFontsMap&amp; textBoxDataMap,
-                                             FontBaseline baselineType, VerticalPositionCache&amp; verticalPositionCache)
</del><ins>+void InlineFlowBox::computeLogicalBoxHeights(RootInlineBox&amp; rootBox, LayoutUnit&amp; maxPositionTop, LayoutUnit&amp; maxPositionBottom,
+    int&amp; maxAscent, int&amp; maxDescent, bool&amp; setMaxAscent, bool&amp; setMaxDescent,
+    bool strictMode, GlyphOverflowAndFallbackFontsMap&amp; textBoxDataMap,
+    FontBaseline baselineType, VerticalPositionCache&amp; verticalPositionCache)
</ins><span class="cx"> {
</span><span class="cx">     // The primary purpose of this function is to compute the maximal ascent and descent values for
</span><span class="cx">     // a line. These values are computed based off the block's line-box-contain property, which indicates
</span><span class="lines">@@ -546,7 +546,7 @@
</span><span class="cx">         // Examine our root box.
</span><span class="cx">         int ascent = 0;
</span><span class="cx">         int descent = 0;
</span><del>-        rootBox-&gt;ascentAndDescentForBox(rootBox, textBoxDataMap, ascent, descent, affectsAscent, affectsDescent);
</del><ins>+        rootBox.ascentAndDescentForBox(rootBox, textBoxDataMap, ascent, descent, affectsAscent, affectsDescent);
</ins><span class="cx">         if (strictMode || hasTextChildren() || (!checkChildren &amp;&amp; hasTextDescendants())) {
</span><span class="cx">             if (maxAscent &lt; ascent || !setMaxAscent) {
</span><span class="cx">                 maxAscent = ascent;
</span><span class="lines">@@ -574,11 +574,11 @@
</span><span class="cx">         // The verticalPositionForBox function returns the distance between the child box's baseline
</span><span class="cx">         // and the root box's baseline.  The value is negative if the child box's baseline is above the
</span><span class="cx">         // root box's baseline, and it is positive if the child box's baseline is below the root box's baseline.
</span><del>-        curr-&gt;setLogicalTop(rootBox-&gt;verticalPositionForBox(curr, verticalPositionCache));
</del><ins>+        curr-&gt;setLogicalTop(rootBox.verticalPositionForBox(curr, verticalPositionCache));
</ins><span class="cx">         
</span><span class="cx">         int ascent = 0;
</span><span class="cx">         int descent = 0;
</span><del>-        rootBox-&gt;ascentAndDescentForBox(curr, textBoxDataMap, ascent, descent, affectsAscent, affectsDescent);
</del><ins>+        rootBox.ascentAndDescentForBox(*curr, textBoxDataMap, ascent, descent, affectsAscent, affectsDescent);
</ins><span class="cx"> 
</span><span class="cx">         LayoutUnit boxHeight = ascent + descent;
</span><span class="cx">         if (curr-&gt;verticalAlign() == TOP &amp;&amp; verticalAlignApplies(curr-&gt;renderer())) {
</span><span class="lines">@@ -616,7 +616,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHeight, int maxAscent, bool strictMode, LayoutUnit&amp; lineTop, LayoutUnit&amp; lineBottom, bool&amp; setLineTop,
</span><del>-                                               LayoutUnit&amp; lineTopIncludingMargins, LayoutUnit&amp; lineBottomIncludingMargins, bool&amp; hasAnnotationsBefore, bool&amp; hasAnnotationsAfter, FontBaseline baselineType)
</del><ins>+    LayoutUnit&amp; lineTopIncludingMargins, LayoutUnit&amp; lineBottomIncludingMargins, bool&amp; hasAnnotationsBefore, bool&amp; hasAnnotationsAfter, FontBaseline baselineType)
</ins><span class="cx"> {
</span><span class="cx">     bool isRootBox = isRootInlineBox();
</span><span class="cx">     if (isRootBox) {
</span><span class="lines">@@ -851,14 +851,14 @@
</span><span class="cx">                                        logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBottomVisualOverflow - logicalTopVisualOverflow);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void InlineFlowBox::addTextBoxVisualOverflow(InlineTextBox* textBox, GlyphOverflowAndFallbackFontsMap&amp; textBoxDataMap, LayoutRect&amp; logicalVisualOverflow)
</del><ins>+inline void InlineFlowBox::addTextBoxVisualOverflow(InlineTextBox&amp; textBox, GlyphOverflowAndFallbackFontsMap&amp; textBoxDataMap, LayoutRect&amp; logicalVisualOverflow)
</ins><span class="cx"> {
</span><del>-    if (textBox-&gt;knownToHaveNoOverflow())
</del><ins>+    if (textBox.knownToHaveNoOverflow())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     const RenderStyle&amp; lineStyle = this-&gt;lineStyle();
</span><span class="cx">     
</span><del>-    GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(textBox);
</del><ins>+    GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(&amp;textBox);
</ins><span class="cx">     GlyphOverflow* glyphOverflow = it == textBoxDataMap.end() ? 0 : &amp;it-&gt;value.second;
</span><span class="cx">     bool isFlippedLine = lineStyle.isFlippedLinesWritingMode();
</span><span class="cx"> 
</span><span class="lines">@@ -874,7 +874,7 @@
</span><span class="cx">     int rightGlyphOverflow = strokeOverflow + rightGlyphEdge;
</span><span class="cx"> 
</span><span class="cx">     bool emphasisMarkIsAbove;
</span><del>-    if (lineStyle.textEmphasisMark() != TextEmphasisMarkNone &amp;&amp; textBox-&gt;emphasisMarkExistsAndIsAbove(lineStyle, emphasisMarkIsAbove)) {
</del><ins>+    if (lineStyle.textEmphasisMark() != TextEmphasisMarkNone &amp;&amp; textBox.emphasisMarkExistsAndIsAbove(lineStyle, emphasisMarkIsAbove)) {
</ins><span class="cx">         int emphasisMarkHeight = lineStyle.font().emphasisMarkHeight(lineStyle.textEmphasisMarkString());
</span><span class="cx">         if (emphasisMarkIsAbove == !lineStyle.isFlippedLinesWritingMode())
</span><span class="cx">             topGlyphOverflow = std::min(topGlyphOverflow, -emphasisMarkHeight);
</span><span class="lines">@@ -900,15 +900,15 @@
</span><span class="cx">     LayoutUnit childOverflowLogicalLeft = std::min&lt;LayoutUnit&gt;(textShadowLogicalLeft + leftGlyphOverflow, leftGlyphOverflow);
</span><span class="cx">     LayoutUnit childOverflowLogicalRight = std::max&lt;LayoutUnit&gt;(textShadowLogicalRight + rightGlyphOverflow, rightGlyphOverflow);
</span><span class="cx"> 
</span><del>-    LayoutUnit logicalTopVisualOverflow = std::min(textBox-&gt;pixelSnappedLogicalTop() + childOverflowLogicalTop, logicalVisualOverflow.y());
-    LayoutUnit logicalBottomVisualOverflow = std::max(textBox-&gt;pixelSnappedLogicalBottom() + childOverflowLogicalBottom, logicalVisualOverflow.maxY());
-    LayoutUnit logicalLeftVisualOverflow = std::min(textBox-&gt;pixelSnappedLogicalLeft() + childOverflowLogicalLeft, logicalVisualOverflow.x());
-    LayoutUnit logicalRightVisualOverflow = std::max(textBox-&gt;pixelSnappedLogicalRight() + childOverflowLogicalRight, logicalVisualOverflow.maxX());
</del><ins>+    LayoutUnit logicalTopVisualOverflow = std::min(textBox.pixelSnappedLogicalTop() + childOverflowLogicalTop, logicalVisualOverflow.y());
+    LayoutUnit logicalBottomVisualOverflow = std::max(textBox.pixelSnappedLogicalBottom() + childOverflowLogicalBottom, logicalVisualOverflow.maxY());
+    LayoutUnit logicalLeftVisualOverflow = std::min(textBox.pixelSnappedLogicalLeft() + childOverflowLogicalLeft, logicalVisualOverflow.x());
+    LayoutUnit logicalRightVisualOverflow = std::max(textBox.pixelSnappedLogicalRight() + childOverflowLogicalRight, logicalVisualOverflow.maxX());
</ins><span class="cx">     
</span><span class="cx">     logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow,
</span><span class="cx">                                        logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBottomVisualOverflow - logicalTopVisualOverflow);
</span><span class="cx">                                     
</span><del>-    textBox-&gt;setLogicalOverflowRect(logicalVisualOverflow);
</del><ins>+    textBox.setLogicalOverflowRect(logicalVisualOverflow);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void InlineFlowBox::addReplacedChildOverflow(const InlineBox* inlineBox, LayoutRect&amp; logicalLayoutOverflow, LayoutRect&amp; logicalVisualOverflow)
</span><span class="lines">@@ -959,7 +959,7 @@
</span><span class="cx">         if (curr-&gt;renderer().isText()) {
</span><span class="cx">             InlineTextBox* text = toInlineTextBox(curr);
</span><span class="cx">             LayoutRect textBoxOverflow(enclosingLayoutRect(text-&gt;logicalFrameRect()));
</span><del>-            addTextBoxVisualOverflow(text, textBoxDataMap, textBoxOverflow);
</del><ins>+            addTextBoxVisualOverflow(*text, textBoxDataMap, textBoxOverflow);
</ins><span class="cx">             logicalVisualOverflow.unite(textBoxOverflow);
</span><span class="cx">         } else if (curr-&gt;renderer().isRenderInline()) {
</span><span class="cx">             InlineFlowBox* flow = toInlineFlowBox(curr);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineFlowBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (169592 => 169593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineFlowBox.h        2014-06-04 20:25:11 UTC (rev 169592)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h        2014-06-04 20:42:33 UTC (rev 169593)
</span><span class="lines">@@ -186,13 +186,13 @@
</span><span class="cx">             clearKnownToHaveNoOverflow();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void computeLogicalBoxHeights(RootInlineBox*, LayoutUnit&amp; maxPositionTop, LayoutUnit&amp; maxPositionBottom,
-                                  int&amp; maxAscent, int&amp; maxDescent, bool&amp; setMaxAscent, bool&amp; setMaxDescent,
-                                  bool strictMode, GlyphOverflowAndFallbackFontsMap&amp;, FontBaseline, VerticalPositionCache&amp;);
</del><ins>+    void computeLogicalBoxHeights(RootInlineBox&amp;, LayoutUnit&amp; maxPositionTop, LayoutUnit&amp; maxPositionBottom,
+        int&amp; maxAscent, int&amp; maxDescent, bool&amp; setMaxAscent, bool&amp; setMaxDescent,
+        bool strictMode, GlyphOverflowAndFallbackFontsMap&amp;, FontBaseline, VerticalPositionCache&amp;);
</ins><span class="cx">     void adjustMaxAscentAndDescent(int&amp; maxAscent, int&amp; maxDescent,
</span><del>-                                   int maxPositionTop, int maxPositionBottom);
</del><ins>+        int maxPositionTop, int maxPositionBottom);
</ins><span class="cx">     void placeBoxesInBlockDirection(LayoutUnit logicalTop, LayoutUnit maxHeight, int maxAscent, bool strictMode, LayoutUnit&amp; lineTop, LayoutUnit&amp; lineBottom, bool&amp; setLineTop,
</span><del>-                                    LayoutUnit&amp; lineTopIncludingMargins, LayoutUnit&amp; lineBottomIncludingMargins, bool&amp; hasAnnotationsBefore, bool&amp; hasAnnotationsAfter, FontBaseline);
</del><ins>+        LayoutUnit&amp; lineTopIncludingMargins, LayoutUnit&amp; lineBottomIncludingMargins, bool&amp; hasAnnotationsBefore, bool&amp; hasAnnotationsAfter, FontBaseline);
</ins><span class="cx">     void flipLinesInBlockDirection(LayoutUnit lineTop, LayoutUnit lineBottom);
</span><span class="cx">     bool requiresIdeographicBaseline(const GlyphOverflowAndFallbackFontsMap&amp;) const;
</span><span class="cx"> 
</span><span class="lines">@@ -299,7 +299,7 @@
</span><span class="cx"> 
</span><span class="cx">     void addBoxShadowVisualOverflow(LayoutRect&amp; logicalVisualOverflow);
</span><span class="cx">     void addBorderOutsetVisualOverflow(LayoutRect&amp; logicalVisualOverflow);
</span><del>-    void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsMap&amp;, LayoutRect&amp; logicalVisualOverflow);
</del><ins>+    void addTextBoxVisualOverflow(InlineTextBox&amp;, GlyphOverflowAndFallbackFontsMap&amp;, LayoutRect&amp; logicalVisualOverflow);
</ins><span class="cx">     void addReplacedChildOverflow(const InlineBox*, LayoutRect&amp; logicalLayoutOverflow, LayoutRect&amp; logicalVisualOverflow);
</span><span class="cx">     void constrainToLineTopAndBottomIfNeeded(LayoutRect&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRootInlineBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (169592 => 169593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RootInlineBox.cpp        2014-06-04 20:25:11 UTC (rev 169592)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp        2014-06-04 20:42:33 UTC (rev 169593)
</span><span class="lines">@@ -272,7 +272,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_baselineType = requiresIdeographicBaseline(textBoxDataMap) ? IdeographicBaseline : AlphabeticBaseline;
</span><span class="cx"> 
</span><del>-    computeLogicalBoxHeights(this, maxPositionTop, maxPositionBottom, maxAscent, maxDescent, setMaxAscent, setMaxDescent, noQuirksMode,
</del><ins>+    computeLogicalBoxHeights(*this, maxPositionTop, maxPositionBottom, maxAscent, maxDescent, setMaxAscent, setMaxDescent, noQuirksMode,
</ins><span class="cx">                              textBoxDataMap, baselineType(), verticalPositionCache);
</span><span class="cx"> 
</span><span class="cx">     if (maxAscent + maxDescent &lt; std::max(maxPositionTop, maxPositionBottom))
</span><span class="lines">@@ -809,17 +809,17 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RootInlineBox::ascentAndDescentForBox(InlineBox* box, GlyphOverflowAndFallbackFontsMap&amp; textBoxDataMap, int&amp; ascent, int&amp; descent,
</del><ins>+void RootInlineBox::ascentAndDescentForBox(InlineBox&amp; box, GlyphOverflowAndFallbackFontsMap&amp; textBoxDataMap, int&amp; ascent, int&amp; descent,
</ins><span class="cx">                                            bool&amp; affectsAscent, bool&amp; affectsDescent) const
</span><span class="cx"> {
</span><span class="cx">     bool ascentDescentSet = false;
</span><span class="cx"> 
</span><span class="cx">     // Replaced boxes will return 0 for the line-height if line-box-contain says they are
</span><span class="cx">     // not to be included.
</span><del>-    if (box-&gt;renderer().isReplaced()) {
</del><ins>+    if (box.renderer().isReplaced()) {
</ins><span class="cx">         if (lineStyle().lineBoxContain() &amp; LineBoxContainReplaced) {
</span><del>-            ascent = box-&gt;baselinePosition(baselineType());
-            descent = box-&gt;lineHeight() - ascent;
</del><ins>+            ascent = box.baselinePosition(baselineType());
+            descent = box.lineHeight() - ascent;
</ins><span class="cx">             
</span><span class="cx">             // Replaced elements always affect both the ascent and descent.
</span><span class="cx">             affectsAscent = true;
</span><span class="lines">@@ -828,10 +828,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Vector&lt;const SimpleFontData*&gt;* usedFonts = 0;
-    GlyphOverflow* glyphOverflow = 0;
-    if (box-&gt;isInlineTextBox()) {
-        GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(toInlineTextBox(box));
</del><ins>+    Vector&lt;const SimpleFontData*&gt;* usedFonts = nullptr;
+    GlyphOverflow* glyphOverflow = nullptr;
+    if (box.isInlineTextBox()) {
+        GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(toInlineTextBox(&amp;box));
</ins><span class="cx">         usedFonts = it == textBoxDataMap.end() ? 0 : &amp;it-&gt;value.first;
</span><span class="cx">         glyphOverflow = it == textBoxDataMap.end() ? 0 : &amp;it-&gt;value.second;
</span><span class="cx">     }
</span><span class="lines">@@ -842,9 +842,9 @@
</span><span class="cx">     bool setUsedFont = false;
</span><span class="cx">     bool setUsedFontWithLeading = false;
</span><span class="cx"> 
</span><del>-    const RenderStyle&amp; boxLineStyle = box-&gt;lineStyle();
</del><ins>+    const RenderStyle&amp; boxLineStyle = box.lineStyle();
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>-    if (usedFonts &amp;&amp; !usedFonts-&gt;isEmpty() &amp;&amp; (includeFont || (boxLineStyle.lineHeight().isNegative() &amp;&amp; includeLeading)) &amp;&amp; !box-&gt;renderer().document().settings()-&gt;alwaysUseBaselineOfPrimaryFont()) {
</del><ins>+    if (usedFonts &amp;&amp; !usedFonts-&gt;isEmpty() &amp;&amp; (includeFont || (boxLineStyle.lineHeight().isNegative() &amp;&amp; includeLeading)) &amp;&amp; !box.renderer().document().settings()-&gt;alwaysUseBaselineOfPrimaryFont()) {
</ins><span class="cx"> #else
</span><span class="cx">     if (usedFonts &amp;&amp; !usedFonts-&gt;isEmpty() &amp;&amp; (includeFont || (boxLineStyle.lineHeight().isNegative() &amp;&amp; includeLeading))) {
</span><span class="cx"> #endif
</span><span class="lines">@@ -865,38 +865,38 @@
</span><span class="cx">                 setUsedFontWithLeading = true;
</span><span class="cx">             }
</span><span class="cx">             if (!affectsAscent)
</span><del>-                affectsAscent = usedFontAscent - box-&gt;logicalTop() &gt; 0;
</del><ins>+                affectsAscent = usedFontAscent - box.logicalTop() &gt; 0;
</ins><span class="cx">             if (!affectsDescent)
</span><del>-                affectsDescent = usedFontDescent + box-&gt;logicalTop() &gt; 0;
</del><ins>+                affectsDescent = usedFontDescent + box.logicalTop() &gt; 0;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If leading is included for the box, then we compute that box.
</span><span class="cx">     if (includeLeading &amp;&amp; !setUsedFontWithLeading) {
</span><del>-        int ascentWithLeading = box-&gt;baselinePosition(baselineType());
-        int descentWithLeading = box-&gt;lineHeight() - ascentWithLeading;
</del><ins>+        int ascentWithLeading = box.baselinePosition(baselineType());
+        int descentWithLeading = box.lineHeight() - ascentWithLeading;
</ins><span class="cx">         setAscentAndDescent(ascent, descent, ascentWithLeading, descentWithLeading, ascentDescentSet);
</span><span class="cx">         
</span><span class="cx">         // Examine the font box for inline flows and text boxes to see if any part of it is above the baseline.
</span><span class="cx">         // If the top of our font box relative to the root box baseline is above the root box baseline, then
</span><span class="cx">         // we are contributing to the maxAscent value. Descent is similar. If any part of our font box is below
</span><span class="cx">         // the root box's baseline, then we contribute to the maxDescent value.
</span><del>-        affectsAscent = ascentWithLeading - box-&gt;logicalTop() &gt; 0;
-        affectsDescent = descentWithLeading + box-&gt;logicalTop() &gt; 0; 
</del><ins>+        affectsAscent = ascentWithLeading - box.logicalTop() &gt; 0;
+        affectsDescent = descentWithLeading + box.logicalTop() &gt; 0;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (includeFontForBox(box) &amp;&amp; !setUsedFont) {
</span><span class="cx">         int fontAscent = boxLineStyle.fontMetrics().ascent(baselineType());
</span><span class="cx">         int fontDescent = boxLineStyle.fontMetrics().descent(baselineType());
</span><span class="cx">         setAscentAndDescent(ascent, descent, fontAscent, fontDescent, ascentDescentSet);
</span><del>-        affectsAscent = fontAscent - box-&gt;logicalTop() &gt; 0;
-        affectsDescent = fontDescent + box-&gt;logicalTop() &gt; 0; 
</del><ins>+        affectsAscent = fontAscent - box.logicalTop() &gt; 0;
+        affectsDescent = fontDescent + box.logicalTop() &gt; 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (includeGlyphsForBox(box) &amp;&amp; glyphOverflow &amp;&amp; glyphOverflow-&gt;computeBounds) {
</span><span class="cx">         setAscentAndDescent(ascent, descent, glyphOverflow-&gt;top, glyphOverflow-&gt;bottom, ascentDescentSet);
</span><del>-        affectsAscent = glyphOverflow-&gt;top - box-&gt;logicalTop() &gt; 0;
-        affectsDescent = glyphOverflow-&gt;bottom + box-&gt;logicalTop() &gt; 0; 
</del><ins>+        affectsAscent = glyphOverflow-&gt;top - box.logicalTop() &gt; 0;
+        affectsDescent = glyphOverflow-&gt;bottom + box.logicalTop() &gt; 0;
</ins><span class="cx">         glyphOverflow-&gt;top = std::min(glyphOverflow-&gt;top, std::max(0, glyphOverflow-&gt;top - boxLineStyle.fontMetrics().ascent(baselineType())));
</span><span class="cx">         glyphOverflow-&gt;bottom = std::min(glyphOverflow-&gt;bottom, std::max(0, glyphOverflow-&gt;bottom - boxLineStyle.fontMetrics().descent(baselineType())));
</span><span class="cx">     }
</span><span class="lines">@@ -904,9 +904,9 @@
</span><span class="cx">     if (includeMarginForBox(box)) {
</span><span class="cx">         LayoutUnit ascentWithMargin = boxLineStyle.fontMetrics().ascent(baselineType());
</span><span class="cx">         LayoutUnit descentWithMargin = boxLineStyle.fontMetrics().descent(baselineType());
</span><del>-        if (box-&gt;parent() &amp;&amp; !box-&gt;renderer().isTextOrLineBreak()) {
-            ascentWithMargin += box-&gt;boxModelObject()-&gt;borderAndPaddingBefore() + box-&gt;boxModelObject()-&gt;marginBefore();
-            descentWithMargin += box-&gt;boxModelObject()-&gt;borderAndPaddingAfter() + box-&gt;boxModelObject()-&gt;marginAfter();
</del><ins>+        if (box.parent() &amp;&amp; !box.renderer().isTextOrLineBreak()) {
+            ascentWithMargin += box.boxModelObject()-&gt;borderAndPaddingBefore() + box.boxModelObject()-&gt;marginBefore();
+            descentWithMargin += box.boxModelObject()-&gt;borderAndPaddingAfter() + box.boxModelObject()-&gt;marginAfter();
</ins><span class="cx">         }
</span><span class="cx">         setAscentAndDescent(ascent, descent, ascentWithMargin, descentWithMargin, ascentDescentSet);
</span><span class="cx">         
</span><span class="lines">@@ -989,21 +989,21 @@
</span><span class="cx">     return verticalPosition;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RootInlineBox::includeLeadingForBox(InlineBox* box) const
</del><ins>+bool RootInlineBox::includeLeadingForBox(InlineBox&amp; box) const
</ins><span class="cx"> {
</span><del>-    if (box-&gt;renderer().isReplaced() || (box-&gt;renderer().isTextOrLineBreak() &amp;&amp; !box-&gt;behavesLikeText()))
</del><ins>+    if (box.renderer().isReplaced() || (box.renderer().isTextOrLineBreak() &amp;&amp; !box.behavesLikeText()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
</span><del>-    return (lineBoxContain &amp; LineBoxContainInline) || (box == this &amp;&amp; (lineBoxContain &amp; LineBoxContainBlock));
</del><ins>+    return (lineBoxContain &amp; LineBoxContainInline) || (&amp;box == this &amp;&amp; (lineBoxContain &amp; LineBoxContainBlock));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RootInlineBox::includeFontForBox(InlineBox* box) const
</del><ins>+bool RootInlineBox::includeFontForBox(InlineBox&amp; box) const
</ins><span class="cx"> {
</span><del>-    if (box-&gt;renderer().isReplaced() || (box-&gt;renderer().isTextOrLineBreak() &amp;&amp; !box-&gt;behavesLikeText()))
</del><ins>+    if (box.renderer().isReplaced() || (box.renderer().isTextOrLineBreak() &amp;&amp; !box.behavesLikeText()))
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    if (!box-&gt;behavesLikeText() &amp;&amp; box-&gt;isInlineFlowBox() &amp;&amp; !toInlineFlowBox(box)-&gt;hasTextChildren())
</del><ins>+    if (!box.behavesLikeText() &amp;&amp; box.isInlineFlowBox() &amp;&amp; !toInlineFlowBox(&amp;box)-&gt;hasTextChildren())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // For now map &quot;glyphs&quot; to &quot;font&quot; in vertical text mode until the bounds returned by glyphs aren't garbage.
</span><span class="lines">@@ -1011,12 +1011,12 @@
</span><span class="cx">     return (lineBoxContain &amp; LineBoxContainFont) || (!isHorizontal() &amp;&amp; (lineBoxContain &amp; LineBoxContainGlyphs));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RootInlineBox::includeGlyphsForBox(InlineBox* box) const
</del><ins>+bool RootInlineBox::includeGlyphsForBox(InlineBox&amp; box) const
</ins><span class="cx"> {
</span><del>-    if (box-&gt;renderer().isReplaced() || (box-&gt;renderer().isTextOrLineBreak() &amp;&amp; !box-&gt;behavesLikeText()))
</del><ins>+    if (box.renderer().isReplaced() || (box.renderer().isTextOrLineBreak() &amp;&amp; !box.behavesLikeText()))
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    if (!box-&gt;behavesLikeText() &amp;&amp; box-&gt;isInlineFlowBox() &amp;&amp; !toInlineFlowBox(box)-&gt;hasTextChildren())
</del><ins>+    if (!box.behavesLikeText() &amp;&amp; box.isInlineFlowBox() &amp;&amp; !toInlineFlowBox(&amp;box)-&gt;hasTextChildren())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: We can't fit to glyphs yet for vertical text, since the bounds returned are garbage.
</span><span class="lines">@@ -1024,9 +1024,9 @@
</span><span class="cx">     return isHorizontal() &amp;&amp; (lineBoxContain &amp; LineBoxContainGlyphs);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RootInlineBox::includeMarginForBox(InlineBox* box) const
</del><ins>+bool RootInlineBox::includeMarginForBox(InlineBox&amp; box) const
</ins><span class="cx"> {
</span><del>-    if (box-&gt;renderer().isReplaced() || (box-&gt;renderer().isTextOrLineBreak() &amp;&amp; !box-&gt;behavesLikeText()))
</del><ins>+    if (box.renderer().isReplaced() || (box.renderer().isTextOrLineBreak() &amp;&amp; !box.behavesLikeText()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRootInlineBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RootInlineBox.h (169592 => 169593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RootInlineBox.h        2014-06-04 20:25:11 UTC (rev 169592)
+++ trunk/Source/WebCore/rendering/RootInlineBox.h        2014-06-04 20:42:33 UTC (rev 169593)
</span><span class="lines">@@ -158,12 +158,8 @@
</span><span class="cx"> 
</span><span class="cx">     LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const;
</span><span class="cx"> 
</span><del>-    void ascentAndDescentForBox(InlineBox*, GlyphOverflowAndFallbackFontsMap&amp;, int&amp; ascent, int&amp; descent, bool&amp; affectsAscent, bool&amp; affectsDescent) const;
</del><ins>+    void ascentAndDescentForBox(InlineBox&amp;, GlyphOverflowAndFallbackFontsMap&amp;, int&amp; ascent, int&amp; descent, bool&amp; affectsAscent, bool&amp; affectsDescent) const;
</ins><span class="cx">     LayoutUnit verticalPositionForBox(InlineBox*, VerticalPositionCache&amp;);
</span><del>-    bool includeLeadingForBox(InlineBox*) const;
-    bool includeFontForBox(InlineBox*) const;
-    bool includeGlyphsForBox(InlineBox*) const;
-    bool includeMarginForBox(InlineBox*) const;
</del><span class="cx">     bool fitsToGlyphs() const;
</span><span class="cx">     bool includesRootLineBoxFontOrLeading() const;
</span><span class="cx">     
</span><span class="lines">@@ -196,6 +192,11 @@
</span><span class="cx"> private:
</span><span class="cx">     virtual bool isRootInlineBox() const override final { return true; }
</span><span class="cx"> 
</span><ins>+    bool includeLeadingForBox(InlineBox&amp;) const;
+    bool includeFontForBox(InlineBox&amp;) const;
+    bool includeGlyphsForBox(InlineBox&amp;) const;
+    bool includeMarginForBox(InlineBox&amp;) const;
+
</ins><span class="cx">     LayoutUnit lineSnapAdjustment(LayoutUnit delta = 0) const;
</span><span class="cx"> 
</span><span class="cx">     LayoutUnit beforeAnnotationsAdjustment() const;
</span></span></pre>
</div>
</div>

</body>
</html>