⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 277310 in webkit


Ignore:
Timestamp:
May 10, 2021, 5:35:40 PM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r277297. rdar://problem/77797456

Unreviewed, reverting r277222.
https://bugs.webkit.org/show_bug.cgi?id=225618

WebContent process crashes while visiting
<http://ign.com|ign.com> (RenderFlexibleBox::layoutFlexItems)

Reverted changeset:

"[css-flexbox] Flex item construction may affect sibling flex
item height computation"
https://bugs.webkit.org/show_bug.cgi?id=225489
https://trac.webkit.org/changeset/277222

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277297 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-612.1.14-branch
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.1.14-branch/LayoutTests/ChangeLog

    r277230 r277310  
     12021-05-10  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r277297. rdar://problem/77797456
     4
     5    Unreviewed, reverting r277222.
     6    https://bugs.webkit.org/show_bug.cgi?id=225618
     7   
     8    WebContent process crashes while visiting
     9    <http://ign.com|ign.com> (RenderFlexibleBox::layoutFlexItems)
     10   
     11    Reverted changeset:
     12   
     13    "[css-flexbox] Flex item construction may affect sibling flex
     14    item height computation"
     15    https://bugs.webkit.org/show_bug.cgi?id=225489
     16    https://trac.webkit.org/changeset/277222
     17   
     18    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     19
     20    2021-05-10  Commit Queue  <commit-queue@webkit.org>
     21
     22            Unreviewed, reverting r277222.
     23            https://bugs.webkit.org/show_bug.cgi?id=225618
     24
     25            WebContent process crashes while visiting
     26            <http://ign.com|ign.com> (RenderFlexibleBox::layoutFlexItems)
     27
     28            Reverted changeset:
     29
     30            "[css-flexbox] Flex item construction may affect sibling flex
     31            item height computation"
     32            https://bugs.webkit.org/show_bug.cgi?id=225489
     33            https://trac.webkit.org/changeset/277222
     34
    1352021-05-08  Ricky Mondello  <rmondello@apple.com>
    236
  • branches/safari-612.1.14-branch/Source/WebCore/ChangeLog

    r277254 r277310  
     12021-05-10  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r277297. rdar://problem/77797456
     4
     5    Unreviewed, reverting r277222.
     6    https://bugs.webkit.org/show_bug.cgi?id=225618
     7   
     8    WebContent process crashes while visiting
     9    <http://ign.com|ign.com> (RenderFlexibleBox::layoutFlexItems)
     10   
     11    Reverted changeset:
     12   
     13    "[css-flexbox] Flex item construction may affect sibling flex
     14    item height computation"
     15    https://bugs.webkit.org/show_bug.cgi?id=225489
     16    https://trac.webkit.org/changeset/277222
     17   
     18    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     19
     20    2021-05-10  Commit Queue  <commit-queue@webkit.org>
     21
     22            Unreviewed, reverting r277222.
     23            https://bugs.webkit.org/show_bug.cgi?id=225618
     24
     25            WebContent process crashes while visiting
     26            <http://ign.com|ign.com> (RenderFlexibleBox::layoutFlexItems)
     27
     28            Reverted changeset:
     29
     30            "[css-flexbox] Flex item construction may affect sibling flex
     31            item height computation"
     32            https://bugs.webkit.org/show_bug.cgi?id=225489
     33            https://trac.webkit.org/changeset/277222
     34
    1352021-05-09  Lauro Moura  <lmoura@igalia.com>
    236
  • branches/safari-612.1.14-branch/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r277222 r277310  
    269269    m_relaidOutChildren.clear();
    270270   
     271    bool oldInLayout = m_inLayout;
     272    m_inLayout = true;
     273   
    271274    if (recomputeLogicalWidth())
    272275        relayoutChildren = true;
     
    319322
    320323    clearNeedsLayout();
     324   
     325    m_inLayout = oldInLayout;
    321326}
    322327
     
    841846        return false;
    842847    bool definite = child.computePercentageLogicalHeight(flexBasis, updateDescendants).hasValue();
    843     if (!m_inFlexItemConstruction && (isHorizontalWritingMode() == child.isHorizontalWritingMode())) {
     848    if (m_inLayout && (isHorizontalWritingMode() == child.isHorizontalWritingMode())) {
    844849        // We can reach this code even while we're not laying ourselves out, such
    845850        // as from mainSizeForPercentageResolution.
     
    961966    // should work off this list of a subset.
    962967    // 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   
    964983    const LayoutUnit lineBreakLength = mainAxisContentExtent(LayoutUnit::max());
    965984    LayoutUnit gapBetweenItems = computeGap(GapType::BetweenItems);
     
    12761295}
    12771296
    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;
     1297FlexItem 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);
    13241327}
    13251328   
  • branches/safari-612.1.14-branch/Source/WebCore/rendering/RenderFlexibleBox.h

    r277222 r277310  
    176176    LayoutUnit adjustChildSizeForMinAndMax(RenderBox& child, LayoutUnit childSize);
    177177    LayoutUnit adjustChildSizeForAspectRatioCrossAxisMinAndMax(const RenderBox& child, LayoutUnit childSize);
    178     Vector<FlexItem> constructFlexItems(bool relayoutChildren);
     178    FlexItem constructFlexItem(RenderBox&, bool relayoutChildren);
    179179   
    180180    void freezeInflexibleItems(FlexSign, Vector<FlexItem>& children, LayoutUnit& remainingFreeSpace, double& totalFlexGrow, double& totalFlexShrink, double& totalWeightedFlexShrink);
     
    221221    // This is SizeIsUnknown outside of layoutBlock()
    222222    SizeDefiniteness m_hasDefiniteHeight { SizeDefiniteness::Unknown };
    223     bool m_inFlexItemConstruction { false };
     223    bool m_inLayout { false };
    224224    bool m_shouldResetChildLogicalHeightBeforeLayout { false };
    225225};
Note: See TracChangeset for help on using the changeset viewer.