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

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/checkbox-aspect-ratio-calc-height-in-flex-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/checkbox-aspect-ratio-calc-height-in-flex-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/checkbox-aspect-ratio-calc-height-in-flex.html
    M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
    M Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp

  Log Message:
  -----------
  [Flex] A widget with aspect-ratio and a calc() height gets a zero flex base 
size
https://bugs.webkit.org/show_bug.cgi?id=327158
<rdar://problem/189753886>

Reviewed by Antti Koivisto.

    <div style="display: flex">
      <input type="checkbox" style="flex-basis: content; aspect-ratio: 2; 
height: calc(50% + 1px)">
    </div>

The checkbox should be as wide as with height: 50%, twice its height. Instead 
it got a zero flex base size and stayed as narrow as the theme makes it.

The percentage can't resolve against the auto-height container, so a widget 
falls back to its intrinsic height, but
only the Style::PreferredSize overload of 
RenderBox::computePercentageLogicalHeight does that.
flexItemCrossSizeIsDefinite passes the whole size and finds the cross size 
definite, while
computeMainSizeFromAspectRatioUsing passed the bare calc() alternative, which 
resolved to nothing and gave a main size
of 0.

Wrap the calc() alternative in SizeType like the percentage, and drop the 
Style::PreferredSize::Calc instantiation that
only this call needed.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/checkbox-aspect-ratio-calc-height-in-flex-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/checkbox-aspect-ratio-calc-height-in-flex-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/checkbox-aspect-ratio-calc-height-in-flex.html:
 Added.
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::FlexFormattingContext::computeMainSizeFromAspectRatioUsing):
(WebCore::FlexFormattingContext::computeMainSizeFromAspectRatioUsing const):
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp:

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



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

Reply via email to