RenderMathMLRow::createAnonymousWithParentRenderer() should return RenderPtr.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jan 2014 11:20:11 +0000 (11:20 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jan 2014 11:20:11 +0000 (11:20 +0000)
<https://webkit.org/b/126631>

Reviewed by Antti Koivisto.

* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::createAnonymousWithParentRenderer):

    Tweak to return RenderPtr<RenderMathMLRow> and removed comment(!)
    about how this should return a smart pointer. Also take the
    parent renderer as a RenderMathMLRoot& instead of a RenderObject*
    since that's all we ever pass.

* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::addChild):

    Updated for new createAnonymousWithParentRenderer() signature.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161493 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
Source/WebCore/rendering/mathml/RenderMathMLRow.h

index 859128149e45fbb0f6176f1275c72187364f36d3..5c4fe9f6573b77f707e841731f032806f041a93e 100644 (file)
@@ -1,3 +1,24 @@
+2014-01-08  Andreas Kling  <akling@apple.com>
+
+        RenderMathMLRow::createAnonymousWithParentRenderer() should return RenderPtr.
+        <https://webkit.org/b/126631>
+
+        Reviewed by Antti Koivisto.
+
+        * rendering/mathml/RenderMathMLRow.h:
+        * rendering/mathml/RenderMathMLRow.cpp:
+        (WebCore::RenderMathMLRow::createAnonymousWithParentRenderer):
+
+            Tweak to return RenderPtr<RenderMathMLRow> and removed comment(!)
+            about how this should return a smart pointer. Also take the
+            parent renderer as a RenderMathMLRoot& instead of a RenderObject*
+            since that's all we ever pass.
+
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::addChild):
+
+            Updated for new createAnonymousWithParentRenderer() signature.
+
 2014-01-08  Mario Sanchez Prada  <mario.prada@samsung.com>
 
         AX: Make roleValue() return DescriptionListRole for <dl> elements
index ef0f8131ad7edcde5d14d4dbd9d9d9eacb548bf4..6bf0567a48fc83b66599ef485473e1a62fbab499 100644 (file)
@@ -163,7 +163,7 @@ void RenderMathMLRoot::addChild(RenderObject* newChild, RenderObject* beforeChil
     // Insert an implicit <mrow> for <mroot> as well as <msqrt>, to ensure firstChild() will have a box
     // to measure and store a glyph-based height for preferredLogicalHeightAfterSizing.
     if (!firstChild())
-        RenderMathMLBlock::addChild(RenderMathMLRow::createAnonymousWithParentRenderer(this));
+        RenderMathMLBlock::addChild(RenderMathMLRow::createAnonymousWithParentRenderer(*this).leakPtr());
     
     // An <mroot>'s index has { position: absolute }.
     if (newChild->style().position() == AbsolutePosition)
index 5aaff861ef945196d3935aa48bf0504b444f57cc..02ef296cd6d3732624d4dcdb6f746900c45f6602 100644 (file)
@@ -32,6 +32,7 @@
 #include "MathMLNames.h"
 #include "RenderIterator.h"
 #include "RenderMathMLOperator.h"
+#include "RenderMathMLRoot.h"
 
 namespace WebCore {
 
@@ -47,10 +48,9 @@ RenderMathMLRow::RenderMathMLRow(Document& document, PassRef<RenderStyle> style)
 {
 }
 
-// FIXME: Change all these createAnonymous... routines to return a PassOwnPtr<>.
-RenderMathMLRow* RenderMathMLRow::createAnonymousWithParentRenderer(const RenderObject* parent)
+RenderPtr<RenderMathMLRow> RenderMathMLRow::createAnonymousWithParentRenderer(RenderMathMLRoot& parent)
 {
-    RenderMathMLRow* newMRow = new RenderMathMLRow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), FLEX));
+    RenderPtr<RenderMathMLRow> newMRow = createRenderer<RenderMathMLRow>(parent.document(), RenderStyle::createAnonymousStyleWithDisplay(&parent.style(), FLEX));
     newMRow->initializeStyle();
     return newMRow;
 }
index 5dfef0fa2def3847a31139fc46ba8f4687e3d194..9265502f3da2bdbe9801a53d1f028f4e39636052 100644 (file)
 #include "RenderMathMLBlock.h"
 
 namespace WebCore {
-    
+
+class RenderMathMLRoot;
+
 class RenderMathMLRow : public RenderMathMLBlock {
 public:
     RenderMathMLRow(Element&, PassRef<RenderStyle>);
     RenderMathMLRow(Document&, PassRef<RenderStyle>);
 
-    static RenderMathMLRow* createAnonymousWithParentRenderer(const RenderObject*);
+    static RenderPtr<RenderMathMLRow> createAnonymousWithParentRenderer(RenderMathMLRoot&);
 
 protected:
     virtual void layout();