<!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>[183219] 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/183219">183219</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-23 15:34:10 -0700 (Thu, 23 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clean up: Use references instead of pointers in more SVG files
https://bugs.webkit.org/show_bug.cgi?id=144045

Reviewed by Darin Adler.

* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Pass reference instead of pointer.

* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::recordTextFragment): Changed parameter textBox from pointer to reference.
(WebCore::SVGTextLayoutEngine::layoutInlineTextBox): Ditto.
(WebCore::SVGTextLayoutEngine::currentVisualCharacterMetrics): Changed parameter textBox from pointer to
reference and made it const since this function does not modify textBox.
(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Changed parameters from pointers to references.
Also, removed comma from comment so that it reads well.
* rendering/svg/SVGTextLayoutEngine.h: Updated declarations for the above functions.

* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift): Changed parameter style from pointer to reference.
Added case BS_LENGTH to switch block and removed default case so that the compiler checks that we handle all cases.
Renamed parameter contextElement to context since the name of its data type conveys that it is an element.
(WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift): Changed parameter textRenderer from
pointer to reference and removed runtime assertion that textRenderer is non-null (since it well-formed reference
cannot point to a non-existent object).
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle): Changed parameter style from pointer to reference
removed runtime assertion that style is non-null.
* rendering/svg/SVGTextLayoutEngineBaseline.h: Updated declarations for the above functions.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRootInlineBoxcpp">trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutEnginecpp">trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutEngineh">trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutEngineBaselinecpp">trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutEngineBaselineh">trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183218 => 183219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-23 22:30:07 UTC (rev 183218)
+++ trunk/Source/WebCore/ChangeLog        2015-04-23 22:34:10 UTC (rev 183219)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2015-04-23  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        Clean up: Use references instead of pointers in more SVG files
+        https://bugs.webkit.org/show_bug.cgi?id=144045
+
+        Reviewed by Darin Adler.
+
+        * rendering/svg/SVGRootInlineBox.cpp:
+        (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Pass reference instead of pointer.
+
+        * rendering/svg/SVGTextLayoutEngine.cpp:
+        (WebCore::SVGTextLayoutEngine::recordTextFragment): Changed parameter textBox from pointer to reference.
+        (WebCore::SVGTextLayoutEngine::layoutInlineTextBox): Ditto.
+        (WebCore::SVGTextLayoutEngine::currentVisualCharacterMetrics): Changed parameter textBox from pointer to
+        reference and made it const since this function does not modify textBox.
+        (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Changed parameters from pointers to references.
+        Also, removed comma from comment so that it reads well.
+        * rendering/svg/SVGTextLayoutEngine.h: Updated declarations for the above functions.
+
+        * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
+        (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift): Changed parameter style from pointer to reference.
+        Added case BS_LENGTH to switch block and removed default case so that the compiler checks that we handle all cases.
+        Renamed parameter contextElement to context since the name of its data type conveys that it is an element.
+        (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift): Changed parameter textRenderer from
+        pointer to reference and removed runtime assertion that textRenderer is non-null (since it well-formed reference
+        cannot point to a non-existent object).
+        (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle): Changed parameter style from pointer to reference
+        removed runtime assertion that style is non-null.
+        * rendering/svg/SVGTextLayoutEngineBaseline.h: Updated declarations for the above functions.
+
</ins><span class="cx"> 2015-04-23  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r183194.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRootInlineBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp (183218 => 183219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp        2015-04-23 22:30:07 UTC (rev 183218)
+++ trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp        2015-04-23 22:34:10 UTC (rev 183219)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">     for (InlineBox* child = start-&gt;firstChild(); child; child = child-&gt;nextOnLine()) {
</span><span class="cx">         if (is&lt;SVGInlineTextBox&gt;(*child)) {
</span><span class="cx">             ASSERT(is&lt;RenderSVGInlineText&gt;(child-&gt;renderer()));
</span><del>-            characterLayout.layoutInlineTextBox(downcast&lt;SVGInlineTextBox&gt;(child));
</del><ins>+            characterLayout.layoutInlineTextBox(downcast&lt;SVGInlineTextBox&gt;(*child));
</ins><span class="cx">         } else {
</span><span class="cx">             // Skip generated content.
</span><span class="cx">             Node* node = child-&gt;renderer().node();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutEnginecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp (183218 => 183219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp        2015-04-23 22:30:07 UTC (rev 183218)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp        2015-04-23 22:34:10 UTC (rev 183219)
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx">     m_dy = dy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SVGTextLayoutEngine::recordTextFragment(SVGInlineTextBox* textBox, Vector&lt;SVGTextMetrics&gt;&amp; textMetricsValues)
</del><ins>+void SVGTextLayoutEngine::recordTextFragment(SVGInlineTextBox&amp; textBox, Vector&lt;SVGTextMetrics&gt;&amp; textMetricsValues)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_currentTextFragment.length);
</span><span class="cx">     ASSERT(m_visualMetricsListOffset &gt; 0);
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    textBox-&gt;textFragments().append(m_currentTextFragment);
</del><ins>+    textBox.textFragments().append(m_currentTextFragment);
</ins><span class="cx">     m_currentTextFragment = SVGTextFragment();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -210,27 +210,25 @@
</span><span class="cx">     m_textPathScaling = 1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SVGTextLayoutEngine::layoutInlineTextBox(SVGInlineTextBox* textBox)
</del><ins>+void SVGTextLayoutEngine::layoutInlineTextBox(SVGInlineTextBox&amp; textBox)
</ins><span class="cx"> {
</span><del>-    ASSERT(textBox);
-
-    RenderSVGInlineText&amp; text = textBox-&gt;renderer();
</del><ins>+    RenderSVGInlineText&amp; text = textBox.renderer();
</ins><span class="cx">     ASSERT(text.parent());
</span><span class="cx">     ASSERT(text.parent()-&gt;element());
</span><span class="cx">     ASSERT(text.parent()-&gt;element()-&gt;isSVGElement());
</span><span class="cx"> 
</span><span class="cx">     const RenderStyle&amp; style = text.style();
</span><span class="cx"> 
</span><del>-    textBox-&gt;clearTextFragments();
</del><ins>+    textBox.clearTextFragments();
</ins><span class="cx">     m_isVerticalText = style.svgStyle().isVerticalWritingMode();
</span><del>-    layoutTextOnLineOrPath(textBox, &amp;text, &amp;style);
</del><ins>+    layoutTextOnLineOrPath(textBox, text, style);
</ins><span class="cx"> 
</span><span class="cx">     if (m_inPathLayout) {
</span><del>-        m_pathLayoutBoxes.append(textBox);
</del><ins>+        m_pathLayoutBoxes.append(&amp;textBox);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_lineLayoutBoxes.append(textBox);
</del><ins>+    m_lineLayoutBoxes.append(&amp;textBox);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if DUMP_TEXT_FRAGMENTS &gt; 0
</span><span class="lines">@@ -360,12 +358,12 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGTextLayoutEngine::currentVisualCharacterMetrics(SVGInlineTextBox* textBox, Vector&lt;SVGTextMetrics&gt;&amp; visualMetricsValues, SVGTextMetrics&amp; visualMetrics)
</del><ins>+bool SVGTextLayoutEngine::currentVisualCharacterMetrics(const SVGInlineTextBox&amp; textBox, Vector&lt;SVGTextMetrics&gt;&amp; visualMetricsValues, SVGTextMetrics&amp; visualMetrics)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!visualMetricsValues.isEmpty());
</span><span class="cx">     unsigned textMetricsSize = visualMetricsValues.size();
</span><del>-    unsigned boxStart = textBox-&gt;start();
-    unsigned boxLength = textBox-&gt;len();
</del><ins>+    unsigned boxStart = textBox.start();
+    unsigned boxLength = textBox.len();
</ins><span class="cx"> 
</span><span class="cx">     if (m_visualMetricsListOffset == textMetricsSize)
</span><span class="cx">         return false;
</span><span class="lines">@@ -400,28 +398,28 @@
</span><span class="cx">     m_visualCharacterOffset += visualMetrics.length();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, RenderSVGInlineText* text, const RenderStyle* style)
</del><ins>+void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox&amp; textBox, RenderSVGInlineText&amp; text, const RenderStyle&amp; style)
</ins><span class="cx"> {
</span><span class="cx">     if (m_inPathLayout &amp;&amp; m_textPath.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RenderElement* textParent = text-&gt;parent();
</del><ins>+    RenderElement* textParent = text.parent();
</ins><span class="cx">     ASSERT(textParent);
</span><span class="cx">     SVGElement* lengthContext = downcast&lt;SVGElement&gt;(textParent-&gt;element());
</span><span class="cx">     
</span><span class="cx">     bool definesTextLength = parentDefinesTextLength(textParent);
</span><span class="cx"> 
</span><del>-    const SVGRenderStyle&amp; svgStyle = style-&gt;svgStyle();
</del><ins>+    const SVGRenderStyle&amp; svgStyle = style.svgStyle();
</ins><span class="cx"> 
</span><span class="cx">     m_visualMetricsListOffset = 0;
</span><span class="cx">     m_visualCharacterOffset = 0;
</span><span class="cx"> 
</span><del>-    Vector&lt;SVGTextMetrics&gt;&amp; visualMetricsValues = text-&gt;layoutAttributes()-&gt;textMetricsValues();
</del><ins>+    Vector&lt;SVGTextMetrics&gt;&amp; visualMetricsValues = text.layoutAttributes()-&gt;textMetricsValues();
</ins><span class="cx">     ASSERT(!visualMetricsValues.isEmpty());
</span><span class="cx"> 
</span><del>-    auto upconvertedCharacters = StringView(text-&gt;text()).upconvertedCharacters();
</del><ins>+    auto upconvertedCharacters = StringView(text.text()).upconvertedCharacters();
</ins><span class="cx">     const UChar* characters = upconvertedCharacters;
</span><del>-    const FontCascade&amp; font = style-&gt;fontCascade();
</del><ins>+    const FontCascade&amp; font = style.fontCascade();
</ins><span class="cx"> 
</span><span class="cx">     SVGTextLayoutEngineSpacing spacingLayout(font);
</span><span class="cx">     SVGTextLayoutEngineBaseline baselineLayout(font);
</span><span class="lines">@@ -430,7 +428,7 @@
</span><span class="cx">     bool applySpacingToNextCharacter = false;
</span><span class="cx"> 
</span><span class="cx">     float lastAngle = 0;
</span><del>-    float baselineShift = baselineLayout.calculateBaselineShift(&amp;svgStyle, lengthContext);
</del><ins>+    float baselineShift = baselineLayout.calculateBaselineShift(svgStyle, lengthContext);
</ins><span class="cx">     baselineShift -= baselineLayout.calculateAlignmentBaselineShift(m_isVerticalText, text);
</span><span class="cx"> 
</span><span class="cx">     // Main layout algorithm.
</span><span class="lines">@@ -463,16 +461,16 @@
</span><span class="cx">         float x = data.x;
</span><span class="cx">         float y = data.y;
</span><span class="cx"> 
</span><del>-        // When we've advanced to the box start offset, determine using the original x/y values,
-        // whether this character starts a new text chunk, before doing any further processing.
-        if (m_visualCharacterOffset == textBox-&gt;start())
-            textBox-&gt;setStartsNewTextChunk(logicalAttributes-&gt;context().characterStartsNewTextChunk(m_logicalCharacterOffset));
</del><ins>+        // When we've advanced to the box start offset, determine using the original x/y values
+        // whether this character starts a new text chunk before doing any further processing.
+        if (m_visualCharacterOffset == textBox.start())
+            textBox.setStartsNewTextChunk(logicalAttributes-&gt;context().characterStartsNewTextChunk(m_logicalCharacterOffset));
</ins><span class="cx"> 
</span><span class="cx">         float angle = data.rotate == SVGTextLayoutAttributes::emptyValue() ? 0 : data.rotate;
</span><span class="cx"> 
</span><span class="cx">         // Calculate glyph orientation angle.
</span><span class="cx">         const UChar* currentCharacter = characters + m_visualCharacterOffset;
</span><del>-        float orientationAngle = baselineLayout.calculateGlyphOrientationAngle(m_isVerticalText, &amp;svgStyle, *currentCharacter);
</del><ins>+        float orientationAngle = baselineLayout.calculateGlyphOrientationAngle(m_isVerticalText, svgStyle, *currentCharacter);
</ins><span class="cx"> 
</span><span class="cx">         // Calculate glyph advance &amp; x/y orientation shifts.
</span><span class="cx">         float xOrientationShift = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutEngineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.h (183218 => 183219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.h        2015-04-23 22:30:07 UTC (rev 183218)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.h        2015-04-23 22:34:10 UTC (rev 183219)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     void beginTextPathLayout(RenderSVGTextPath&amp;, SVGTextLayoutEngine&amp; lineLayout);
</span><span class="cx">     void endTextPathLayout();
</span><span class="cx"> 
</span><del>-    void layoutInlineTextBox(SVGInlineTextBox*);
</del><ins>+    void layoutInlineTextBox(SVGInlineTextBox&amp;);
</ins><span class="cx">     void finishLayout();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -62,15 +62,15 @@
</span><span class="cx">     void updateCurrentTextPosition(float x, float y, float glyphAdvance);
</span><span class="cx">     void updateRelativePositionAdjustmentsIfNeeded(float dx, float dy);
</span><span class="cx"> 
</span><del>-    void recordTextFragment(SVGInlineTextBox*, Vector&lt;SVGTextMetrics&gt;&amp;);
</del><ins>+    void recordTextFragment(SVGInlineTextBox&amp;, Vector&lt;SVGTextMetrics&gt;&amp;);
</ins><span class="cx">     bool parentDefinesTextLength(RenderObject*) const;
</span><span class="cx"> 
</span><del>-    void layoutTextOnLineOrPath(SVGInlineTextBox*, RenderSVGInlineText*, const RenderStyle*);
</del><ins>+    void layoutTextOnLineOrPath(SVGInlineTextBox&amp;, RenderSVGInlineText&amp;, const RenderStyle&amp;);
</ins><span class="cx">     void finalizeTransformMatrices(Vector&lt;SVGInlineTextBox*&gt;&amp;);
</span><span class="cx"> 
</span><span class="cx">     bool currentLogicalCharacterAttributes(SVGTextLayoutAttributes*&amp;);
</span><span class="cx">     bool currentLogicalCharacterMetrics(SVGTextLayoutAttributes*&amp;, SVGTextMetrics&amp;);
</span><del>-    bool currentVisualCharacterMetrics(SVGInlineTextBox*, Vector&lt;SVGTextMetrics&gt;&amp;, SVGTextMetrics&amp;);
</del><ins>+    bool currentVisualCharacterMetrics(const SVGInlineTextBox&amp;, Vector&lt;SVGTextMetrics&gt;&amp;, SVGTextMetrics&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void advanceToNextLogicalCharacter(const SVGTextMetrics&amp;);
</span><span class="cx">     void advanceToNextVisualCharacter(const SVGTextMetrics&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutEngineBaselinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp (183218 => 183219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp        2015-04-23 22:30:07 UTC (rev 183218)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp        2015-04-23 22:34:10 UTC (rev 183219)
</span><span class="lines">@@ -33,28 +33,29 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-float SVGTextLayoutEngineBaseline::calculateBaselineShift(const SVGRenderStyle* style, SVGElement* contextElement) const
</del><ins>+float SVGTextLayoutEngineBaseline::calculateBaselineShift(const SVGRenderStyle&amp; style, SVGElement* context) const
</ins><span class="cx"> {
</span><del>-    if (style-&gt;baselineShift() == BS_LENGTH) {
-        SVGLength baselineShiftValueLength = style-&gt;baselineShiftValue();
</del><ins>+    if (style.baselineShift() == BS_LENGTH) {
+        SVGLength baselineShiftValueLength = style.baselineShiftValue();
</ins><span class="cx">         if (baselineShiftValueLength.unitType() == LengthTypePercentage)
</span><span class="cx">             return baselineShiftValueLength.valueAsPercentage() * m_font.pixelSize();
</span><span class="cx"> 
</span><del>-        SVGLengthContext lengthContext(contextElement);
</del><ins>+        SVGLengthContext lengthContext(context);
</ins><span class="cx">         return baselineShiftValueLength.value(lengthContext);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    switch (style-&gt;baselineShift()) {
</del><ins>+    switch (style.baselineShift()) {
</ins><span class="cx">     case BS_BASELINE:
</span><span class="cx">         return 0;
</span><span class="cx">     case BS_SUB:
</span><span class="cx">         return -m_font.fontMetrics().floatHeight() / 2;
</span><span class="cx">     case BS_SUPER:
</span><span class="cx">         return m_font.fontMetrics().floatHeight() / 2;
</span><del>-    default:
-        ASSERT_NOT_REACHED();
-        return 0;
</del><ins>+    case BS_LENGTH:
+        break;
</ins><span class="cx">     }
</span><ins>+    ASSERT_NOT_REACHED();
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EAlignmentBaseline SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline(bool isVerticalText, const RenderObject* textRenderer) const
</span><span class="lines">@@ -102,15 +103,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-float SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift(bool isVerticalText, const RenderObject* textRenderer) const
</del><ins>+float SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift(bool isVerticalText, const RenderObject&amp; textRenderer) const
</ins><span class="cx"> {
</span><del>-    ASSERT(textRenderer);
-    ASSERT(textRenderer-&gt;parent());
-
-    const RenderObject* textRendererParent = textRenderer-&gt;parent();
</del><ins>+    const RenderObject* textRendererParent = textRenderer.parent();
</ins><span class="cx">     ASSERT(textRendererParent);
</span><span class="cx"> 
</span><del>-    EAlignmentBaseline baseline = textRenderer-&gt;style().svgStyle().alignmentBaseline();
</del><ins>+    EAlignmentBaseline baseline = textRenderer.style().svgStyle().alignmentBaseline();
</ins><span class="cx">     if (baseline == AB_AUTO) {
</span><span class="cx">         baseline = dominantBaselineToAlignmentBaseline(isVerticalText, textRendererParent);
</span><span class="cx">         ASSERT(baseline != AB_AUTO);
</span><span class="lines">@@ -145,11 +143,9 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-float SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle(bool isVerticalText, const SVGRenderStyle* style, const UChar&amp; character) const
</del><ins>+float SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle(bool isVerticalText, const SVGRenderStyle&amp; style, const UChar&amp; character) const
</ins><span class="cx"> {
</span><del>-    ASSERT(style);
-
-    switch (isVerticalText ? style-&gt;glyphOrientationVertical() : style-&gt;glyphOrientationHorizontal()) {
</del><ins>+    switch (isVerticalText ? style.glyphOrientationVertical() : style.glyphOrientationHorizontal()) {
</ins><span class="cx">     case GO_AUTO:
</span><span class="cx">         // Spec: Fullwidth ideographic and fullwidth Latin text will be set with a glyph-orientation of 0-degrees.
</span><span class="cx">         // Text which is not fullwidth will be set with a glyph-orientation of 90-degrees.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutEngineBaselineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h (183218 => 183219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h        2015-04-23 22:30:07 UTC (rev 183218)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h        2015-04-23 22:34:10 UTC (rev 183219)
</span><span class="lines">@@ -37,9 +37,9 @@
</span><span class="cx"> public:
</span><span class="cx">     SVGTextLayoutEngineBaseline(const FontCascade&amp;);
</span><span class="cx"> 
</span><del>-    float calculateBaselineShift(const SVGRenderStyle*, SVGElement* lengthContext) const;
-    float calculateAlignmentBaselineShift(bool isVerticalText, const RenderObject* textRenderer) const;
-    float calculateGlyphOrientationAngle(bool isVerticalText, const SVGRenderStyle*, const UChar&amp; character) const;
</del><ins>+    float calculateBaselineShift(const SVGRenderStyle&amp;, SVGElement* context) const;
+    float calculateAlignmentBaselineShift(bool isVerticalText, const RenderObject&amp; textRenderer) const;
+    float calculateGlyphOrientationAngle(bool isVerticalText, const SVGRenderStyle&amp;, const UChar&amp; character) const;
</ins><span class="cx">     float calculateGlyphAdvanceAndOrientation(bool isVerticalText, SVGTextMetrics&amp;, float angle, float&amp; xOrientationShift, float&amp; yOrientationShift) const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre>
</div>
</div>

</body>
</html>