Bug 122754 - [New Multicolumn] Child top margin sometimes ignored for column balancing
Summary: [New Multicolumn] Child top margin sometimes ignored for column balancing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Morten Stenshorne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-14 08:10 PDT by Morten Stenshorne
Modified: 2014-08-27 12:47 PDT (History)
7 users (show)

See Also:


Attachments
Test case (550 bytes, text/html)
2013-10-14 08:11 PDT, Morten Stenshorne
no flags Details
Patch (14.23 KB, patch)
2014-03-28 09:16 PDT, Morten Stenshorne
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Morten Stenshorne 2013-10-14 08:10:45 PDT
During the first layout pass, the code incorrectly believes that the element ends up in the next column (or page), and eats the margin. Apart from broken layout, this may even cause an assertion failure:

ASSERTION FAILED: currentMinSpaceShortage != LayoutUnit::max()
../../Source/WebCore/rendering/RenderMultiColumnSet.cpp(112) : bool WebCore::RenderMultiColumnSet::calculateBalancedHeight(bool)

... because the column heights don't become tall enough in the initial balancing pass.
Comment 1 Morten Stenshorne 2013-10-14 08:11:58 PDT
Created attachment 214152 [details]
Test case
Comment 2 Morten Stenshorne 2014-03-28 08:46:41 PDT
Corresponding bug in Blink: http://code.google.com/p/chromium/issues/detail?id=353587
Comment 3 Morten Stenshorne 2014-03-28 09:16:54 PDT
Created attachment 228054 [details]
Patch
Comment 4 Morten Stenshorne 2014-03-28 09:18:22 PDT
@dave - can you review this, please? I couldn't really avoid fixing this one while working on spanners support.
Comment 5 Dave Hyatt 2014-04-04 11:19:44 PDT
Comment on attachment 228054 [details]
Patch

r=me
Comment 6 WebKit Commit Bot 2014-04-08 11:20:14 PDT
Comment on attachment 228054 [details]
Patch

Clearing flags on attachment: 228054

Committed r166938: <http://trac.webkit.org/changeset/166938>
Comment 7 WebKit Commit Bot 2014-04-08 11:20:17 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Andy Mercer 2014-05-19 12:42:47 PDT
This was landed back in April, but it appears to still be broken. See:

http://stackoverflow.com/questions/23745077/block-elements-inside-multicolumn-layout-padding-issue-in-chrome-ie

http://jsfiddle.net/6cVqZ/
Comment 9 Morten Stenshorne 2014-08-27 12:47:58 PDT
That's unrelated to this bug, but it seems that someone answered your stackoverflow question while I was gone. The clue is to use break-inside:avoid . This property doesn't yet exist in Blink, though (and I assume the same is still the case for WebKit as well). You have to say li { -webkit-column-break-inside:avoid; } instead.