Changeset 287128 in webkit
- Timestamp:
- Dec 16, 2021 3:03:48 AM (7 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/flex-abspos-staticpos-margin-003-expected.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/flex-abspos-staticpos-margin-003.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/position-absolute-015-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderFlexibleBox.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r287121 r287128 1 2021-12-16 Vitaly Dyachkov <obyknovenius@me.com> 2 3 Flexbox ignores margins of absolute positioned children when `align-items: flex-end` or `justify-content: flex-end` 4 https://bugs.webkit.org/show_bug.cgi?id=234143 5 6 Reviewed by Sergio Villar Senin. 7 8 * TestExpectations: Unksipped a flexbox test that is now passing. 9 1 10 2021-12-15 Alex Christensen <achristensen@webkit.org> 2 11 -
trunk/LayoutTests/TestExpectations
r287118 r287128 4240 4240 webkit.org/b/221472 imported/w3c/web-platform-tests/css/css-flexbox/abspos/flex-abspos-staticpos-align-self-safe-001.html [ ImageOnlyFailure ] 4241 4241 webkit.org/b/221472 imported/w3c/web-platform-tests/css/css-flexbox/abspos/flex-abspos-staticpos-fallback-align-content-001.html [ ImageOnlyFailure ] 4242 webkit.org/b/221472 imported/w3c/web-platform-tests/css/css-flexbox/abspos/flex-abspos-staticpos-margin-002.html [ ImageOnlyFailure ]4243 4242 4244 4243 # Tables as flex items. -
trunk/LayoutTests/imported/w3c/ChangeLog
r287127 r287128 1 2021-12-16 Vitaly Dyachkov <obyknovenius@me.com> 2 3 Flexbox ignores margins of absolute positioned children when `align-items: flex-end` or `justify-content: flex-end` 4 https://bugs.webkit.org/show_bug.cgi?id=234143 5 6 Reviewed by Sergio Villar Senin. 7 8 * web-platform-tests/css/css-flexbox/abspos/flex-abspos-staticpos-margin-003-expected.html: Added. 9 * web-platform-tests/css/css-flexbox/abspos/flex-abspos-staticpos-margin-003.html: Added. 10 * web-platform-tests/css/css-flexbox/abspos/position-absolute-015-expected.txt: Replaced FAIL 11 by PASS expectations. 12 1 13 2021-12-16 Joonghun Park <jh718.park@samsung.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/position-absolute-015-expected.txt
r272644 r287128 1 1 2 FAIL #abspos 1 assert_equals: 3 <div style="background: cyan; margin: 20px; position: absolute; width: 30px; height: 40px;" data-offset-x="150" id="abspos"></div> 4 offsetLeft expected 150 but got 190 2 PASS #abspos 1 5 3 -
trunk/Source/WebCore/ChangeLog
r287126 r287128 1 2021-12-16 Vitaly Dyachkov <obyknovenius@me.com> 2 3 Flexbox ignores margins of absolute positioned children when `align-items: flex-end` or `justify-content: flex-end` 4 https://bugs.webkit.org/show_bug.cgi?id=234143 5 6 Reviewed by Sergio Villar Senin. 7 8 When flexbox layouts its children every absolutely-positioned child is processed separately from regular flex items as it were the sole flex item. 9 Absolutely-positioned can be both main- and cross-axis aligned. To correctly align it we first must calculate available space for it. 10 To do that the code was correctly subtracting the size of the item from the size of the container but was not subtracting the margins. 11 Fixed by including the margins into available size calculation. 12 13 Test: imported/w3c/web-platform-tests/css/css-flexbox/abspos/flex-abspos-staticpos-margin-003.html 14 15 * rendering/RenderFlexibleBox.cpp: 16 (WebCore::RenderFlexibleBox::mainAxisMarginExtentForChild const): 17 (WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild): 18 1 19 2021-12-15 Andres Gonzalez <andresg_22@apple.com> 2 20 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r287064 r287128 822 822 ASSERT_NOT_REACHED(); 823 823 return marginTop(); 824 } 825 826 LayoutUnit RenderFlexibleBox::mainAxisMarginExtentForChild(const RenderBox& child) const 827 { 828 if (!child.needsLayout()) 829 return isHorizontalFlow() ? child.horizontalMarginExtent() : child.verticalMarginExtent(); 830 831 LayoutUnit marginStart; 832 LayoutUnit marginEnd; 833 if (isHorizontalFlow()) 834 child.computeInlineDirectionMargins(*this, child.containingBlockLogicalWidthForContentInFragment(nullptr), child.logicalWidth(), marginStart, marginEnd); 835 else 836 child.computeBlockDirectionMargins(*this, marginStart, marginEnd); 837 return marginStart + marginEnd; 824 838 } 825 839 … … 1674 1688 LayoutUnit RenderFlexibleBox::staticMainAxisPositionForPositionedChild(const RenderBox& child) 1675 1689 { 1676 const LayoutUnit availableSpace = mainAxisContentExtent(contentLogicalHeight()) - mainAxisExtentForChild(child); 1690 auto childMainExtent = mainAxisMarginExtentForChild(child) + mainAxisExtentForChild(child); 1691 auto availableSpace = mainAxisContentExtent(contentLogicalHeight()) - childMainExtent; 1677 1692 auto isReverse = isColumnOrRowReverse(); 1678 1693 LayoutUnit offset = initialJustifyContentOffset(style(), availableSpace, 1, isReverse); -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r286654 r287128 141 141 LayoutUnit flowAwareMarginBeforeForChild(const RenderBox& child) const; 142 142 LayoutUnit crossAxisMarginExtentForChild(const RenderBox& child) const; 143 LayoutUnit mainAxisMarginExtentForChild(const RenderBox& child) const; 143 144 LayoutUnit crossAxisScrollbarExtent() const; 144 145 LayoutUnit crossAxisScrollbarExtentForChild(const RenderBox& child) const;
Note: See TracChangeset
for help on using the changeset viewer.