Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6027938cff0831f4fd66de6283fc8b7e5cf8d457
https://github.com/WebKit/WebKit/commit/6027938cff0831f4fd66de6283fc8b7e5cf8d457
Author: Alan Baradlay <[email protected]>
Date: 2026-04-27 (Mon, 27 Apr 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/stretch/stretch-block-size-003-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/stretch/stretch-inline-size-003-expected.txt
M Source/WebCore/rendering/PositionedLayoutConstraints.cpp
M Source/WebCore/rendering/PositionedLayoutConstraints.h
Log Message:
-----------
Fix
imported/w3c/web-platform-tests/css/css-sizing/stretch/stretch-block-size-003.html
https://bugs.webkit.org/show_bug.cgi?id=313286
Reviewed by Antti Koivisto.
webkit.org/b/313094 fixed the case where an abspos child is orthogonal to its
containing
block and the parent's axis direction is flipped (e.g. containing
block=horizontal-tb,
parent=vertical-rl, child=vertical-lr).
The fix asked "is the parent flipped?" to decide which edge
the static distance points to.
This change expands on that fix by asking if the containing block is also
flipped.
For example, containing block=vertical-rl, parent=horizontal-tb,
child=vertical-rl:
the child and containing block are parallel (both vertical-rl), but the parent
is
orthogonal.
The parent lays out children left-to-right, while the containing
block's block direction is right-to-left. The static distance from the parent
points to the left edge, which is block-end for the vertical-rl containing
block.
Putting that distance on block-start collapsed the inset-modified containing
range to zero, making block-size:stretch resolve to 0.
The question is: "do the parent and containing block agree on the direction
for this physical axis?" If they agree, the static distance points to the min
edge (insetBefore). If they disagree, it points to the max edge (insetAfter).
This is expressed as isParentOpposingContainingBlock(), which compares whether
each writing mode is flipped on the physical axis being sized. It works for both
orthogonal and parallel child/containing-block cases, replacing the old
isOrthogonalWithParentFlippedAxis() for the shouldUseInsetBefore decision.
isOrthogonalToContainingBlockWithFlippedParent() (renamed from
isOrthogonalWithParentFlippedAxis) is still used for the margin swap in
captureInsets, because when the child and containing block are parallel their
logical margins already match - no swap needed.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/stretch/stretch-block-size-003-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/stretch/stretch-inline-size-003-expected.txt:
* Source/WebCore/rendering/PositionedLayoutConstraints.cpp:
(WebCore::PositionedLayoutConstraints::PositionedLayoutConstraints):
(WebCore::isFlippedOnAxis):
(WebCore::PositionedLayoutConstraints::isOrthogonalToContainingBlockWithFlippedParent
const):
(WebCore::PositionedLayoutConstraints::isParentOpposingContainingBlock const):
(WebCore::PositionedLayoutConstraints::captureInsets):
(WebCore::PositionedLayoutConstraints::computeStaticPosition):
(WebCore::PositionedLayoutConstraints::fixupLogicalLeftPosition const):
(WebCore::PositionedLayoutConstraints::adjustLogicalTopWithLogicalHeightIfNeeded
const):
(WebCore::PositionedLayoutConstraints::isOrthogonalWithParentFlippedAxis
const): Deleted.
* Source/WebCore/rendering/PositionedLayoutConstraints.h:
Canonical link: https://commits.webkit.org/312086@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications