Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r184885 - Overhanging float sets are not cleaned up properly wh…
…en floating renderer is destroyed. https://bugs.webkit.org/show_bug.cgi?id=145323 rdar://problem/20980628 Reviewed by Dave Hyatt. This patch ensures when an overhanging float renderer is destroyed, all the sibling containers' floating object set(m_floatingObjects) gets properly cleaned up. When an overhanging float is present, we cache the renderer on the parent and on the affected sibling containers too. (RenderBlockFlow::m_floatingObjects) These caches(sets) get cleared and repopulated during ::layout(). In order to have a float renderer removed from a set, a layout needs to be initiated on the container. This is normally done through RenderBlockFlow::markSiblingsWithFloatsForLayout() and RenderBlockFlow::markAllDescendantsWithFloatsForLayout(). However, when the float container's parent's writing direction changes (and we promote the children containers to new formatting contexts), the layout propagation through siblings does not work anymore. The avoidsFloats() check in RenderBlockFlow::markSiblingsWithFloatsForLayout() has very little performance gain, but it prevents us from propagating layout to siblings when certain properties of the parent container changes. Source/WebCore: Test: fast/block/float/crash-when-floating-object-is-removed.xhtml * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout): * rendering/RenderBox.cpp: (WebCore::outermostBlockContainingFloatingObject): (WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists): (WebCore::RenderBox::outermostBlockContainingFloatingObject): Deleted. * rendering/RenderBox.h: LayoutTests: * fast/block/float/crash-when-floating-object-is-removed-expected.txt: Added. * fast/block/float/crash-when-floating-object-is-removed.xhtml: Added.
- Loading branch information
1 parent
d70b147
commit 7f071a9
Showing
7 changed files
with
107 additions
and
8 deletions.
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
1 change: 1 addition & 0 deletions
1
LayoutTests/fast/block/float/crash-when-floating-object-is-removed-expected.txt
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 @@ | ||
PASS if no crash or ASSERT in debug. |
45 changes: 45 additions & 0 deletions
45
LayoutTests/fast/block/float/crash-when-floating-object-is-removed.xhtml
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,45 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>This tests that sets for overhanging floating objects are cleaned up properly when the floating object is destroyed.</title> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
</script> | ||
<style> | ||
html { | ||
position: absolute; | ||
} | ||
|
||
.float { | ||
float: left; | ||
} | ||
</style> | ||
</head> | ||
<head id="head1" style="-webkit-writing-mode: horizontal-bt;"></head> | ||
|
||
<i> | ||
<button id="button1">PASS if no crash or ASSERT in debug.</button> | ||
</i> | ||
<td id="td1"> | ||
<body></body> | ||
</td> | ||
<i></i> | ||
|
||
<script> | ||
var docElement = document.documentElement; | ||
function crash() { | ||
button1 = document.getElementById("button1"); | ||
button1.classList.toggle("float"); | ||
|
||
head1 = document.getElementById("head1"); | ||
td1 = document.getElementById("td1"); | ||
head1.appendChild(td1); | ||
|
||
docElement.offsetTop; | ||
head1.style.display = "list-item"; | ||
docElement.offsetTop; | ||
button1.classList.toggle("float"); | ||
} | ||
document.addEventListener("DOMContentLoaded", crash, false); | ||
</script> | ||
</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