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 https://wpt.fyi/results/css/css-flexbox/overflow-area-001.html?label=experimental&label=master&aligned https://wpt.fyi/results/css/css-flexbox/overflow-area-002.html?label=experimental&label=master&aligned and it definitely bugs authors. (The spec bugs about including margins/padding were some of the most flagged issues in the CSSWG repo.)
<rdar://problem/71046552>
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.