createAnonymousMathMLBlock() should return RenderPtr.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jan 2014 06:42:50 +0000 (06:42 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jan 2014 06:42:50 +0000 (06:42 +0000)
<https://webkit.org/b/126583>

Reviewed by Antti Koivisto.

* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::createAnonymousMathMLBlock):

    Make this return a RenderPtr<RenderMathMLBlock> and removed the
    EDisplay argument since it was always using the default (FLEX.)

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

    Updated for the new createAnonymousMathMLBlock() signature.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.h
Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp

index 9288ee09a9e14480c58c84ca30bd6661651a5dee..2bee50c3d23fd44351dd6c8899c186a4b3263cca 100644 (file)
@@ -1,3 +1,22 @@
+2014-01-07  Andreas Kling  <akling@apple.com>
+
+        createAnonymousMathMLBlock() should return RenderPtr.
+        <https://webkit.org/b/126583>
+
+        Reviewed by Antti Koivisto.
+
+        * rendering/mathml/RenderMathMLBlock.h:
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::createAnonymousMathMLBlock):
+
+            Make this return a RenderPtr<RenderMathMLBlock> and removed the
+            EDisplay argument since it was always using the default (FLEX.)
+
+        * rendering/mathml/RenderMathMLFraction.cpp:
+        (WebCore::RenderMathMLFraction::addChild):
+
+            Updated for the new createAnonymousMathMLBlock() signature.
+
 2014-01-07  Eric Carlson  <eric.carlson@apple.com>
 
         Teach MediaSessionManager to manage interruptions
index bfc9c38c51540499f6693d8584e8e23dee8d381b..7243115661fc36e2b6d0f1292ac10e35045ba5f7 100644 (file)
@@ -60,9 +60,9 @@ bool RenderMathMLBlock::isChildAllowed(const RenderObject& child, const RenderSt
     return child.node() && isElement(*child.node());
 }
 
-RenderMathMLBlock* RenderMathMLBlock::createAnonymousMathMLBlock(EDisplay display)
+RenderPtr<RenderMathMLBlock> RenderMathMLBlock::createAnonymousMathMLBlock()
 {
-    RenderMathMLBlock* newBlock = new RenderMathMLBlock(document(), RenderStyle::createAnonymousStyleWithDisplay(&style(), display));
+    RenderPtr<RenderMathMLBlock> newBlock = createRenderer<RenderMathMLBlock>(document(), RenderStyle::createAnonymousStyleWithDisplay(&style(), FLEX));
     newBlock->initializeStyle();
     return newBlock;
 }
index 9da613bfdd9e3f62d7597d277cb71147129705bc..53f3793849fa700b9b6d36d9fc13dad874ca6994 100644 (file)
@@ -62,7 +62,7 @@ public:
 #endif
     
     // Create a new RenderMathMLBlock, with a new style inheriting from this->style().
-    RenderMathMLBlock* createAnonymousMathMLBlock(EDisplay = FLEX);
+    RenderPtr<RenderMathMLBlock> createAnonymousMathMLBlock();
     
     void setIgnoreInAccessibilityTree(bool flag) { m_ignoreInAccessibilityTree = flag; }
     bool ignoreInAccessibilityTree() const { return m_ignoreInAccessibilityTree; }
index c2e088c96ef7e5e48f66215e287586459eeadd0a..0655289df19fd9da4b4b47005ce518b11bc35ba9 100644 (file)
@@ -90,13 +90,13 @@ void RenderMathMLFraction::updateFromElement()
 void RenderMathMLFraction::addChild(RenderObject* child, RenderObject* /* beforeChild */)
 {
     if (isEmpty()) {
-        RenderMathMLBlock* numeratorWrapper = createAnonymousMathMLBlock();
-        RenderMathMLBlock::addChild(numeratorWrapper);
-        fixChildStyle(numeratorWrapper);
+        RenderPtr<RenderMathMLBlock> numeratorWrapper = createAnonymousMathMLBlock();
+        fixChildStyle(numeratorWrapper.get());
+        RenderMathMLBlock::addChild(numeratorWrapper.leakPtr());
         
-        RenderMathMLBlock* denominatorWrapper = createAnonymousMathMLBlock();
-        RenderMathMLBlock::addChild(denominatorWrapper);
-        fixChildStyle(denominatorWrapper);
+        RenderPtr<RenderMathMLBlock> denominatorWrapper = createAnonymousMathMLBlock();
+        fixChildStyle(denominatorWrapper.get());
+        RenderMathMLBlock::addChild(denominatorWrapper.leakPtr());
     }
     
     if (firstChild()->isEmpty())