Changeset 287064 in webkit
- Timestamp:
- Dec 15, 2021 1:03:52 AM (7 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/position-absolute-014-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r287063 r287064 1 2021-12-13 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Absolutely positioned children should be aligned using the margin box 4 https://bugs.webkit.org/show_bug.cgi?id=234244 5 6 Reviewed by Darin Adler. 7 8 * web-platform-tests/css/css-flexbox/abspos/position-absolute-014-expected.txt: Replaced FAIL 9 by PASS expectations. 10 1 11 2021-12-14 Joonghun Park <jh718.park@samsung.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/position-absolute-014-expected.txt
r272644 r287064 1 1 aaa bbb aaa bbb aaa bbb 2 2 3 FAIL The bottom of each pair of boxes should be the same assert_equals: expected 166 but got 106 3 PASS The bottom of each pair of boxes should be the same 4 4 -
trunk/Source/WebCore/ChangeLog
r287063 r287064 1 2021-12-13 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Absolutely positioned children should be aligned using the margin box 4 https://bugs.webkit.org/show_bug.cgi?id=234244 5 6 Reviewed by Darin Adler. 7 8 When aligning absolutely positioned children we must use the child's margin box. We were 9 using the border box instead, and thus ignoring margins when aligning absolutely positioned 10 flexbox children. 11 12 This fixes position-absolute-014.html from the WPT suite. 13 14 * rendering/RenderFlexibleBox.cpp: 15 (WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild): Removed the !isOutOfFlowPositioned() 16 ASSERT. It's true that in the past it was called only from code dealing with flex items but the code 17 implementing the function does not really have that restriction at all. 18 (WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild): Directly call 19 availableAlignmentSpaceForChild() as it already uses the margin box. 20 1 21 2021-12-14 Joonghun Park <jh718.park@samsung.com> 2 22 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r286654 r287064 1225 1225 LayoutUnit RenderFlexibleBox::availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, const RenderBox& child) 1226 1226 { 1227 ASSERT(!child.isOutOfFlowPositioned());1228 1227 LayoutUnit childCrossExtent = crossAxisMarginExtentForChild(child) + crossAxisExtentForChild(child); 1229 1228 return lineCrossAxisExtent - childCrossExtent; … … 1685 1684 LayoutUnit RenderFlexibleBox::staticCrossAxisPositionForPositionedChild(const RenderBox& child) 1686 1685 { 1687 LayoutUnit availableSpace = crossAxisContentExtent() - crossAxisExtentForChild(child);1686 auto availableSpace = availableAlignmentSpaceForChild(crossAxisContentExtent(), child); 1688 1687 return alignmentOffset(availableSpace, alignmentForChild(child), 0_lu, 0_lu, style().flexWrap() == FlexWrap::Reverse); 1689 1688 }
Note: See TracChangeset
for help on using the changeset viewer.