Title: [222922] trunk/Source/WebCore
Revision
222922
Author
[email protected]
Date
2017-10-05 11:48:36 -0700 (Thu, 05 Oct 2017)

Log Message

RenderMathMLFenced should not hold a raw pointer to RenderMathMLFencedOperator
https://bugs.webkit.org/show_bug.cgi?id=177950
<rdar://problem/34837002>

Reviewed by Antti Koivisto.

Even though RenderMathMLFencedOperator is a child renderer, it's lifetime is not explicitly managed by
RenderMathMLFenced.

Covered by existing test cases.

* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::RenderMathMLFenced):
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::addChild):
* rendering/mathml/RenderMathMLFenced.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (222921 => 222922)


--- trunk/Source/WebCore/ChangeLog	2017-10-05 18:47:17 UTC (rev 222921)
+++ trunk/Source/WebCore/ChangeLog	2017-10-05 18:48:36 UTC (rev 222922)
@@ -1,3 +1,22 @@
+2017-10-05  Zalan Bujtas  <[email protected]>
+
+        RenderMathMLFenced should not hold a raw pointer to RenderMathMLFencedOperator
+        https://bugs.webkit.org/show_bug.cgi?id=177950
+        <rdar://problem/34837002>
+
+        Reviewed by Antti Koivisto.
+
+        Even though RenderMathMLFencedOperator is a child renderer, it's lifetime is not explicitly managed by
+        RenderMathMLFenced.
+
+        Covered by existing test cases.
+
+        * rendering/mathml/RenderMathMLFenced.cpp:
+        (WebCore::RenderMathMLFenced::RenderMathMLFenced):
+        (WebCore::RenderMathMLFenced::makeFences):
+        (WebCore::RenderMathMLFenced::addChild):
+        * rendering/mathml/RenderMathMLFenced.h:
+
 2017-10-05  Andy Estes  <[email protected]>
 
         [Payment Request] Add a payment method that supports Apple Pay

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp (222921 => 222922)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp	2017-10-05 18:47:17 UTC (rev 222921)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp	2017-10-05 18:48:36 UTC (rev 222922)
@@ -45,7 +45,6 @@
 
 RenderMathMLFenced::RenderMathMLFenced(MathMLRowElement& element, RenderStyle&& style)
     : RenderMathMLRow(element, WTFMove(style))
-    , m_closeFenceRenderer(nullptr)
 {
 }
 
@@ -97,7 +96,7 @@
     RenderMathMLRow::addChild(WTFMove(openFence), firstChild());
 
     auto closeFence = createMathMLOperator(m_close, MathMLOperatorDictionary::Postfix, MathMLOperatorDictionary::Fence);
-    m_closeFenceRenderer = closeFence.get();
+    m_closeFenceRenderer = makeWeakPtr(*closeFence);
     RenderMathMLRow::addChild(WTFMove(closeFence));
 }
 
@@ -145,8 +144,8 @@
     } else {
         // Adding |y| at the end of an existing element e.g. (x) - insert the separator first before the closing fence, then |y|, to get (x, y).
         if (separatorRenderer)
-            RenderMathMLRow::addChild(WTFMove(separatorRenderer), m_closeFenceRenderer);
-        RenderMathMLRow::addChild(WTFMove(child), m_closeFenceRenderer);
+            RenderMathMLRow::addChild(WTFMove(separatorRenderer), m_closeFenceRenderer.get());
+        RenderMathMLRow::addChild(WTFMove(child), m_closeFenceRenderer.get());
     }
 }
 

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.h (222921 => 222922)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.h	2017-10-05 18:47:17 UTC (rev 222921)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.h	2017-10-05 18:48:36 UTC (rev 222922)
@@ -51,7 +51,7 @@
     String m_close;
     RefPtr<StringImpl> m_separators;
 
-    RenderMathMLFencedOperator* m_closeFenceRenderer;
+    WeakPtr<RenderMathMLFencedOperator> m_closeFenceRenderer;
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to