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

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

  Log Message:
  -----------
  [cleanup] Measure each flex line's cross size before placing its items
https://bugs.webkit.org/show_bug.cgi?id=318449

Reviewed by Antti Koivisto.

placeFlexItems ran two independent computations in a single per-item loop:
measuring each item's cross size (building the line's cross extent and its
baseline sharing groups) and placing the item along the main axis. The two
never read each other's running state -- measurement looks only at cross-axis
geometry, placement only at the main axis.

Pull the measurement half out into hypotheticalCrossSizeForFlexItems, which
returns the line's cross extent and baseline sharing groups and grows the
row-flow container height as before. placeFlexItems calls it first and then
runs a placement-only loop. totalMainExtent is still captured before the height
grows, and the main-axis auto-margin bookkeeping keeps its order, so nothing
downstream sees a difference. No change in behavior.

* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::hypotheticalCrossSizeForFlexItems):
(WebCore::RenderFlexibleBox::placeFlexItems):

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



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

Reply via email to