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

  Changed paths:
    M Source/WebCore/rendering/RenderFlexibleBox.cpp

  Log Message:
  -----------
  [cleanup] Capture each flex item's used cross size in a list from 
computeCrossSizeForFlexItems
https://bugs.webkit.org/show_bug.cgi?id=318517

Reviewed by Antti Koivisto.

Unlike the main size, position, and margin, a flex item's used cross size was
never kept by the algorithm: it lived on the renderer (the child's laid-out
border box, overwritten by the stretch relayout) and every consumer read it back
via crossAxisExtentForFlexItem. FlexLayout::layout keeps the used cross size in
its own list. Start moving legacy the same way.

computeCrossSizeForFlexItems still runs the stretch logic exactly as before, and
after each item is sized it captures the used cross size into a new 
crossSizeList
(carried per line as a LineState::crossSizes slice, matching the mainSizes,
margins, and positions spans). The stretch relayout stays -- it is the
render-native boundary -- but its result now flows into the algorithm's list, 
and
flipForRightToLeftColumn reads that list instead of the renderer.

Behavior is unchanged: the value is captured after the stretch relayout, and
nothing relays an item out between there and the flip (the intervening 
cross-axis
alignment only moves positions and sets margins, neither of which changes the
border box), so the list holds exactly what flipForRightToLeftColumn read from
crossAxisExtentForFlexItem before. The remaining post-stretch readers go through
availableAlignmentSpaceForFlexItem and marginBoxAscentForFlexItem, which are 
also
called pre-stretch (line-cross sizing) and off the out-of-flow static-position
path, so they are re-sourced per-caller in follow-ups.

* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::LineState::LineState):
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::computeCrossSizeForFlexItems):
(WebCore::RenderFlexibleBox::flipForRightToLeftColumn):

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



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

Reply via email to