Table cell's anonymous wrappers are left in the tree, impacting our layout
https://bugs.webkit.org/show_bug.cgi?id=7180
Reviewed by David Hyatt.
Source/WebCore:
Tests: fast/table/table-switch-cell-position-bad-layout-expected.html
fast/table/table-switch-cell-position-bad-layout.html
This patch implements cell's anonymous wrapper removal at detach time.
Trimming the render tree when we remove objects from it would be more complex
to generalize as several objects override the behavior to do their own clean-ups.
This would also open more potential for programming errors.
This change is limited to table cells' as a simple step towards fixing bug 52123
and more generally eliminate some anonymous wrappers from the tree at detach time.
* dom/Node.cpp:
(WebCore::Node::detach):
Patched detach to call destroyAndCleanupAnonymousWrappers. The Document does not need
to clean up any anonymous wrappers on detach.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::destroyAndCleanupAnonymousWrappers):
Added this method to wrap destroy() call and trim the render tree. To avoid slowing down
detach in some cases, added a fast path.
* rendering/RenderObject.h: Added destroyAndCleanupAnonymousWrappers.
LayoutTests:
* fast/table/table-switch-cell-position-bad-layout-expected.html: Added.
* fast/table/table-switch-cell-position-bad-layout.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108098
268f45cc-cd09-0410-ab3c-
d52691b4dbfc