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

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

  Log Message:
  -----------
  [cleanup] Route cross-axis alignment through the flex item instead of the 
renderer
https://bugs.webkit.org/show_bug.cgi?id=318462

Reviewed by Antti Koivisto.

adjustAlignmentForFlexItem read the renderer's flow-aware location, added the 
cross-axis delta, and wrote it back to the renderer.
Have it move the flex item's own flowAwareLocation and apply that with 
setFlexItemGeometry, so the logical flex item
-- not the renderer -- carries the cross-axis offset.
Its callers (updateAutoMarginsInCrossAxis, performBaselineAlignment, the
cross-axis line and item alignment, and flipForWrapReverse)
pass the FlexLayoutItem, and layoutColumnReverse now writes the item's location 
too so it stays in sync before alignment reads it.
flipForRightToLeftColumn keeps writing the renderer: it runs last and nothing 
reads the item afterwards.

No change in behavior: item.flowAwareLocation equals the renderer's flow-aware 
location at every adjustAlignmentForFlexItem call
(placeFlexItems and layoutColumnReverse seed it, each adjustment re-applies), 
so setFlexItemGeometry writes the same value the old code did.

While here, annotate performFlexLayout and its phases with the css-flexbox-1 
algorithm step numbers.

* Source/WebCore/rendering/RenderFlexibleBox.h:
*
Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::layoutFlexLines):
(WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
(WebCore::RenderFlexibleBox::layoutColumnReverse):
(WebCore::RenderFlexibleBox::handleCrossAxisAlignmentForFlexLines):
(WebCore::RenderFlexibleBox::adjustAlignmentForFlexItem):
(WebCore::RenderFlexibleBox::handleCrossAxisAlignmentForFlexItems):
(WebCore::RenderFlexibleBox::performBaselineAlignment):
(WebCore::RenderFlexibleBox::flipForWrapReverse):

Canonical link: 
https://flagged.apple.com:443/proxy?t2=DD7m6Z2Ft5&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE2OTA1QG1haW4=&emid=ebef1249-0e52-4ee6-b415-5480784e45dc&c=11



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

Reply via email to