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

  Changed paths:
    M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h
    M Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp
    M Source/WebCore/layout/integration/flex/FlexIntegrationUtils.h

  Log Message:
  -----------
  [cleanup] Have FlexIntegrationUtils own the flex item's intrinsic-size 
measurement
https://bugs.webkit.org/show_bug.cgi?id=320236

Reviewed by Antti Koivisto.

A couple of flex-item measurements still read the render tree straight from
FlexFormattingContext. Move them behind FlexIntegrationUtils so the formatting 
context keeps
the flex algorithm and the integration owns the RenderBox access.

flexItemIntrinsicLogicalHeight and flexItemIntrinsicLogicalWidth move to 
FlexIntegrationUtils.
Each takes the one flex-algorithm decision it needs -- whether the item's 
logical height must be
stretched, and whether its cross size is definite -- as a bool computed by the 
formatting context
(via FlexFormattingUtils / FlexLayoutState) and passed in. That keeps 
FlexLayoutState and the
FlexFormattingUtils queries on the formatting-context side and leaves the 
integration methods as
pure render-tree measurement: scrollbar + border/padding + 
constrainLogicalHeightByMinMax, or
computeLogicalWidth with the item's overriding width cleared.

While here, fold the flex-base-size max-content branch's border/padding 
subtraction into the
integration. maxContentMainAxisExtentForFlexItem now returns the content-box 
extent (the
contribution minus the item's main-axis border/padding) instead of the raw 
contribution, so
flexBaseSizeForFlexItem no longer reads the item's border/padding directly. It 
is renamed from
maxContentMainAxisContributionForFlexItem to reflect the value it returns.

No change in behavior.

* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::FlexFormattingContext::hypotheticalCrossSizeForFlexItems):
(WebCore::FlexFormattingContext::flexBaseSizeForFlexItem):
(WebCore::FlexFormattingContext::flexItemIntrinsicLogicalHeight): Deleted.
(WebCore::FlexFormattingContext::flexItemIntrinsicLogicalWidth): Deleted.
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h:
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp:
(WebCore::LayoutIntegration::FlexIntegrationUtils::maxContentMainAxisExtentForFlexItem):
(WebCore::LayoutIntegration::FlexIntegrationUtils::flexItemIntrinsicLogicalHeight):
(WebCore::LayoutIntegration::FlexIntegrationUtils::flexItemIntrinsicLogicalWidth):
(WebCore::LayoutIntegration::FlexIntegrationUtils::maxContentMainAxisContributionForFlexItem):
 Deleted.
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.h:

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



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

Reply via email to