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

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

  Log Message:
  -----------
  [cleanup] Have RenderFlexibleBox lay out a flex item after main sizing 
instead of FlexLayout
https://bugs.webkit.org/show_bug.cgi?id=318614
<rdar://problem/182019677>

Reviewed by Antti Koivisto.

FlexLayout::layoutFlexItemAfterMainSizing laid each flex item out once its 
flexed main size was
resolved: it applied that main size, decided whether the item needed a 
relayout, and called
layoutIfNeeded (plus the pagination and repaint bookkeeping). Laying a flex 
item out is render-tree
work that belongs to the container, not the item-layout algorithm.

Move it and its exclusively-used helpers (setOverridingMainSizeForFlexItem,
resetAutoMarginsAndLogicalTopInCrossAxis, and the 
updateFlexItemDirtyBitsBeforeLayout file-static)
into RenderFlexibleBox. flexItemHasPercentHeightDescendants moves too, since 
the stretch relayout
decision also reads it. FlexLayout::layoutFlexItems now calls
m_flexBox.layoutFlexItemAfterMainSizing per item; 
resetAutoMarginsAndLogicalTopInCrossAxis reads
its flow direction from flexLayoutUtils() rather than the constraints it no 
longer has.

With this, FlexLayout no longer lays out any flex item directly: it computes 
the sizes and
positions and decides whether a relayout is needed, and RenderFlexibleBox 
performs every layout
(the block-axis measure, the main-axis layout here, and the stretch relayouts).

No change in behavior: the moved bodies are unchanged, run under the same 
conditions, and in the
same order.

* Source/WebCore/rendering/RenderFlexLayout.cpp:
* Source/WebCore/rendering/RenderFlexLayout.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
* Source/WebCore/rendering/RenderFlexibleBox.h:

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



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

Reply via email to