Commit 8a595029 authored by mstensho@opera.com's avatar mstensho@opera.com

Never move unbreakable blocks that are at the top of a column / page.

That's just going to leave a column / page blank, without fitting any content
better. If the block is too tall to fit in the current column / page, it's
going to be just as too tall for the next one as well.

BUG=526098
R=jchaffraix@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@201732 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ce8026a9
<!DOCTYPE html>
<p>Test that an unbreakable block at the top of a column that's too tall for the column isn't moved
to the next column, since that would just leave one column completely blank.</p>
<p>There should be a blimp below.</p>
<div style="float:right; width:50%; height:100px; overflow:hidden;">
<img src="resources/blimp.png" style="display:block; height:101px;">
</div>
<!DOCTYPE html>
<p>Test that an unbreakable block at the top of a column that's too tall for the column isn't moved
to the next column, since that would just leave one column completely blank.</p>
<p>There should be a blimp below.</p>
<div style="-webkit-columns:2; -webkit-column-gap:0; column-fill:auto; height:100px; overflow:hidden;">
<div style="height:100px;"></div>
<img src="resources/blimp.png" style="display:block; height:101px;">
</div>
......@@ -857,7 +857,9 @@ LayoutUnit LayoutBlockFlow::adjustForUnsplittableChild(LayoutBox& child, LayoutU
if (!pageLogicalHeight)
return logicalOffset;
LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, AssociateWithLatterPage);
if (remainingLogicalHeight < childLogicalHeight)
// Break if there's not enough space left for us, but only as long as we're not already at the
// top of a page. No point in leaving a page completely blank.
if (remainingLogicalHeight < childLogicalHeight && remainingLogicalHeight < pageLogicalHeight)
return logicalOffset + remainingLogicalHeight;
return logicalOffset;
}
......
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