Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 51f2f1647fce9df680d13eec07c489324f1fa415
      
https://github.com/WebKit/WebKit/commit/51f2f1647fce9df680d13eec07c489324f1fa415
  Author: Alan Baradlay <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio-automatic-minimum-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio-automatic-minimum.html
    M Source/WebCore/rendering/RenderBox.cpp

  Log Message:
  -----------
  Non-replaced element with aspect-ratio enforces automatic minimum, even if 
explicitly set to 0
https://bugs.webkit.org/show_bug.cgi?id=296243
<rdar://problem/156837730>

Reviewed by Antti Koivisto.

Per CSS Sizing 4 section 5.1 (Automatic Minimum Size), a box with
a preferred aspect ratio uses its min-content size as a floor for
the ratio-dependent axis. But this only applies when min-width is
auto -- the "automatic minimum".

When min-width is explicitly set to 0, the automatic minimum is
disabled (CSS Sizing 3 section 4.5). The content width should come
purely from the aspect ratio transfer (height:0 * ratio = 0).

computeIntrinsicKeywordLogicalWidths unconditionally maxed the
aspect-ratio-derived width with children's intrinsic widths. The
fix gates this on min-width being auto.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio-automatic-minimum-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio-automatic-minimum.html:
 Added.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeIntrinsicKeywordLogicalWidths):

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



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

Reply via email to