Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4cc51a81856e55a778f0322563b2a45d901b0eb6
https://github.com/WebKit/WebKit/commit/4cc51a81856e55a778f0322563b2a45d901b0eb6
Author: Alan Baradlay <[email protected]>
Date: 2026-10-12 (Mon, 12 Oct 2026)
Changed paths:
M Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp
Log Message:
-----------
[Flex] Out-of-flow children of column flex containers are laid out twice on
every layout
https://bugs.webkit.org/show_bug.cgi?id=327155
<rdar://problem/189746052>
Reviewed by Antti Koivisto.
<div style="display: flex; flex-direction: column; position: relative;
border-top: 10px solid">
<div>item</div>
<div style="position: absolute"></div>
</div>
The abspos child should be laid out only when something it depends on changes.
Instead it was laid out twice on every
layout of the flex container.
Before layout, prepareOutOfFlowBoxForPositionedLayout estimates the static
position from the flow-aware start and
before border and padding. For a column those belong to the other axis, so the
estimate never matched the position
setStaticPositionForPositionedLayout computes after layout, and
RenderBlock::layoutOutOfFlowBox laid the child out at
the estimate and then again at the real position.
Start the estimate from the content-box corner the real static position is
measured from, startOffsetForContent() and
borderAndPaddingBefore(). Final positions don't change, so there is no new
test; css-flexbox/abspos covers them.
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::prepareOutOfFlowBoxForPositionedLayout):
Canonical link: https://commits.webkit.org/323474@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications