Changeset 284397 in webkit
- Timestamp:
- Oct 18, 2021 1:50:56 PM (9 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r284387 r284397 1 2021-10-15 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Do not clamp flex base size with {min|max}-{height|width} 4 https://bugs.webkit.org/show_bug.cgi?id=225590 5 <rdar://problem/78100329> 6 7 Reviewed by Manuel Rego Casasnovas. 8 9 * TestExpectations: Unskipped 3 tests that are now passing. 10 1 11 2021-10-18 Tyler Wilcock <tyler_w@apple.com> 2 12 -
trunk/LayoutTests/TestExpectations
r284359 r284397 4163 4163 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/vertical-alignment-srl-040.xht [ ImageOnlyFailure ] 4164 4164 4165 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-012.html [ ImageOnlyFailure ]4166 4165 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-015.html [ ImageOnlyFailure ] 4167 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-007.html [ ImageOnlyFailure ]4168 4166 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-010.html [ ImageOnlyFailure ] 4169 4167 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-005.html [ ImageOnlyFailure ] … … 4191 4189 webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-inflexible-in-column-2.html [ ImageOnlyFailure ] 4192 4190 webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-inflexible-in-row-2.html [ ImageOnlyFailure ] 4193 webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-min-height-1.html [ ImageOnlyFailure ]4194 4191 4195 4192 # SVGs as flex items. -
trunk/Source/WebCore/ChangeLog
r284387 r284397 1 2021-10-15 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Do not clamp flex base size with {min|max}-{height|width} 4 https://bugs.webkit.org/show_bug.cgi?id=225590 5 <rdar://problem/78100329> 6 7 Reviewed by Manuel Rego Casasnovas. 8 9 When computing flex base size we should not clamp it with neither min-{height|width} 10 nor max-{height|width}. That would be done later and will be called the hypothetical 11 main size. 12 13 For most of the cases we were already doing it, however there are some particular cases 14 in which we have to call the generic layout code which does clamp the sizes using min 15 and max sizes. In order to make those code paths work, we reset the min|max values to 16 their initial ones (so they effectively become inactive) and then we set the original 17 values back after computing the base size. 18 19 This is a reland of r279271 which was pretty similar but caused a visual regression in 20 GMail. After r284359 this is no longer a problem of this patch. 21 22 This fixes 3 WPT flexbox tests. 23 24 * rendering/RenderFlexibleBox.cpp: 25 (WebCore::ScopedUnboundedBoxWithFlexBasisAsChildMainSize::ScopedUnboundedBoxWithFlexBasisAsChildMainSize): 26 renamed from ScopedFlexBasisAsChildMainSize. Resets min|max-size to their initial values. 27 (WebCore::ScopedUnboundedBoxWithFlexBasisAsChildMainSize::~ScopedUnboundedBoxWithFlexBasisAsChildMainSize): 28 ditto. Restores min|max-size original values. 29 (WebCore::RenderFlexibleBox::computeFlexBaseSizeForChild): 30 (WebCore::ScopedFlexBasisAsChildMainSize::ScopedFlexBasisAsChildMainSize): Deleted. 31 (WebCore::ScopedFlexBasisAsChildMainSize::~ScopedFlexBasisAsChildMainSize): Deleted. 32 1 33 2021-10-18 Tyler Wilcock <tyler_w@apple.com> 2 34 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r284359 r284397 997 997 } 998 998 999 // This is a RAII class that is used to temporarily set the flex basis as the child size in the main axis. 1000 class ScopedFlexBasisAsChildMainSize { 999 // This is a RAII class that is used to temporarily set the flex basis as the child size in the main axis. Apart from that 1000 // the min|max-size restrictions are ignored for this computation. See https://drafts.csswg.org/css-flexbox/#algo-main-item 1001 // for further details. 1002 class ScopedUnboundedBoxWithFlexBasisAsChildMainSize { 1001 1003 public: 1002 Scoped FlexBasisAsChildMainSize(RenderBox& child, Length flexBasis, bool mainAxisIsInlineAxis)1004 ScopedUnboundedBoxWithFlexBasisAsChildMainSize(RenderBox& child, Length flexBasis, bool mainAxisIsInlineAxis) 1003 1005 : m_child(child) 1006 , m_isHorizontalWritingModeInParallelFlow(mainAxisIsInlineAxis == child.isHorizontalWritingMode()) 1004 1007 , m_mainAxisIsInlineAxis(mainAxisIsInlineAxis) 1005 1008 { 1009 if (m_isHorizontalWritingModeInParallelFlow) { 1010 m_originalMinSize = m_child.style().minWidth(); 1011 m_originalMaxSize = m_child.style().maxWidth(); 1012 m_child.mutableStyle().setMinWidth(RenderStyle::initialMinSize()); 1013 m_child.mutableStyle().setMaxWidth(RenderStyle::initialMaxSize()); 1014 } else { 1015 m_originalMinSize = m_child.style().minHeight(); 1016 m_originalMaxSize = m_child.style().maxHeight(); 1017 m_child.mutableStyle().setMinHeight(RenderStyle::initialMinSize()); 1018 m_child.mutableStyle().setMaxHeight(RenderStyle::initialMaxSize()); 1019 } 1020 1006 1021 if (m_mainAxisIsInlineAxis) { 1007 m_original Length= m_child.style().logicalWidth();1022 m_originalSize = m_child.style().logicalWidth(); 1008 1023 m_child.mutableStyle().setLogicalWidth(Length(flexBasis)); 1009 1024 return; 1010 1025 } 1011 m_original Length= m_child.style().logicalHeight();1026 m_originalSize = m_child.style().logicalHeight(); 1012 1027 m_child.mutableStyle().setLogicalHeight(Length(flexBasis)); 1013 1028 } 1014 ~Scoped FlexBasisAsChildMainSize()1029 ~ScopedUnboundedBoxWithFlexBasisAsChildMainSize() 1015 1030 { 1031 if (m_isHorizontalWritingModeInParallelFlow) { 1032 m_child.mutableStyle().setMinWidth(Length(m_originalMinSize)); 1033 m_child.mutableStyle().setMaxWidth(Length(m_originalMaxSize)); 1034 } else { 1035 m_child.mutableStyle().setMinHeight(Length(m_originalMinSize)); 1036 m_child.mutableStyle().setMaxHeight(Length(m_originalMaxSize)); 1037 } 1038 1016 1039 if (m_mainAxisIsInlineAxis) 1017 m_child.mutableStyle().setLogicalWidth(Length(m_original Length));1040 m_child.mutableStyle().setLogicalWidth(Length(m_originalSize)); 1018 1041 else 1019 m_child.mutableStyle().setLogicalHeight(Length(m_original Length));1042 m_child.mutableStyle().setLogicalHeight(Length(m_originalSize)); 1020 1043 } 1021 1044 private: 1022 1045 RenderBox& m_child; 1046 bool m_isHorizontalWritingModeInParallelFlow; 1023 1047 bool m_mainAxisIsInlineAxis; 1024 Length m_originalLength; 1048 Length m_originalSize; 1049 Length m_originalMinSize; 1050 Length m_originalMaxSize; 1025 1051 }; 1026 1052 … … 1044 1070 // 9.3.2 E. Otherwise, size the item into the available space using its used flex basis in place of its main size. 1045 1071 { 1046 Scoped FlexBasisAsChildMainSize flexBasisScope(child, flexBasis, mainAxisIsChildInlineAxis(child));1072 ScopedUnboundedBoxWithFlexBasisAsChildMainSize flexBasisScope(child, flexBasis, mainAxisIsChildInlineAxis(child)); 1047 1073 if (mainAxisIsChildInlineAxis(child)) 1048 1074 return child.maxPreferredLogicalWidth() - mainAxisBorderAndPadding;
Note: See TracChangeset
for help on using the changeset viewer.