Commit f7a8d843 authored by mstensho@opera.com's avatar mstensho@opera.com

Ignore continuations when collapsing an anonymous block.

When we decide to promote all children of an anonymous block and then
nuke it, ignore any continuation set on the new parent of the children,
to make sure that the children are in fact inserted as children of said
new parent, and not somewhere else in the tree.

This is a hack that's needed as long as we keep the old multicol
implementation. The root cause is probably buggy block continuation
handling, but fixing that would be risky.

BUG=421720

Review URL: https://codereview.chromium.org/656143003

git-svn-id: svn://svn.chromium.org/blink/trunk@183823 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 982b833a
PASS if no crash.
After initial layout: A multicol has a column-span:all descendant (not a direct child, so that we establish block continuations and anonymous multi-column blocks)
Turn a child of this multicol container into a multicol
Add another column-span:all descendant (again, not a direct child, so that we get more continuations)
Set display:none on everything
<!DOCTYPE html>
<script>
if (window.testRunner)
testRunner.dumpAsText();
onload = function() {
document.body.offsetTop;
document.getElementById('wine').style.WebkitColumns = '2';
document.body.offsetTop;
document.getElementById('spanner1').style.display = 'block';
document.body.offsetTop;
document.getElementById('container').style.display = 'none';
}
</script>
<div id="container" style="-webkit-columns:2;">
<div id="wine">
<div id="beer">
<div id="strength"></div>
<div id="spanner1" style="display:none; -webkit-column-span:all;"></div>
</div>
<div id="wisdom"></div>
<div id="beer2">
<div id="wisdom2"></div>
<div id="strength2"></div>
<div style="-webkit-column-span:all;"></div>
</div>
</div>
</div>
<p>PASS if no crash.</p>
<ol>
<li>After initial layout: A multicol has a column-span:all
descendant (not a direct child, so that we establish block
continuations and anonymous multi-column blocks)</li>
<li>Turn a child of this multicol container into a multicol</li>
<li>Add another column-span:all descendant (again, not a direct
child, so that we get more continuations)</li>
<li>Set display:none on everything</li>
</ol>
......@@ -1122,7 +1122,16 @@ void RenderBlock::collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock*
CurrentRenderFlowThreadMaintainer flowThreadMaintainer(childFlowThread);
parent->children()->removeChildNode(parent, child, child->hasLayer());
// FIXME: Get rid of the temporary disabling of continuations. This is needed by the old
// multicol implementation, because of buggy block continuation handling (which is hard and
// rather pointless to fix at this point). Support for block continuations can be removed
// together with the old multicol implementation. crbug.com/408123
RenderBoxModelObject* temporarilyInactiveContinuation = parent->continuation();
if (temporarilyInactiveContinuation)
parent->setContinuation(0);
child->moveAllChildrenTo(parent, nextSibling, child->hasLayer());
if (temporarilyInactiveContinuation)
parent->setContinuation(temporarilyInactiveContinuation);
// Explicitly delete the child's line box tree, or the special anonymous
// block handling in willBeDestroyed will cause problems.
child->deleteLineBoxTree();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment