Title: [126590] trunk/Source/WebCore
Revision
126590
Author
[email protected]
Date
2012-08-24 09:37:54 -0700 (Fri, 24 Aug 2012)

Log Message

Remove RenderTableSection::removeChild
https://bugs.webkit.org/show_bug.cgi?id=94883

Reviewed by Abhishek Arya.

This change removed removeChild, replaced by willBeRemoved calls in the children
class. This is done to ensure that post-removal invalidations are properly done
in table rows and table cells.

Refactoring covered by existing tests.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::removeChild):
* rendering/RenderTableSection.h:
Removed this function...

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::willBeRemovedFromTree):
* rendering/RenderTableCell.h:
(RenderTableCell):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::willBeRemovedFromTree):
* rendering/RenderTableRow.h:
... and moved the invalidation into the willBeRemovedFromTree functions.
The willBeRemovedFromTree replaced the willBeDestroyed functions in the
2 classes as the invalidation really represented tree removal updates,
not death updates.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126589 => 126590)


--- trunk/Source/WebCore/ChangeLog	2012-08-24 15:40:53 UTC (rev 126589)
+++ trunk/Source/WebCore/ChangeLog	2012-08-24 16:37:54 UTC (rev 126590)
@@ -1,3 +1,33 @@
+2012-08-24  Julien Chaffraix  <[email protected]>
+
+        Remove RenderTableSection::removeChild
+        https://bugs.webkit.org/show_bug.cgi?id=94883
+
+        Reviewed by Abhishek Arya.
+
+        This change removed removeChild, replaced by willBeRemoved calls in the children
+        class. This is done to ensure that post-removal invalidations are properly done
+        in table rows and table cells.
+
+        Refactoring covered by existing tests.
+
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::removeChild):
+        * rendering/RenderTableSection.h:
+        Removed this function...
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::willBeRemovedFromTree):
+        * rendering/RenderTableCell.h:
+        (RenderTableCell):
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::willBeRemovedFromTree):
+        * rendering/RenderTableRow.h:
+        ... and moved the invalidation into the willBeRemovedFromTree functions.
+        The willBeRemovedFromTree replaced the willBeDestroyed functions in the
+        2 classes as the invalidation really represented tree removal updates,
+        not death updates.
+
 2012-08-24  Joshua Netterfield  <[email protected]>
 
         [BlackBerry] Extend LayerFilterRenderer in preparation for CSS Shaders

Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (126589 => 126590)


--- trunk/Source/WebCore/rendering/RenderTableCell.cpp	2012-08-24 15:40:53 UTC (rev 126589)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp	2012-08-24 16:37:54 UTC (rev 126590)
@@ -52,16 +52,12 @@
 {
 }
 
-void RenderTableCell::willBeDestroyed()
+void RenderTableCell::willBeRemovedFromTree()
 {
-    RenderTableSection* recalcSection = parent() ? section() : 0;
+    RenderBlock::willBeRemovedFromTree();
 
-    RenderBlock::willBeDestroyed();
-
-    if (recalcSection) {
-        recalcSection->setNeedsCellRecalc();
-        recalcSection->removeCachedCollapsedBorders(this);
-    }
+    section()->setNeedsCellRecalc();
+    section()->removeCachedCollapsedBorders(this);
 }
 
 unsigned RenderTableCell::colSpan() const

Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (126589 => 126590)


--- trunk/Source/WebCore/rendering/RenderTableCell.h	2012-08-24 15:40:53 UTC (rev 126589)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h	2012-08-24 16:37:54 UTC (rev 126590)
@@ -173,7 +173,7 @@
 
     virtual bool isTableCell() const { return true; }
 
-    virtual void willBeDestroyed();
+    virtual void willBeRemovedFromTree() OVERRIDE;
 
     virtual void computeLogicalWidth();
 

Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (126589 => 126590)


--- trunk/Source/WebCore/rendering/RenderTableRow.cpp	2012-08-24 15:40:53 UTC (rev 126589)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp	2012-08-24 16:37:54 UTC (rev 126590)
@@ -46,14 +46,11 @@
     setInline(false);   // our object is not Inline
 }
 
-void RenderTableRow::willBeDestroyed()
+void RenderTableRow::willBeRemovedFromTree()
 {
-    RenderTableSection* recalcSection = section();
-    
-    RenderBox::willBeDestroyed();
-    
-    if (recalcSection)
-        recalcSection->setNeedsCellRecalc();
+    RenderBox::willBeRemovedFromTree();
+
+    section()->setNeedsCellRecalc();
 }
 
 void RenderTableRow::updateBeforeAndAfterContent()

Modified: trunk/Source/WebCore/rendering/RenderTableRow.h (126589 => 126590)


--- trunk/Source/WebCore/rendering/RenderTableRow.h	2012-08-24 15:40:53 UTC (rev 126589)
+++ trunk/Source/WebCore/rendering/RenderTableRow.h	2012-08-24 16:37:54 UTC (rev 126590)
@@ -90,7 +90,7 @@
 
     virtual bool isTableRow() const { return true; }
 
-    virtual void willBeDestroyed();
+    virtual void willBeRemovedFromTree() OVERRIDE;
 
     virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
     virtual void layout();

Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (126589 => 126590)


--- trunk/Source/WebCore/rendering/RenderTableSection.cpp	2012-08-24 15:40:53 UTC (rev 126589)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp	2012-08-24 16:37:54 UTC (rev 126590)
@@ -189,12 +189,6 @@
     toRenderTableRow(child)->updateBeforeAndAfterContent();
 }
 
-void RenderTableSection::removeChild(RenderObject* oldChild)
-{
-    setNeedsCellRecalc();
-    RenderBox::removeChild(oldChild);
-}
-
 void RenderTableSection::ensureRows(unsigned numRows)
 {
     if (numRows <= m_grid.size())

Modified: trunk/Source/WebCore/rendering/RenderTableSection.h (126589 => 126590)


--- trunk/Source/WebCore/rendering/RenderTableSection.h	2012-08-24 15:40:53 UTC (rev 126589)
+++ trunk/Source/WebCore/rendering/RenderTableSection.h	2012-08-24 16:37:54 UTC (rev 126590)
@@ -210,8 +210,6 @@
 
     virtual void layout();
 
-    virtual void removeChild(RenderObject* oldChild);
-
     virtual void paintCell(RenderTableCell*, PaintInfo&, const LayoutPoint&);
     virtual void paintObject(PaintInfo&, const LayoutPoint&);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to