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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 5 09:47:58 PDT 2022


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

--- Comment #2 from zalan <zalan at apple.com> ---
(In reply to Sam Sneddon [:gsnedders] from comment #1)
> 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).
I'd think it's just an "inline box" specific bug on their side as if you replace the inline box with a regular (non-inline box) inline level box, vertical margins show as expected.

-- 
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/29da72ab/attachment.htm>


More information about the webkit-unassigned mailing list