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

Changeset 294744 in webkit


Ignore:
Timestamp:
May 24, 2022, 7:22:19 AM (4 years ago)
Author:
Oriol Brufau
Message:

Obey intrinsic min-height in nested column flex container
https://bugs.webkit.org/show_bug.cgi?id=240068

Reviewed by Sergio Villar Senin.

Fixes a regression from bug 230755. An intrinsic min-height should make
a column flex container grow enough for its contents, even if it's also
a flex item with a small definite flex-basis like 0px.

Test: imported/w3c/web-platform-tests/css/css-flexbox/flex-minimum-height-flex-items-031.html

Canonical link: https://commits.webkit.org/250912@main

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r294275 r294744  
    32673267        if (intrinsicContentHeight)
    32683268            return adjustIntrinsicLogicalHeightForBoxSizing(intrinsicContentHeight.value());
    3269         return intrinsicContentHeight;
     3269        return std::nullopt;
    32703270    }
    32713271    if (logicalHeightLength.isFillAvailable())
     
    32773277std::optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heightType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const
    32783278{
    3279     if (height.isAuto())
    3280         return heightType == MinSize ? std::optional<LayoutUnit>(0) : std::nullopt;
     3279    if (height.isAuto()) {
     3280        if (heightType != MinSize)
     3281            return std::nullopt;
     3282        if (intrinsicContentHeight && isFlexItem() && downcast<RenderFlexibleBox>(parent())->shouldApplyMinBlockSizeAutoForChild(*this))
     3283            return adjustIntrinsicLogicalHeightForBoxSizing(intrinsicContentHeight.value());
     3284        return std::optional<LayoutUnit>(0);
     3285    }
    32813286    // FIXME: The CSS sizing spec is considering changing what min-content/max-content should resolve to.
    32823287    // If that happens, this code will have to change.
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r294193 r294744  
    522522
    523523    return (minSize.isAuto() || childBlockSizeIsEquivalentToAutomaticSize) && (mainAxisOverflowForChild(child) == Overflow::Visible);
     524}
     525
     526bool RenderFlexibleBox::shouldApplyMinBlockSizeAutoForChild(const RenderBox& child) const
     527{
     528    return !mainAxisIsChildInlineAxis(child) && shouldApplyMinSizeAutoForChild(child);
    524529}
    525530
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.h

    r293293 r294744  
    9191    enum class GapType { BetweenLines, BetweenItems };
    9292    LayoutUnit computeGap(GapType) const;
     93
     94    bool shouldApplyMinBlockSizeAutoForChild(const RenderBox&) const;
    9395
    9496protected:
Note: See TracChangeset for help on using the changeset viewer.