Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 181864444d4a42b87daf29ca4f31c605deee49a8
      
https://github.com/WebKit/WebKit/commit/181864444d4a42b87daf29ca4f31c605deee49a8
  Author: Alan Baradlay <[email protected]>
  Date:   2026-10-02 (Fri, 02 Oct 2026)

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

  Log Message:
  -----------
  [css-values-5 calc-size()] Add support for an auto basis on a box with an 
aspect ratio
https://bugs.webkit.org/show_bug.cgi?id=324507
<rdar://problem/187739361>

Reviewed by Antti Koivisto.

    <div style="aspect-ratio: 1/2; height: 100px; width: calc-size(auto, size + 
50px)"></div>

The ratio gives an auto width of 50px, so `size` is 50px and the box is a 100px 
square.

* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidth const):
(WebCore::RenderBox::computeLogicalHeight const):
An auto basis in the ratio-dependent axis is the size the ratio gives, so the 
calculation runs over
that instead of the ratio deciding the used size on its own.

(WebCore::RenderBox::applyAutomaticContentBasedMinimumSize const):
The automatic minimum of a ratio box is what an auto basis on its minimum size 
stands for, so the
calculation runs over the min-content and max-content widths it reports.

(WebCore::RenderBox::constrainLogicalHeightByMinMax const):
The same for a minimum block size, where that minimum is already worked out 
here.

(WebCore::RenderBox::constrainLogicalWidthByMinMax const):
Says why the inline axis needs nothing further: the min-content width it asks 
for already carries
the calculation.

* LayoutTests/TestExpectations:

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



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

Reply via email to