Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cad3bbb596f4d2c43b9241d5a23406a6d83748e8
      
https://github.com/WebKit/WebKit/commit/cad3bbb596f4d2c43b9241d5a23406a6d83748e8
  Author: Alan Baradlay <[email protected]>
  Date:   2026-05-07 (Thu, 07 May 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderBox.h

  Log Message:
  -----------
  Orthogonal child with percentage max-width gets zero preferred width
https://bugs.webkit.org/show_bug.cgi?id=203512

Reviewed by Antti Koivisto.

When computing a parent's min-content width, an orthogonal child's block
size (physical width) contributes to the parent's inline direction.
computeLogicalHeightWithoutLayout (now renamed) called computeLogicalHeight
which resolved max-width: 100% against the containing block. During intrinsic
sizing, the containing block's width is what we're trying to compute, so it's
effectively 0 - and the percentage resolves to 0, clamping the child to zero.

Per CSS Sizing 3 (section 5.1), cyclic percentage max/min-size values should be
treated as their initial value (none/auto) during intrinsic size contributions.
The non-orthogonal preferred width path already does this: tryFixed() returns
nullopt for percentages, treating them as no constraint.

The fix adds an IsComputingIntrinsicSize parameter to 
constrainLogicalHeightByMinMax.
When set, percentage-based max-height and min-height are skipped - same 
principle
as the inline direction path. computeLogicalHeightForIntrinsicWidthContribution
(renamed to clarify its purpose) now calls constrainLogicalHeightByMinMax 
directly
with this flag instead of going through the full computeLogicalHeight.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeChildPreferredLogicalWidths):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalHeightByMinMax):
(WebCore::RenderBox::computeLogicalHeightForIntrinsicWidthContribution):
* Source/WebCore/rendering/RenderBox.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to