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

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

  Log Message:
  -----------
  Fix 
imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-042.html
 -043.html
https://bugs.webkit.org/show_bug.cgi?id=313347

Reviewed by Antti Koivisto.

CSSWG resolved in issue 6071 (July 2024) that the automatic content-based
minimum defers to in-axis constraints only, not transferred ones. Our
implementation from bug 243321 predates this clarification and incorrectly
clamps the automatic minimum by the transferred max.

  <div style="background: green; width: 200px; aspect-ratio: 2 / 1; max-width: 
100px;">
      <div style="height:100px;"></div>
  </div>

  1. width = min(200, max-width 100) = 100px
  2. aspect-ratio 2/1 gives preferred height = 50px
  3. max-width 100 transfers through aspect-ratio to max-height = 50px
  4. child needs 100px, so automatic content-based min-height = 100px
  5. BUG: transferred max-height (50) clamped the content minimum to 50px
  6. FIX: content minimum (100) wins -- CSS 2.1 says min > max, min wins

The fix removes two lines in constrainLogicalMinMaxSizesByAspectRatio that
clamped the automatic content-based minimum by the transferred maximum.
A specified max-height would still clamp it (handled earlier in the function).

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalMinMaxSizesByAspectRatio const):

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



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

Reply via email to