Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 46327f724be09f4b27c1c72b9dd083ca34d6abcc
      
https://github.com/WebKit/WebKit/commit/46327f724be09f4b27c1c72b9dd083ca34d6abcc
  Author: Alan Baradlay <[email protected]>
  Date:   2026-07-25 (Sat, 25 Jul 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-basis-013-expected.txt
    M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
    M Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp
    M Source/WebCore/layout/integration/flex/FlexIntegrationUtils.h

  Log Message:
  -----------
  Fold the cross-size-override/intrinsic-width scopes into 
computeMainAxisExtentForFlexItem
https://bugs.webkit.org/show_bug.cgi?id=320226

Reviewed by Antti Koivisto.

After 320216 the flex-item main-axis measurement was split across two functions 
with awkward
gating: callers picked computeMainAxisExtentForFlexItem for definite sizes and
computeMainAxisExtentForFlexItemWithCrossAxisOverride for intrinsic ones, and 
the wrapper then
re-checked the axis to decide which scopes to apply.

Fold the two scopes into computeMainAxisExtentForFlexItem, where they are 
actually consumed. An
intrinsic main size is measured from the item's content, so it gets its 
definite cross size
(FlexItemDefiniteCrossSizeScope) for both main-axis branches: the inline 
(width) branch lays the
item's content out, and the block (height) branch resolves a height that -- for 
a replaced item, or
any item with a preferred aspect ratio -- is computed from the item's used 
cross size. A definite
main size resolves to a length without measuring the content, so it gets 
neither scope. The
intrinsic-width flag only affects percentage resolution while the item's width 
is being measured, so
it stays on the inline branch alone.

computeMainAxisExtentForFlexItemWithCrossAxisOverride (and its explicit 
instantiations) is removed,
and the three call sites collapse to a single computeMainAxisExtentForFlexItem 
call each. No change
in behavior for the paths that already had the scopes: the internal 
size.isIntrinsicOrStretch() gate
reproduces the callers' former base-vs-wrapper choice.

The block (height) branch did not previously get the cross-size override, so an 
intrinsic main size
there is now measured with the container's definite cross size applied. That 
progresses
css/css-flexbox/flex-basis-013.html subtests 3-5, where a row flex item with 
flex-basis:
min-content / fit-content / max-content around a <canvas> now resolves its 
width through the aspect
ratio (50px) instead of measuring the canvas' raw intrinsic width (5px).

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-basis-013-expected.txt:
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::FlexFormattingContext::computeUsedMaxMainSize):
(WebCore::FlexFormattingContext::computeUsedNonAutoMinMainSize):
(WebCore::FlexFormattingContext::computeContentBasedMinMainSize):
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.h:
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp:
(WebCore::LayoutIntegration::FlexIntegrationUtils::computeMainAxisExtentForFlexItem):
(WebCore::LayoutIntegration::FlexIntegrationUtils::computeMainAxisExtentForFlexItemWithCrossAxisOverride):
 Deleted.

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



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

Reply via email to