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

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

  Log Message:
  -----------
  [cleanup] Return cross-axis alignment offsets from the cross-axis phases 
instead of mutating the position list
https://bugs.webkit.org/show_bug.cgi?id=318555

Reviewed by Antti Koivisto.

The cross-axis alignment phases mutated a shared positionList by reference:
handleCrossAxisAlignmentForFlexLines moved every item by its line's 
align-content
offset, and handleCrossAxisAlignmentForFlexItems (and performBaselineAlignment)
moved each item by its align-self / auto-margin / baseline offset.
FlexLayout::layout instead has these phases return lists, which 
computeFlexItemRects
combines. Match that shape: handleCrossAxisAlignmentForFlexItems returns a 
per-item
crossItemOffsetList and handleCrossAxisAlignmentForFlexLines returns a per-line
lineAlignContentOffsetList, and computeFlexItemRects adds both to the base 
position
placeFlexItems set before applying the flips.

The adjustAlignmentForFlexItem helper (which moved a position's cross component)
becomes a plain accumulation onto the offset list; updateAutoMarginsInCrossAxis
takes a LayoutUnit& cross-offset accumulator rather than a LayoutPoint&, and 
still
writes the renderer margins.

No change in behavior: the final cross position is the same sum -- 
placeFlexItems'
base (line cross offset + margin) plus the align-content offset plus the item
offset -- only assembled in returned lists and summed at the end instead of 
moved
in place; the additions are commutative so the align-lines-before-align-items 
order
is irrelevant; lineCrossOffsetList is still updated for the wrap-reverse flip; 
and
placeFlexItems still applies the base position to the renderer. The main-axis
placement stays as-is (it applies to the renderer for the multi-line-column
relayout's repaint).

* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
(WebCore::RenderFlexibleBox::handleCrossAxisAlignmentForFlexLines):
(WebCore::RenderFlexibleBox::handleCrossAxisAlignmentForFlexItems):
(WebCore::RenderFlexibleBox::performBaselineAlignment):
(WebCore::RenderFlexibleBox::adjustAlignmentForFlexItem): Deleted.

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



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

Reply via email to