<!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>[158998] 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/158998">158998</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2013-11-09 03:17:29 -0800 (Sat, 09 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>SVGTextLayoutAttributes always has a RenderSVGInlineText.
&lt;https://webkit.org/b/124101&gt;

No SVGTextLayoutAttributes object is without a RenderSVGInlineText
&quot;context&quot; so make context() return a reference.

Reviewed by Antti Koivisto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGInlineTextcpp">trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGTextcpp">trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRootInlineBoxcpp">trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutAttributescpp">trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesh">trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuildercpp">trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuilderh">trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutEnginecpp">trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextQuerycpp">trunk/Source/WebCore/rendering/svg/SVGTextQuery.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/ChangeLog        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2013-11-09  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        SVGTextLayoutAttributes always has a RenderSVGInlineText.
+        &lt;https://webkit.org/b/124101&gt;
+
+        No SVGTextLayoutAttributes object is without a RenderSVGInlineText
+        &quot;context&quot; so make context() return a reference.
+
+        Reviewed by Antti Koivisto.
+
+2013-11-09  Andreas Kling  &lt;akling@apple.com&gt;
+
</ins><span class="cx">         Move BindingSecurity stuff under JSDOMBinding umbrella.
</span><span class="cx">         &lt;https://webkit.org/b/124099&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGInlineTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> RenderSVGInlineText::RenderSVGInlineText(Text&amp; textNode, const String&amp; string)
</span><span class="cx">     : RenderText(textNode, applySVGWhitespaceRules(string, false))
</span><span class="cx">     , m_scalingFactor(1)
</span><del>-    , m_layoutAttributes(this)
</del><ins>+    , m_layoutAttributes(*this)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -211,8 +211,8 @@
</span><span class="cx">             bool stopAfterNext = false;
</span><span class="cx">             SVGTextLayoutAttributes* previous = 0;
</span><span class="cx">             SVGTextLayoutAttributes* next = 0;
</span><del>-            ASSERT_UNUSED(child, attributes-&gt;context() == child);
-            findPreviousAndNextAttributes(this, attributes-&gt;context(), stopAfterNext, previous, next);
</del><ins>+            ASSERT_UNUSED(child, &amp;attributes-&gt;context() == child);
+            findPreviousAndNextAttributes(this, &amp;attributes-&gt;context(), stopAfterNext, previous, next);
</ins><span class="cx"> 
</span><span class="cx">             if (previous)
</span><span class="cx">                 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(previous-&gt;context());
</span><span class="lines">@@ -335,7 +335,7 @@
</span><span class="cx">     checkLayoutAttributesConsistency(this, m_layoutAttributes);
</span><span class="cx">     for (RenderObject* descendant = text; descendant; descendant = descendant-&gt;nextInPreOrder(text)) {
</span><span class="cx">         if (descendant-&gt;isSVGInlineText())
</span><del>-            m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(toRenderSVGInlineText(descendant));
</del><ins>+            m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(toRenderSVGInlineText(*descendant));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRootInlineBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -253,9 +253,9 @@
</span><span class="cx">     unsigned attributesSize = attributes.size();
</span><span class="cx">     for (unsigned i = 0; i &lt; attributesSize; ++i) {
</span><span class="cx">         SVGTextLayoutAttributes* current = attributes[i];
</span><del>-        if (!first &amp;&amp; firstContext == current-&gt;context())
</del><ins>+        if (!first &amp;&amp; firstContext == &amp;current-&gt;context())
</ins><span class="cx">             first = current;
</span><del>-        if (!last &amp;&amp; lastContext == current-&gt;context())
</del><ins>+        if (!last &amp;&amp; lastContext == &amp;current-&gt;context())
</ins><span class="cx">             last = current;
</span><span class="cx">         if (first &amp;&amp; last)
</span><span class="cx">             break;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutAttributescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-SVGTextLayoutAttributes::SVGTextLayoutAttributes(RenderSVGInlineText* context)
</del><ins>+SVGTextLayoutAttributes::SVGTextLayoutAttributes(RenderSVGInlineText&amp; context)
</ins><span class="cx">     : m_context(context)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SVGTextLayoutAttributes::dump() const
</span><span class="cx"> {
</span><del>-    fprintf(stderr, &quot;context: %p\n&quot;, m_context);
</del><ins>+    fprintf(stderr, &quot;context: %p\n&quot;, &amp;m_context);
</ins><span class="cx">     const SVGCharacterDataMap::const_iterator end = m_characterDataMap.end();
</span><span class="cx">     for (SVGCharacterDataMap::const_iterator it = m_characterDataMap.begin(); it != end; ++it) {
</span><span class="cx">         const SVGCharacterData&amp; data = it-&gt;value;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.h (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.h        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.h        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -46,13 +46,14 @@
</span><span class="cx"> class SVGTextLayoutAttributes {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributes);
</span><span class="cx"> public:
</span><del>-    SVGTextLayoutAttributes(RenderSVGInlineText*);
</del><ins>+    explicit SVGTextLayoutAttributes(RenderSVGInlineText&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void clear();
</span><span class="cx">     void dump() const;
</span><span class="cx">     static float emptyValue();
</span><span class="cx"> 
</span><del>-    RenderSVGInlineText* context() const { return m_context; }
</del><ins>+    RenderSVGInlineText&amp; context() { return m_context; }
+    const RenderSVGInlineText&amp; context() const { return m_context; }
</ins><span class="cx">     
</span><span class="cx">     SVGCharacterDataMap&amp; characterDataMap() { return m_characterDataMap; }
</span><span class="cx">     const SVGCharacterDataMap&amp; characterDataMap() const { return m_characterDataMap; }
</span><span class="lines">@@ -60,7 +61,7 @@
</span><span class="cx">     Vector&lt;SVGTextMetrics&gt;&amp; textMetricsValues() { return m_textMetricsValues; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    RenderSVGInlineText* m_context;
</del><ins>+    RenderSVGInlineText&amp; m_context;
</ins><span class="cx">     SVGCharacterDataMap m_characterDataMap;
</span><span class="cx">     Vector&lt;SVGTextMetrics&gt; m_textMetricsValues;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -33,11 +33,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer(RenderSVGInlineText* text)
</del><ins>+void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer(RenderSVGInlineText&amp; text)
</ins><span class="cx"> {
</span><del>-    ASSERT(text);
-
-    RenderSVGText* textRoot = RenderSVGText::locateRenderSVGTextAncestor(text);
</del><ins>+    RenderSVGText* textRoot = RenderSVGText::locateRenderSVGTextAncestor(&amp;text);
</ins><span class="cx">     if (!textRoot)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -54,7 +52,7 @@
</span><span class="cx">         buildCharacterDataMap(textRoot);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_metricsBuilder.buildMetricsAndLayoutAttributes(textRoot, text, m_characterDataMap);
</del><ins>+    m_metricsBuilder.buildMetricsAndLayoutAttributes(textRoot, &amp;text, m_characterDataMap);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree(RenderSVGText* textRoot)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> public:
</span><span class="cx">     SVGTextLayoutAttributesBuilder();
</span><span class="cx">     bool buildLayoutAttributesForForSubtree(RenderSVGText*);
</span><del>-    void buildLayoutAttributesForTextRenderer(RenderSVGInlineText*);
</del><ins>+    void buildLayoutAttributesForTextRenderer(RenderSVGInlineText&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void rebuildMetricsForTextRenderer(RenderSVGInlineText*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutEnginecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx">     logicalAttributes = m_layoutAttributes[m_layoutAttributesPosition];
</span><span class="cx">     ASSERT(logicalAttributes);
</span><span class="cx"> 
</span><del>-    if (m_logicalCharacterOffset != logicalAttributes-&gt;context()-&gt;textLength())
</del><ins>+    if (m_logicalCharacterOffset != logicalAttributes-&gt;context().textLength())
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     ++m_layoutAttributesPosition;
</span><span class="lines">@@ -485,7 +485,7 @@
</span><span class="cx">         // When we've advanced to the box start offset, determine using the original x/y values,
</span><span class="cx">         // whether this character starts a new text chunk, before doing any further processing.
</span><span class="cx">         if (m_visualCharacterOffset == textBox-&gt;start())
</span><del>-            textBox-&gt;setStartsNewTextChunk(logicalAttributes-&gt;context()-&gt;characterStartsNewTextChunk(m_logicalCharacterOffset));
</del><ins>+            textBox-&gt;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></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextQuerycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextQuery.cpp (158997 => 158998)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextQuery.cpp        2013-11-09 11:16:41 UTC (rev 158997)
+++ trunk/Source/WebCore/rendering/svg/SVGTextQuery.cpp        2013-11-09 11:17:29 UTC (rev 158998)
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx">     unsigned textMetricsSize = textMetricsValues.size();
</span><span class="cx"> 
</span><span class="cx">     unsigned positionOffset = 0;
</span><del>-    unsigned positionSize = layoutAttributes-&gt;context()-&gt;textLength();
</del><ins>+    unsigned positionSize = layoutAttributes-&gt;context().textLength();
</ins><span class="cx"> 
</span><span class="cx">     bool alterStartPosition = true;
</span><span class="cx">     bool alterEndPosition = true;
</span></span></pre>
</div>
</div>

</body>
</html>