Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Table cell's anonymous wrappers are left in the tree, impacting our l…
…ayout 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: svn://svn.chromium.org/blink/trunk@108098 bbb929c8-8fbe-4397-9dbb-9b2b20218538
- Loading branch information
jchaffraix@webkit.org
committed
Feb 17, 2012
1 parent
ba7bf10
commit f80fa07
Showing
7 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...d_party/WebKit/LayoutTests/fast/table/table-switch-cell-position-bad-layout-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<p>Bug <a href="https://bugs.webkit.org/show_bug.cgi?id=7180">7180</a>: Table cell's anonymous wrappers are left in the tree, impacting our layout.</p> | ||
<p>There should be no red in the output.</p> | ||
<div style="width: 200px; height: 200px; background-color: green"></div> | ||
</body> | ||
</html> |
37 changes: 37 additions & 0 deletions
37
third_party/WebKit/LayoutTests/fast/table/table-switch-cell-position-bad-layout.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
table { | ||
background-color: red; | ||
border-spacing: 0px; | ||
} | ||
td { | ||
background-color: green; | ||
height: 100px; | ||
padding: 0px; | ||
width: 200px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Bug <a href="https://bugs.webkit.org/show_bug.cgi?id=7180">7180</a>: Table cell's anonymous wrappers are left in the tree, impacting our layout.</p> | ||
<p>There should be no red in the output.</p> | ||
<table> | ||
<tr> | ||
<td id="togglePosition"></td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
</tr> | ||
</table> | ||
<script> | ||
var element = document.getElementById("togglePosition"); | ||
element.style.position = "absolute"; | ||
|
||
element.offsetWidth; | ||
|
||
element.style.position = "static"; | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters