Title: [228948] trunk/Source/WebCore
Revision
228948
Author
za...@apple.com
Date
2018-02-23 06:52:45 -0800 (Fri, 23 Feb 2018)

Log Message

[RenderTreeBuilder] Add WARN_UNUSED_RETURN to detach()
https://bugs.webkit.org/show_bug.cgi?id=183073
<rdar://problem/37814585>

Reviewed by Antti Koivisto.

So that we don't destroy a renderer accidentally.

* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderRuby.h:
* rendering/updating/RenderTreeBuilderSVG.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228947 => 228948)


--- trunk/Source/WebCore/ChangeLog	2018-02-23 13:53:13 UTC (rev 228947)
+++ trunk/Source/WebCore/ChangeLog	2018-02-23 14:52:45 UTC (rev 228948)
@@ -1,3 +1,17 @@
+2018-02-23  Zalan Bujtas  <za...@apple.com>
+
+        [RenderTreeBuilder] Add WARN_UNUSED_RETURN to detach()
+        https://bugs.webkit.org/show_bug.cgi?id=183073
+        <rdar://problem/37814585>
+
+        Reviewed by Antti Koivisto.
+
+        So that we don't destroy a renderer accidentally.
+
+        * rendering/updating/RenderTreeBuilderBlock.h:
+        * rendering/updating/RenderTreeBuilderRuby.h:
+        * rendering/updating/RenderTreeBuilderSVG.h:
+
 2018-02-22  Antoine Quint  <grao...@apple.com>
 
         REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.h (228947 => 228948)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.h	2018-02-23 13:53:13 UTC (rev 228947)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.h	2018-02-23 14:52:45 UTC (rev 228948)
@@ -36,8 +36,8 @@
     void attach(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
     void attachIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
 
-    RenderPtr<RenderObject> detach(RenderBlock& parent, RenderObject& oldChild);
-    RenderPtr<RenderObject> detach(RenderBlockFlow& parent, RenderObject& child);
+    RenderPtr<RenderObject> detach(RenderBlock& parent, RenderObject& oldChild) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detach(RenderBlockFlow& parent, RenderObject& child) WARN_UNUSED_RETURN;
 
     void dropAnonymousBoxChild(RenderBlock& parent, RenderBlock& child);
     void childBecameNonInline(RenderBlock& parent, RenderElement& child);

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.h (228947 => 228948)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.h	2018-02-23 13:53:13 UTC (rev 228947)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.h	2018-02-23 14:52:45 UTC (rev 228948)
@@ -42,9 +42,9 @@
     Ruby(RenderTreeBuilder&);
 
     void attach(RenderRubyRun& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    RenderPtr<RenderObject> detach(RenderRubyAsInline& parent, RenderObject& child);
-    RenderPtr<RenderObject> detach(RenderRubyAsBlock& parent, RenderObject& child);
-    RenderPtr<RenderObject> detach(RenderRubyRun& parent, RenderObject& child);
+    RenderPtr<RenderObject> detach(RenderRubyAsInline& parent, RenderObject& child) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detach(RenderRubyAsBlock& parent, RenderObject& child) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detach(RenderRubyRun& parent, RenderObject& child) WARN_UNUSED_RETURN;
 
     void moveChildren(RenderRubyBase& from, RenderRubyBase& to);
 

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h (228947 => 228948)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h	2018-02-23 13:53:13 UTC (rev 228947)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h	2018-02-23 14:52:45 UTC (rev 228948)
@@ -43,10 +43,10 @@
     void attach(RenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
     void attach(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
 
-    RenderPtr<RenderObject> detach(RenderSVGText& parent, RenderObject& child);
-    RenderPtr<RenderObject> detach(RenderSVGInline& parent, RenderObject& child);
-    RenderPtr<RenderObject> detach(RenderSVGContainer& parent, RenderObject& child);
-    RenderPtr<RenderObject> detach(RenderSVGRoot& parent, RenderObject& child);
+    RenderPtr<RenderObject> detach(RenderSVGText& parent, RenderObject& child) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detach(RenderSVGInline& parent, RenderObject& child) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detach(RenderSVGContainer& parent, RenderObject& child) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detach(RenderSVGRoot& parent, RenderObject& child) WARN_UNUSED_RETURN;
 
 private:
     RenderTreeBuilder& m_builder;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to