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

  Changed paths:
    M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h

  Log Message:
  -----------
  [cleanup] Compute each flex item's cross-axis alignment values once
https://bugs.webkit.org/show_bug.cgi?id=327092
<rdar://problem/189705664>

Reviewed by Antti Koivisto.

1. Compute the available alignment space once in 
handleCrossAxisAlignmentForFlexItems; updateAutoMarginsInCrossAxis
   only changes margins when it returns true, and that skips the second use.
2. Compute alignmentContextAxis once at the top of performBaselineAlignment 
instead of in both
   flexItemWritingModeForBaselineAlignment and the BaselineAlignmentState setup.
3. Store each baseline-sharing group member's alignment, margin-box ascent and 
shouldAdjustTowardsCrossAxisEnd in
   BaselineSharingGroup::Item when the group is built, instead of recomputing 
them in each later loop.
4. Compute each member's available alignment space once in 
performBaselineAlignment; the offset and
   minMarginAfterBaseline each recomputed it.
5. Drop the cross-axis auto margin check from the fallback alignment loop; only 
items without cross-axis auto margins
   join a group.

No change in behavior.

* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::FlexFormattingContext::handleCrossAxisAlignmentForFlexItems):
(WebCore::FlexFormattingContext::performBaselineAlignment):
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h:

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



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

Reply via email to