Blocks that create a new block formatting context are not self-collapsing.
https://bugs.webkit.org/show_bug.cgi?id=139446
Summary Blocks that create a new block formatting context are not self-collapsing.
Javier Fernandez
Reported 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.
Attachments
Patch (6.56 KB, patch)
2014-12-09 07:27 PST, Javier Fernandez
buildbot: commit-queue-
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
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
Javier Fernandez
Comment 1 2014-12-09 07:27:22 PST
Build Bot
Comment 2 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
Build Bot
Comment 3 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
Build Bot
Comment 4 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
Build Bot
Comment 5 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
Darin Adler
Comment 6 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?
Javier Fernandez
Comment 7 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.
Javier Fernandez
Comment 8 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.
Javier Fernandez
Comment 9 2014-12-18 05:45:00 PST
Any feedback on this ?
Ahmad Saleem
Comment 10 2022-07-27 10:15:17 PDT
By taking test case from attached patch and then changing into JSFiddle: Link - https://jsfiddle.net/kuazqvn4/show I am not able to see 'red' to indicate failure in Safari 15.6 on macOS 12.5 but both the browsers do show "red" in various different places. I am not sure whether Safari implementation is accurate or something is wrong with test case or nothing at all. But just wanted to share updated status, please mark this bug accordingly. Thanks!
Radar WebKit Bug Importer
Comment 11 2022-07-27 17:57:29 PDT
Note You need to log in before you can comment on or make changes to this bug.