Commit 96d44249 authored by mstensho's avatar mstensho Committed by Commit bot

Record space shortage that prevented an object from fitting in one column.

The breakability of the object doesn't matter here. The space shortage that
prevented an object from fitting in one column may very well be the lowest
space shortage that we'll ever find. So always record it, to avoid
over-stretching columns.

BUG=559133
R=leviw@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#361232}
parent 8e976c6f
<!DOCTYPE html>
<script src="../../resources/check-layout.js"></script>
<style>
.multicol { -webkit-columns:2; -webkit-column-gap:0; position:relative; width:200px; background:blue; }
.multicol * { -webkit-column-break-inside:avoid; height:100px; background:white; }
</style>
<p>There should be a blue square below.</p>
<div class="multicol" data-expected-height="200">
<div data-offset-x="0" data-offset-y="0"></div>
<div data-offset-x="0" data-offset-y="100"></div>
<div data-offset-x="100" data-offset-y="0"></div>
</div>
<script>
checkLayout(".multicol");
</script>
......@@ -246,11 +246,9 @@ void MinimumSpaceShortageFinder::examineBoxAfterEntering(const LayoutBox& box)
if (isFirstAfterBreak && !box.hasForcedBreakBefore()) {
// This box is first after a soft break.
LayoutUnit strut = box.paginationStrut();
if (breakability == LayoutBox::ForbidBreaks) {
// Since we cannot break inside the box, just figure out how much more space we would
// need to prevent it from being pushed to the next column.
// Figure out how much more space we would need to prevent it from being pushed to the next column.
recordSpaceShortage(box.logicalHeight() - strut);
} else if (m_pendingStrut == LayoutUnit::min()) {
if (breakability != LayoutBox::ForbidBreaks && m_pendingStrut == LayoutUnit::min()) {
// We now want to look for the first piece of unbreakable content (e.g. a line or a
// block-displayed image) inside this block. That ought to be a good candidate for
// minimum space shortage; a much better one than reporting space shortage for the
......
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