RenderBlock shouldn't need a pre-destructor hook.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Nov 2014 21:22:53 +0000 (21:22 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Nov 2014 21:22:53 +0000 (21:22 +0000)
<https://webkit.org/b/138430>

Reviewed by Antti Koivisto.

All that was interesting in RenderBlock::willBeDestroyed() has migrated
to RenderBlockFlow. removeFromUpdateScrollInfoAfterLayoutTransaction()
can be called from the plain destructor, so just move it there.

We don't have to worry about destroyLeftoverChildren(), since RenderElement
will take care of that for us.

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

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

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

index bc06b24..db0f794 100644 (file)
@@ -1,3 +1,22 @@
+2014-11-05  Andreas Kling  <akling@apple.com>
+
+        RenderBlock shouldn't need a pre-destructor hook.
+        <https://webkit.org/b/138430>
+
+        Reviewed by Antti Koivisto.
+
+        All that was interesting in RenderBlock::willBeDestroyed() has migrated
+        to RenderBlockFlow. removeFromUpdateScrollInfoAfterLayoutTransaction()
+        can be called from the plain destructor, so just move it there.
+
+        We don't have to worry about destroyLeftoverChildren(), since RenderElement
+        will take care of that for us.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::~RenderBlock):
+        (WebCore::RenderBlock::willBeDestroyed): Deleted.
+        * rendering/RenderBlock.h:
+
 2014-11-05  Chris Dumez  <cdumez@apple.com>
 
         Remove 2 unnecessary virtual functions on InputType
index cad07c1..3502205 100644 (file)
@@ -223,6 +223,8 @@ static void removeBlockFromDescendantAndContainerMaps(RenderBlock* block, Tracke
 
 RenderBlock::~RenderBlock()
 {
+    removeFromUpdateScrollInfoAfterLayoutTransaction();
+
     if (gRareDataMap)
         gRareDataMap->remove(this);
     if (gPercentHeightDescendantsMap)
@@ -236,17 +238,6 @@ bool RenderBlock::hasRareData() const
     return gRareDataMap ? gRareDataMap->contains(this) : false;
 }
 
-void RenderBlock::willBeDestroyed()
-{
-    // Make sure to destroy anonymous children first while they are still connected to the rest of the tree, so that they will
-    // properly dirty line boxes that they are removed from. Effects that do :before/:after only on hover could crash otherwise.
-    destroyLeftoverChildren();
-
-    removeFromUpdateScrollInfoAfterLayoutTransaction();
-
-    RenderBox::willBeDestroyed();
-}
-
 void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
 {
     const RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
index 5192253..34bcece 100644 (file)
@@ -316,7 +316,6 @@ public:
 
 protected:
     virtual RenderFlowThread* locateFlowThreadContainingBlock() const override;
-    virtual void willBeDestroyed() override;
 
     virtual void layout() override;