Bug 255736 - [margin-trim][block layout] self-collapsing children at block-end don't have nested content trimmed
Summary: [margin-trim][block layout] self-collapsing children at block-end don't have ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sammy Gill
URL:
Keywords: InRadar
Depends on: 253610
Blocks: 253454
  Show dependency treegraph
 
Reported: 2023-04-20 10:52 PDT by Sammy Gill
Modified: 2023-04-26 15:36 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sammy Gill 2023-04-20 10:52:45 PDT
If you have a block structure that is something similar to the following:

<container>
    <item style="margin-bottom: 10px"></item>
    <item style="margin-bottom: 10px; height: 0px;">
        <item style="margin-bottom: 10px; height: 0px;">
            <item style="margin-bottom: 10px; height: 0px;">
                <item style="margin-bottom: 10px; height: 0px;"></item>
                <item style="margin-bottom: 10px; height: 0px;"></item>
            </item>
        </item>
    </item>
</container>

We currently trim the last child, which is self collapsing, and its margins correctly, but none of the children nested within it are trimmed. Since these are at the block-end and we trim  the margins that are collapsed through for the container, none of the inner margins end up participating in margin collapsing with the container's margin and renderings look correct. However, with the tests added as a part of 253610 we can actually see that these margins are not trimmed by looking at the computed style values.
Comment 1 Radar WebKit Bug Importer 2023-04-20 10:53:51 PDT
<rdar://problem/108327029>
Comment 2 Sammy Gill 2023-04-20 11:10:57 PDT
Pull request: https://github.com/WebKit/WebKit/pull/12982
Comment 3 Sammy Gill 2023-04-24 20:52:48 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/39674
Comment 4 EWS 2023-04-26 15:36:20 PDT
Committed 263439@main (809b95bb1a78): <https://commits.webkit.org/263439@main>

Reviewed commits have been landed. Closing PR #12982 and removing active labels.