Bug 139446 - Blocks that create a new block formatting context are not self-collapsing.
Summary: Blocks that create a new block formatting context are not self-collapsing.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Javier Fernandez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-09 07:07 PST by Javier Fernandez
Modified: 2014-12-18 05:45 PST (History)
10 users (show)

See Also:


Attachments
Patch (6.56 KB, patch)
2014-12-09 07:27 PST, Javier Fernandez
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-mountainlion (1.56 MB, application/zip)
2014-12-09 08:12 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 (862.83 KB, application/zip)
2014-12-09 08:37 PST, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Fernandez 2014-12-09 07:07:47 PST
Blocks that create a new block formatting context are not self-collapsing.

Per http://www.w3.org/TR/CSS2/box.html#collapsing-margins the top and bottom margins of a block that has no content and otherwise no height of its own can only collapse together if the box doesn't establish a block formatting context.

We already have a function that detects when a block is creating a new block formatting context, so let's use it to detect when we shouldn't collapse margins.
Comment 1 Javier Fernandez 2014-12-09 07:27:22 PST
Created attachment 242918 [details]
Patch
Comment 2 Build Bot 2014-12-09 08:12:20 PST
Comment on attachment 242918 [details]
Patch

Attachment 242918 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/4624583579664384

New failing tests:
fast/multicol/span/span-margin-collapsing.html
Comment 3 Build Bot 2014-12-09 08:12:24 PST
Created attachment 242921 [details]
Archive of layout-test-results from ews100 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 4 Build Bot 2014-12-09 08:37:06 PST
Comment on attachment 242918 [details]
Patch

Attachment 242918 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5145176028741632

New failing tests:
fast/multicol/span/span-margin-collapsing.html
Comment 5 Build Bot 2014-12-09 08:37:09 PST
Created attachment 242925 [details]
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-13  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 6 Darin Adler 2014-12-09 08:58:44 PST
(In reply to comment #4)
> New failing tests:
> fast/multicol/span/span-margin-collapsing.html

Lets deal with this before reviewing the patch. Maybe clear the review flag until then?
Comment 7 Javier Fernandez 2014-12-10 03:37:21 PST
Comment on attachment 242918 [details]
Patch

yeah, let's clear the review flag while I'm investigating why it affects the multicolumn tests.
Comment 8 Javier Fernandez 2014-12-10 04:29:34 PST
(In reply to comment #6)
> (In reply to comment #4)
> > New failing tests:
> > fast/multicol/span/span-margin-collapsing.html
> 
> Lets deal with this before reviewing the patch. Maybe clear the review flag
> until then?

According to the specs (http://dev.w3.org/csswg/css-multicol/#valuedef-all): 

"The element spans across all columns of the nearest multicol ancestor in the same block formatting context. The element spans across all columns. Content in the normal flow that appears before the element is automatically balanced across all columns before the element appears. **The element establishes a new block formatting context**."

Elements creating a new formatting context should not be self-collapsing elements, so I think we would need to rebaseline this test.
Comment 9 Javier Fernandez 2014-12-18 05:45:00 PST
Any feedback on this ?