Changeset 295124 in webkit


Ignore:
Timestamp:
Jun 2, 2022 5:52:52 AM (2 years ago)
Author:
Alan Bujtas
Message:

Do not assume that an absolute positioned block box's height is always resolvable
https://bugs.webkit.org/show_bug.cgi?id=241213

Reviewed by Simon Fraser.

  1. While the ICB (RenderView) always has fixed height/width, the RenderStyle values are set to auto.
  2. It's incorrect to assume that we can always resolve the height for an absolute positioned box (e.g. it may have a "height: auto" relative positioned containing block)
  • LayoutTests/fast/block/fill-available-with-absolute-position-expected.html: Added.
  • LayoutTests/fast/block/fill-available-with-absolute-position.html: Added.
  • Source/WebCore/rendering/RenderBox.cpp:

(WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing const):
(WebCore::RenderBox::computePositionedLogicalHeightUsing const):

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

Location:
trunk
Files:
2 added
1 edited

Legend:

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

    r295094 r295124  
    32823282            if (!containingBlock)
    32833283                return false;
     3284            if (is<RenderView>(containingBlock))
     3285                return true;
    32843286            auto containingBlockHasSpecifiedSpace = [&] {
    32853287                auto isOrthogonal = WebCore::isOrthogonal(*this, *containingBlock);
     
    44794481    } else {
    44804482        if (logicalHeightLength.isIntrinsic())
    4481             resolvedLogicalHeight = adjustContentBoxLogicalHeightForBoxSizing(computeIntrinsicLogicalContentHeightUsing(logicalHeightLength, contentLogicalHeight, bordersPlusPadding).value());
     4483            resolvedLogicalHeight = adjustContentBoxLogicalHeightForBoxSizing(computeIntrinsicLogicalContentHeightUsing(logicalHeightLength, contentLogicalHeight, bordersPlusPadding).value_or(0_lu));
    44824484        else if (fromAspectRatio) {
    44834485            resolvedLogicalHeight = blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), style().logicalAspectRatio(), style().boxSizingForAspectRatio(), logicalWidth());
Note: See TracChangeset for help on using the changeset viewer.