[Webkit-unassigned] [Bug 242107] margin collapsing, zero-height line box containing margin-inline

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 4 21:55:58 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=242107

Sam Sneddon [:gsnedders] <gsnedders at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bfulgham at webkit.org,
                   |                            |gsnedders at apple.com,
                   |                            |simon.fraser at apple.com,
                   |                            |zalan at apple.com
          Component|CSS                         |Layout and Rendering
            Summary|margin-left display br      |margin collapsing,
                   |                            |zero-height line box
                   |                            |containing margin-inline

--- Comment #1 from Sam Sneddon [:gsnedders] <gsnedders at apple.com> ---
This is really just:

<div><span style="margin-left: 5px;"></span></div>
<div style="margin-top: 20px;">hello</div>

And the lack of interop is whether the margin of the second div collapses through the first zero-height div into the body.

Relevantly:

> Line boxes that contain no text, no preserved white space, no inline elements with non-zero margins, padding, or borders, and no other in-flow content (such as images, inline blocks or inline tables), and do not end with a preserved newline must be treated as zero-height line boxes for the purposes of determining the positions of any elements inside of them, and must be treated as not existing for any other purpose.

This implies the line box from the span is just a zero-height line box and it does exist for all purposes (because it contains an inline element with a non-zero margin). This then means that the margins cannot be adjoining (as there is a zero-height line box separating them).

We do seem to match Firefox here, which to me makes me wonder if this was a deliberate change in LayoutNG for Chrome…

It might be worth reporting this to Chrome, to see if they believe this is a deliberate change in behaviour and how they justify this v. the spec (or if they've filed an issue I can't find).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220705/372d0ca0/attachment.htm>


More information about the webkit-unassigned mailing list