haikuwebkit/LayoutTests/fast/multicol/floating-boxes-moved-under-...

30 lines
663 B
HTML
Raw Permalink Normal View History

[RenderTreeBuilder] Subtree moving should clear the floats on all the descendants https://bugs.webkit.org/show_bug.cgi?id=224996 <rdar://76837320> Reviewed by Antti Koivisto. Source/WebCore: While moving a subtree, we invalidate the floating object list so that we don't end up with incorrectly placed floats (they'll get regenerated during the subsequent layout). A float can be "assigned" to more than one RenderBlockFlow (e.g intruding floats). It's very common that a set of descendant RenderBlockFlow renderers "see" the same set of floats (each RenderBlockFlow has its own list of floating objects). Now the invalidation is based on ancestor-to-descendant direction starting with finding the outer most containing block for a particular float (see outermostBlockContainingFloatingObject) The invalidation logic also expects no gaps in the ancestor chain e.g. RenderBlockFlow (A) -> float X RenderBlockFlow (B) -> float X RenderBlockFlow (C) -> float X if float X is assigned to both A and C, then it must be assigned to B as well. RenderBlockFlow::removeFloatingObjects() simply removes the float from the renderer. It does not invalidate the ancestor/descendant chain. e.g. calling B.removeFloatingObjects() would just remove float X from RenderBlockFlow (B) RenderBlockFlow (A) -> float X RenderBlockFlow (B) RenderBlockFlow (C) -> float X and any subsequent invalidation attempt would fail to clear up A or C (depending on whether it is initiated on A or C). Test: fast/multicol/floating-boxes-moved-under-multi-column.html * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::moveChildren): LayoutTests: * fast/multicol/floating-boxes-moved-under-multi-column-expected.txt: Added. * fast/multicol/floating-boxes-moved-under-multi-column.html: Added. Canonical link: https://commits.webkit.org/236989@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276549 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-24 13:42:04 +00:00
<!DOCTYPE html>
<style>
:focus-within {
column-width: 1px;
width: 0;
}
:nth-last-child(3) {
margin-block-end: 1px;
float: right;
}
:nth-last-child(3)::first-letter {
background: grey;
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsText();
onload = () => {
document.body.appendChild(document.createElement('span'));
document.body.appendChild(document.createElement('div'));
document.body.appendChild(document.createElement('span'));
document.designMode = 'on';
document.execCommand('SelectAll');
document.body.appendChild(document.createElement('div'));
};
</script>
<body>
</body>