Bug 253610
| Summary: | [margin-trim] Trimmed block-end margins for block-level boxes in a block container should be reflected in computed style | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sammy Gill <sgill26> |
| Component: | CSS | Assignee: | Sammy Gill <sgill26> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://github.com/web-platform-tests/wpt/pull/39673 | ||
| Bug Depends on: | |||
| Bug Blocks: | 253454, 255736 | ||
Sammy Gill
The web inspector shows the untrimmed margins for a box even if has been trimmed by the containing block's margin-trim property.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/106454992>
Sammy Gill
This scenario is actually slightly more tricky than the block-start one.
By the time we get to the end of the block container, we have propagated some margin information from the top that will be used to determine the final margin of the block container. At this point we actually haven’t trimmed any of the block-end margins of the children (the m_marginBox in the renderer still contains the used value of the margin), but we only consider the propagated value to update/trim the block containers block-end margin.
I think in order for this to be correct, we need to walk back up the container's children and trim the block-end margins (and block-start if the child is self collapsing) until we get to a child that is not self collapsing.
I think this means that we also need to update the position for the self-collapsing children, which may be just below the first non self-collapsing child.
Sammy Gill
Pull request: https://github.com/WebKit/WebKit/pull/12977
Sammy Gill
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/39673
EWS
Committed 263398@main (e44bd7f346a1): <https://commits.webkit.org/263398@main>
Reviewed commits have been landed. Closing PR #12977 and removing active labels.