Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ff96979676ebd0882487b97aa108a2c052b41935
https://github.com/WebKit/WebKit/commit/ff96979676ebd0882487b97aa108a2c052b41935
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:
-----------
Fold the wrap-reverse and RTL-column flips into a computeFlexItemRects pass
https://bugs.webkit.org/show_bug.cgi?id=318553
Reviewed by Antti Koivisto.
Legacy finalized flex item positions in three steps at the end of layout: a
flipForWrapReverse pass, a flipForRightToLeftColumn pass, and then a loop
writing
each item's flow-aware location to its renderer. FlexLayout::layout instead
finalizes position (including axis reversal) in a single computeFlexItemRects
step. Match that: fold both flips into the final apply loop, now a
computeFlexItemRects lambda that, per item, applies the wrap-reverse line flip
and
the rtl-column item flip and writes the location via setFlexItemGeometry.
flipForWrapReverse and flipForRightToLeftColumn are gone.
No change in behavior: the flip formulas are unchanged, the order is preserved
(wrap-reverse then rtl-column, so the rtl flip sees the moved cross position --
and
since each flip only touches its own item, applying both per item equals the old
pass-then-pass), and the ranges cover exactly the items the apply loop did. The
wrap-reverse input crossAxisStartEdge must be read before align-content
(handleCrossAxisAlignmentForFlexLines) shifts the line offsets, so it is now
captured into a performFlexLayout-scope local there and read by
computeFlexItemRects.
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
(WebCore::RenderFlexibleBox::placeFlexItems):
(WebCore::RenderFlexibleBox::flipForRightToLeftColumn): Deleted.
(WebCore::RenderFlexibleBox::flipForWrapReverse): Deleted.
* Source/WebCore/rendering/RenderFlexibleBox.h:
Canonical link: https://commits.webkit.org/316996@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications