Table cell's anonymous wrappers are left in the tree, impacting our layout
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 19:02:36 +0000 (19:02 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 19:02:36 +0000 (19:02 +0000)
commit5891551fdd23028595b7f70171f9712a74d8edfc
tree4f09dec0d2022a34f48aed5c40b4aa556295c092
parent130d595e71a038158907f6e64c710f3dc13be085
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
LayoutTests/ChangeLog
LayoutTests/fast/table/table-switch-cell-position-bad-layout-expected.html [new file with mode: 0644]
LayoutTests/fast/table/table-switch-cell-position-bad-layout.html [new file with mode: 0755]
Source/WebCore/ChangeLog
Source/WebCore/dom/Node.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h