Bug 193346

Summary: [LFC][BFC][MarginCollapsing] Adjust vertical position when box margin collapses through.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch koivisto: review+

Description zalan 2019-01-10 21:41:37 PST
https://www.w3.org/TR/CSS22/box.html#collapsing-margins

If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it. In this case, the position of the element depends on its relationship with the other elements whose margins are being collapsed.

If the element's margins are collapsed with its parent's top margin, the top border edge of the box is defined to be the same as the parent's.
Otherwise, either the element's parent is not taking part in the margin collapsing, or only the parent's bottom margin is involved. The position of the element's top border edge is the same as it would have been if the element had a non-zero bottom border.
Comment 1 zalan 2019-01-10 21:53:52 PST
Created attachment 358876 [details]
Patch
Comment 2 zalan 2019-01-11 07:45:29 PST
Created attachment 358895 [details]
Patch
Comment 3 zalan 2019-01-11 08:19:48 PST
Committed r239863: <https://trac.webkit.org/changeset/239863>
Comment 4 Radar WebKit Bug Importer 2019-01-11 08:20:30 PST
<rdar://problem/47209819>