Title: [158998] trunk/Source/WebCore

Diff

Modified: trunk/Source/WebCore/ChangeLog (158997 => 158998)


--- 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)
@@ -1,5 +1,15 @@
 2013-11-09  Andreas Kling  <[email protected]>
 
+        SVGTextLayoutAttributes always has a RenderSVGInlineText.
+        <https://webkit.org/b/124101>
+
+        No SVGTextLayoutAttributes object is without a RenderSVGInlineText
+        "context" so make context() return a reference.
+
+        Reviewed by Antti Koivisto.
+
+2013-11-09  Andreas Kling  <[email protected]>
+
         Move BindingSecurity stuff under JSDOMBinding umbrella.
         <https://webkit.org/b/124099>
 

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (158997 => 158998)


--- 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)
@@ -70,7 +70,7 @@
 RenderSVGInlineText::RenderSVGInlineText(Text& textNode, const String& string)
     : RenderText(textNode, applySVGWhitespaceRules(string, false))
     , m_scalingFactor(1)
-    , m_layoutAttributes(this)
+    , m_layoutAttributes(*this)
 {
 }
 

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (158997 => 158998)


--- 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)
@@ -211,8 +211,8 @@
             bool stopAfterNext = false;
             SVGTextLayoutAttributes* previous = 0;
             SVGTextLayoutAttributes* next = 0;
-            ASSERT_UNUSED(child, attributes->context() == child);
-            findPreviousAndNextAttributes(this, attributes->context(), stopAfterNext, previous, next);
+            ASSERT_UNUSED(child, &attributes->context() == child);
+            findPreviousAndNextAttributes(this, &attributes->context(), stopAfterNext, previous, next);
 
             if (previous)
                 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(previous->context());
@@ -335,7 +335,7 @@
     checkLayoutAttributesConsistency(this, m_layoutAttributes);
     for (RenderObject* descendant = text; descendant; descendant = descendant->nextInPreOrder(text)) {
         if (descendant->isSVGInlineText())
-            m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(toRenderSVGInlineText(descendant));
+            m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(toRenderSVGInlineText(*descendant));
     }
 }
 

Modified: trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp (158997 => 158998)


--- 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)
@@ -253,9 +253,9 @@
     unsigned attributesSize = attributes.size();
     for (unsigned i = 0; i < attributesSize; ++i) {
         SVGTextLayoutAttributes* current = attributes[i];
-        if (!first && firstContext == current->context())
+        if (!first && firstContext == &current->context())
             first = current;
-        if (!last && lastContext == current->context())
+        if (!last && lastContext == &current->context())
             last = current;
         if (first && last)
             break;

Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp (158997 => 158998)


--- 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)
@@ -27,7 +27,7 @@
 
 namespace WebCore {
 
-SVGTextLayoutAttributes::SVGTextLayoutAttributes(RenderSVGInlineText* context)
+SVGTextLayoutAttributes::SVGTextLayoutAttributes(RenderSVGInlineText& context)
     : m_context(context)
 {
 }
@@ -59,7 +59,7 @@
 
 void SVGTextLayoutAttributes::dump() const
 {
-    fprintf(stderr, "context: %p\n", m_context);
+    fprintf(stderr, "context: %p\n", &m_context);
     const SVGCharacterDataMap::const_iterator end = m_characterDataMap.end();
     for (SVGCharacterDataMap::const_iterator it = m_characterDataMap.begin(); it != end; ++it) {
         const SVGCharacterData& data = ""

Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributes.h (158997 => 158998)


--- 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)
@@ -46,13 +46,14 @@
 class SVGTextLayoutAttributes {
     WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributes);
 public:
-    SVGTextLayoutAttributes(RenderSVGInlineText*);
+    explicit SVGTextLayoutAttributes(RenderSVGInlineText&);
 
     void clear();
     void dump() const;
     static float emptyValue();
 
-    RenderSVGInlineText* context() const { return m_context; }
+    RenderSVGInlineText& context() { return m_context; }
+    const RenderSVGInlineText& context() const { return m_context; }
     
     SVGCharacterDataMap& characterDataMap() { return m_characterDataMap; }
     const SVGCharacterDataMap& characterDataMap() const { return m_characterDataMap; }
@@ -60,7 +61,7 @@
     Vector<SVGTextMetrics>& textMetricsValues() { return m_textMetricsValues; }
 
 private:
-    RenderSVGInlineText* m_context;
+    RenderSVGInlineText& m_context;
     SVGCharacterDataMap m_characterDataMap;
     Vector<SVGTextMetrics> m_textMetricsValues;
 };

Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp (158997 => 158998)


--- 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)
@@ -33,11 +33,9 @@
 {
 }
 
-void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer(RenderSVGInlineText* text)
+void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer(RenderSVGInlineText& text)
 {
-    ASSERT(text);
-
-    RenderSVGText* textRoot = RenderSVGText::locateRenderSVGTextAncestor(text);
+    RenderSVGText* textRoot = RenderSVGText::locateRenderSVGTextAncestor(&text);
     if (!textRoot)
         return;
 
@@ -54,7 +52,7 @@
         buildCharacterDataMap(textRoot);
     }
 
-    m_metricsBuilder.buildMetricsAndLayoutAttributes(textRoot, text, m_characterDataMap);
+    m_metricsBuilder.buildMetricsAndLayoutAttributes(textRoot, &text, m_characterDataMap);
 }
 
 bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree(RenderSVGText* textRoot)

Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h (158997 => 158998)


--- 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)
@@ -44,7 +44,7 @@
 public:
     SVGTextLayoutAttributesBuilder();
     bool buildLayoutAttributesForForSubtree(RenderSVGText*);
-    void buildLayoutAttributesForTextRenderer(RenderSVGInlineText*);
+    void buildLayoutAttributesForTextRenderer(RenderSVGInlineText&);
 
     void rebuildMetricsForTextRenderer(RenderSVGInlineText*);
 

Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp (158997 => 158998)


--- 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)
@@ -338,7 +338,7 @@
     logicalAttributes = m_layoutAttributes[m_layoutAttributesPosition];
     ASSERT(logicalAttributes);
 
-    if (m_logicalCharacterOffset != logicalAttributes->context()->textLength())
+    if (m_logicalCharacterOffset != logicalAttributes->context().textLength())
         return true;
 
     ++m_layoutAttributesPosition;
@@ -485,7 +485,7 @@
         // 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->context()->characterStartsNewTextChunk(m_logicalCharacterOffset));
+            textBox->setStartsNewTextChunk(logicalAttributes->context().characterStartsNewTextChunk(m_logicalCharacterOffset));
 
         float angle = data.rotate == SVGTextLayoutAttributes::emptyValue() ? 0 : data.rotate;
 

Modified: trunk/Source/WebCore/rendering/svg/SVGTextQuery.cpp (158997 => 158998)


--- 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)
@@ -164,7 +164,7 @@
     unsigned textMetricsSize = textMetricsValues.size();
 
     unsigned positionOffset = 0;
-    unsigned positionSize = layoutAttributes->context()->textLength();
+    unsigned positionSize = layoutAttributes->context().textLength();
 
     bool alterStartPosition = true;
     bool alterEndPosition = true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to