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

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-flex-basis-on-column-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-flex-basis-on-row-expected.txt
    M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp

  Log Message:
  -----------
  [css-values-5 calc-size()] The calculation is dropped when flex-basis uses a 
content basis
https://bugs.webkit.org/show_bug.cgi?id=324668
<rdar://problem/187928912>

Reviewed by Antti Koivisto.

    <div style="display: flex; width: 600px">
      <div style="flex-basis: calc-size(content, size / 2)">…</div>
    </div>

`content` sizes the item as max-content, 600px, so `size` is 600px and the item 
is 300px wide rather than 600px.

FlexBasis::tryPreferredSize() has nothing to hand over for a content basis, 
since `content` is not a
value a box can be laid out with, so the item is measured as max-content and 
never sees the
calculation. Applying it to that measurement is what the spec asks for either 
way: `content` means the
item's content based size, which is what `size` stands for.

* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::flexBaseSizeForFlexItem):
(WebCore::FlexFormattingContext::flexBaseSizeForFlexItem):
Applies the calculation to the max-content measurement a content basis gets, 
which is what `size`
stands for there.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-flex-basis-on-column-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-flex-basis-on-row-expected.txt:

4 subtests progress and none regress:

    calc-size-flex-basis-on-column   PASS 31 -> 33
    calc-size-flex-basis-on-row      PASS 30 -> 32

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



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

Reply via email to