Changeset 277297 in webkit
- Timestamp:
- May 10, 2021, 3:01:57 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/flexbox/flex-column-with-percent-height-descendants-expected.html (deleted)
-
LayoutTests/fast/flexbox/flex-column-with-percent-height-descendants.html (deleted)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/RenderFlexibleBox.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r277293 r277297 1 2021-05-10 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, reverting r277222. 4 https://bugs.webkit.org/show_bug.cgi?id=225618 5 6 WebContent process crashes while visiting 7 <http://ign.com|ign.com> (RenderFlexibleBox::layoutFlexItems) 8 9 Reverted changeset: 10 11 "[css-flexbox] Flex item construction may affect sibling flex 12 item height computation" 13 https://bugs.webkit.org/show_bug.cgi?id=225489 14 https://trac.webkit.org/changeset/277222 15 1 16 2021-05-10 Andres Gonzalez <andresg_22@apple.com> 2 17 -
trunk/Source/WebCore/ChangeLog
r277295 r277297 1 2021-05-10 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, reverting r277222. 4 https://bugs.webkit.org/show_bug.cgi?id=225618 5 6 WebContent process crashes while visiting 7 <http://ign.com|ign.com> (RenderFlexibleBox::layoutFlexItems) 8 9 Reverted changeset: 10 11 "[css-flexbox] Flex item construction may affect sibling flex 12 item height computation" 13 https://bugs.webkit.org/show_bug.cgi?id=225489 14 https://trac.webkit.org/changeset/277222 15 1 16 2021-05-10 Wenson Hsieh <wenson_hsieh@apple.com> 2 17 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r277222 r277297 269 269 m_relaidOutChildren.clear(); 270 270 271 bool oldInLayout = m_inLayout; 272 m_inLayout = true; 273 271 274 if (recomputeLogicalWidth()) 272 275 relayoutChildren = true; … … 319 322 320 323 clearNeedsLayout(); 324 325 m_inLayout = oldInLayout; 321 326 } 322 327 … … 841 846 return false; 842 847 bool definite = child.computePercentageLogicalHeight(flexBasis, updateDescendants).hasValue(); 843 if ( !m_inFlexItemConstruction&& (isHorizontalWritingMode() == child.isHorizontalWritingMode())) {848 if (m_inLayout && (isHorizontalWritingMode() == child.isHorizontalWritingMode())) { 844 849 // We can reach this code even while we're not laying ourselves out, such 845 850 // as from mainSizeForPercentageResolution. … … 961 966 // should work off this list of a subset. 962 967 // TODO(cbiesinger): That second part is not yet true. 963 auto allItems = constructFlexItems(relayoutChildren); 968 Vector<FlexItem> allItems; 969 m_orderIterator.first(); 970 for (RenderBox* child = m_orderIterator.currentChild(); child; child = m_orderIterator.next()) { 971 if (m_orderIterator.shouldSkipChild(*child)) { 972 // Out-of-flow children are not flex items, so we skip them here. 973 if (child->isOutOfFlowPositioned()) 974 prepareChildForPositionedLayout(*child); 975 continue; 976 } 977 allItems.append(constructFlexItem(*child, relayoutChildren)); 978 } 979 980 // constructFlexItem() might set the override containing block height so any value cached for definiteness might be incorrect. 981 m_hasDefiniteHeight = SizeDefiniteness::Unknown; 982 964 983 const LayoutUnit lineBreakLength = mainAxisContentExtent(LayoutUnit::max()); 965 984 LayoutUnit gapBetweenItems = computeGap(GapType::BetweenItems); … … 1276 1295 } 1277 1296 1278 Vector<FlexItem> RenderFlexibleBox::constructFlexItems(bool relayoutChildren) 1279 { 1280 SetForScope<bool> inFlexItemConstruction(m_inFlexItemConstruction, true); 1281 1282 Vector<FlexItem> flexItems; 1283 for (auto* child = m_orderIterator.first(); child; child = m_orderIterator.next()) { 1284 if (m_orderIterator.shouldSkipChild(*child)) { 1285 // Out-of-flow children are not flex items, so we skip them here. 1286 if (child->isOutOfFlowPositioned()) 1287 prepareChildForPositionedLayout(*child); 1288 continue; 1289 } 1290 1291 auto constructFlexItemForChildBox = [&](auto& childBox) { 1292 childBox.clearOverridingContentSize(); 1293 if (childHasIntrinsicMainAxisSize(childBox)) { 1294 // If this condition is true, then computeMainAxisExtentForChild will call 1295 // child.intrinsicContentLogicalHeight() and child.scrollbarLogicalHeight(), 1296 // so if the child has intrinsic min/max/preferred size, run layout on it now to make sure 1297 // its logical height and scroll bars are up to date. 1298 updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, childBox); 1299 // Don't resolve percentages in children. This is especially important for the min-height calculation, 1300 // where we want percentages to be treated as auto. For flex-basis itself, this is not a problem because 1301 // by definition we have an indefinite flex basis here and thus percentages should not resolve. 1302 if (childBox.needsLayout() || !m_intrinsicSizeAlongMainAxis.contains(&childBox)) { 1303 if (isHorizontalWritingMode() == childBox.isHorizontalWritingMode()) 1304 childBox.setOverridingContainingBlockContentLogicalHeight(WTF::nullopt); 1305 else 1306 childBox.setOverridingContainingBlockContentLogicalWidth(WTF::nullopt); 1307 childBox.clearOverridingContentSize(); 1308 childBox.setChildNeedsLayout(MarkOnlyThis); 1309 childBox.layoutIfNeeded(); 1310 cacheChildMainSize(childBox); 1311 childBox.clearOverridingContainingBlockContentSize(); 1312 } 1313 } 1314 1315 auto borderAndPadding = isHorizontalFlow() ? childBox.horizontalBorderAndPaddingExtent() : childBox.verticalBorderAndPaddingExtent(); 1316 auto childInnerFlexBaseSize = computeInnerFlexBaseSizeForChild(childBox, borderAndPadding); 1317 auto childMinMaxAppliedMainAxisExtent = adjustChildSizeForMinAndMax(childBox, childInnerFlexBaseSize); 1318 auto margin = isHorizontalFlow() ? childBox.horizontalMarginExtent() : childBox.verticalMarginExtent(); 1319 return FlexItem(childBox, childInnerFlexBaseSize, childMinMaxAppliedMainAxisExtent, borderAndPadding, margin); 1320 }; 1321 flexItems.append(constructFlexItemForChildBox(*child)); 1322 } 1323 return flexItems; 1297 FlexItem RenderFlexibleBox::constructFlexItem(RenderBox& child, bool relayoutChildren) 1298 { 1299 child.clearOverridingContentSize(); 1300 if (childHasIntrinsicMainAxisSize(child)) { 1301 // If this condition is true, then computeMainAxisExtentForChild will call 1302 // child.intrinsicContentLogicalHeight() and child.scrollbarLogicalHeight(), 1303 // so if the child has intrinsic min/max/preferred size, run layout on it now to make sure 1304 // its logical height and scroll bars are up to date. 1305 updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, child); 1306 // Don't resolve percentages in children. This is especially important for the min-height calculation, 1307 // where we want percentages to be treated as auto. For flex-basis itself, this is not a problem because 1308 // by definition we have an indefinite flex basis here and thus percentages should not resolve. 1309 if (child.needsLayout() || !m_intrinsicSizeAlongMainAxis.contains(&child)) { 1310 if (isHorizontalWritingMode() == child.isHorizontalWritingMode()) 1311 child.setOverridingContainingBlockContentLogicalHeight(WTF::nullopt); 1312 else 1313 child.setOverridingContainingBlockContentLogicalWidth(WTF::nullopt); 1314 child.clearOverridingContentSize(); 1315 child.setChildNeedsLayout(MarkOnlyThis); 1316 child.layoutIfNeeded(); 1317 cacheChildMainSize(child); 1318 child.clearOverridingContainingBlockContentSize(); 1319 } 1320 } 1321 1322 LayoutUnit borderAndPadding = isHorizontalFlow() ? child.horizontalBorderAndPaddingExtent() : child.verticalBorderAndPaddingExtent(); 1323 LayoutUnit childInnerFlexBaseSize = computeInnerFlexBaseSizeForChild(child, borderAndPadding); 1324 LayoutUnit childMinMaxAppliedMainAxisExtent = adjustChildSizeForMinAndMax(child, childInnerFlexBaseSize); 1325 LayoutUnit margin = isHorizontalFlow() ? child.horizontalMarginExtent() : child.verticalMarginExtent(); 1326 return FlexItem(child, childInnerFlexBaseSize, childMinMaxAppliedMainAxisExtent, borderAndPadding, margin); 1324 1327 } 1325 1328 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r277222 r277297 176 176 LayoutUnit adjustChildSizeForMinAndMax(RenderBox& child, LayoutUnit childSize); 177 177 LayoutUnit adjustChildSizeForAspectRatioCrossAxisMinAndMax(const RenderBox& child, LayoutUnit childSize); 178 Vector<FlexItem> constructFlexItems(bool relayoutChildren);178 FlexItem constructFlexItem(RenderBox&, bool relayoutChildren); 179 179 180 180 void freezeInflexibleItems(FlexSign, Vector<FlexItem>& children, LayoutUnit& remainingFreeSpace, double& totalFlexGrow, double& totalFlexShrink, double& totalWeightedFlexShrink); … … 221 221 // This is SizeIsUnknown outside of layoutBlock() 222 222 SizeDefiniteness m_hasDefiniteHeight { SizeDefiniteness::Unknown }; 223 bool m_in FlexItemConstruction{ false };223 bool m_inLayout { false }; 224 224 bool m_shouldResetChildLogicalHeightBeforeLayout { false }; 225 225 };
Note:
See TracChangeset
for help on using the changeset viewer.