Bug 218579 - [Interop 2021][css-flexbox] flex item margins not included in flex container overflow
Summary: [Interop 2021][css-flexbox] flex item margins not included in flex container ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: https://github.com/w3c/csswg-drafts/i...
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on:
Blocks: 212046
  Show dependency treegraph
Reported: 2020-11-04 11:51 PST by fantasai
Modified: 2023-06-21 23:05 PDT (History)
9 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description fantasai 2020-11-04 11:51:49 PST
Spec requires flex item margins (and the flex container's padding) to be included in the flex container's overflow area.
This is tested in 
and it definitely bugs authors. (The spec bugs about including margins/padding were some of the most flagged issues in the CSSWG repo.)
Comment 1 Radar WebKit Bug Importer 2020-11-04 12:08:26 PST
Comment 2 Tim Nguyen (:ntim) 2022-10-05 20:50:09 PDT
    if (isGridItem()) {
        // As per https://github.com/w3c/csswg-drafts/issues/3653, child's margins should contribute to the scrollable overflow area.
        // FIXME: Expand it to non-grid cases when applicable.
        rect.setWidth(rect.width() + std::max(0_lu, marginEnd()));

in RenderBox::layoutOverflowRectForPropagation is a good first place to look at.