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

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/calc-size-width-interpolation-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-width-composition-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-width-interpolation-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-flex-basis-on-row-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-width-box-sizing-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-width-expected.txt
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderBox.h

  Log Message:
  -----------
  [css-values-5 calc-size()] Add support for an auto basis in the inline axis
https://bugs.webkit.org/show_bug.cgi?id=324500
<rdar://problem/187741015>

Reviewed by Antti Koivisto.

    <div style="width: 500px">
      <div style="width: calc-size(auto, size * 0.6 + 23px)">…</div>
    </div>

`auto` on an in-flow block is the available width, 500px, so `size` is 500px 
and the box is 323px.

* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthUsingGeneric const):
(WebCore::RenderBox::computeCalcSizeOnAutoLogicalWidth const):
Resolves the calculation against the width the box would otherwise have taken, 
clamping that width
itself for a shrink-to-fit box: minContentLogicalWidthContribution() and its 
maximum are the result of the calculation, so they would bring it in twice.

* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeIntrinsicLogicalWidthContributions): An auto 
basis contributes like a fit-content one, each contribution keeping its own 
intrinsic width.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-width-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-width-box-sizing-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-flex-basis-on-row-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/calc-size-width-interpolation-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-width-composition-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-width-interpolation-expected.txt:
* LayoutTests/TestExpectations:

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



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

Reply via email to