[RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTree...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Feb 2018 04:39:29 +0000 (04:39 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Feb 2018 04:39:29 +0000 (04:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182943
<rdar://problem/37689029>

Reviewed by Antti Koivisto.

We don't need to destroy the marker in RenderListItem::willBeRemoved(), because it gets deleted
in RenderTreeBuilder::removeAndDestroy() together with RenderListItem (as long as the marker is
the RenderListItem's descendent).

Covered by existing tests.

* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::~RenderListItem):
(WebCore::RenderListItem::willBeDestroyed): Deleted.
* rendering/RenderListItem.h:

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderListItem.cpp
Source/WebCore/rendering/RenderListItem.h

index 65bcde1..791d271 100644 (file)
@@ -1,3 +1,22 @@
+2018-02-20  Zalan Bujtas  <zalan@apple.com>
+
+        [RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=182943
+        <rdar://problem/37689029>
+
+        Reviewed by Antti Koivisto.
+
+        We don't need to destroy the marker in RenderListItem::willBeRemoved(), because it gets deleted
+        in RenderTreeBuilder::removeAndDestroy() together with RenderListItem (as long as the marker is
+        the RenderListItem's descendent). 
+
+        Covered by existing tests.
+
+        * rendering/RenderListItem.cpp:
+        (WebCore::RenderListItem::~RenderListItem):
+        (WebCore::RenderListItem::willBeDestroyed): Deleted.
+        * rendering/RenderListItem.h:
+
 2018-02-20  Nan Wang  <n_wang@apple.com>
 
         AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
index 34208d8..76736fc 100644 (file)
@@ -53,13 +53,7 @@ RenderListItem::RenderListItem(Element& element, RenderStyle&& style)
 RenderListItem::~RenderListItem()
 {
     // Do not add any code here. Add it to willBeDestroyed() instead.
-}
-
-void RenderListItem::willBeDestroyed(RenderTreeBuilder& builder)
-{
-    if (m_marker)
-        builder.removeAndDestroy(*m_marker);
-    RenderBlockFlow::willBeDestroyed(builder);
+    ASSERT(!m_marker);
 }
 
 RenderStyle RenderListItem::computeMarkerStyle() const
index 8398c7b..b701567 100644 (file)
@@ -62,7 +62,6 @@ public:
     bool isInReversedOrderedList() const;
 
 private:
-    void willBeDestroyed(RenderTreeBuilder&) final;
 
     const char* renderName() const final { return "RenderListItem"; }