Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7c614cb3031cc4da60cd56132a1c2d67d91b77df
      
https://github.com/WebKit/WebKit/commit/7c614cb3031cc4da60cd56132a1c2d67d91b77df
  Author: Alan Baradlay <[email protected]>
  Date:   2026-05-25 (Mon, 25 May 2026)

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

  Log Message:
  -----------
  [cleanup] Move dirty-bit update out of flex base size path and rename 
m_relaidOutFlexItems
https://bugs.webkit.org/show_bug.cgi?id=315457

Reviewed by Antti Koivisto.

ensureBlockAxisContentSizeForFlexItemIfNeeded called updateBlockChildDirty-
BitsBeforeLayout as part of its preamble, which was the only reason it took
a RelayoutChildren parameter. The marking it performs (mark needs-layout if
relayoutChildren is Yes or the child has a relative height) is not specific
to flex base size computation - it is per-item bookkeeping that the flex
layout's setup loop wants to do regardless of which gate the item falls on.

Moved the updateBlockChildDirtyBitsBeforeLayout call into prepareFlexItem,
the lambda inside performFlexLayout that already gathers per-item
preparation work. The cascading consequence drops RelayoutChildren from
three signatures that were only forwarding it: ensureBlockAxisContent-
SizeForFlexItemIfNeeded, flexBaseSizeForFlexItem, and flexBaseAndHypothetical-
MainSize.

The marking now fires for every in-flow flex item instead of only those
where flexBaseSizeNeedsBlockAxisContentSize returns true. This is functionally
a no-op: items previously unmarked at this stage would be marked anyway by
updateFlexItemDirtyBitsBeforeLayout in layoutAndPlaceFlexItems before
layoutIfNeeded fires, so the dirty-bit state at the actual layout call is
unchanged.

Also renamed the cache field m_relaidOutFlexItems to m_flexItemsWith-
CompletedLayout. The old name read as a past participle of "re-lay-out",
which is awkward and doesn't capture what the set tracks: flex items whose
layout has been completed during the current layout invocation, used to
skip duplicate work in the flex algorithm.

No behavior change.

* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::flexBaseSizeForFlexItem):
(WebCore::RenderFlexibleBox::ensureBlockAxisContentSizeForFlexItemIfNeeded):
(WebCore::RenderFlexibleBox::flexBaseAndHypotheticalMainSize):
(WebCore::RenderFlexibleBox::layoutAndPlaceFlexItems):
* Source/WebCore/rendering/RenderFlexibleBox.h:

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



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

Reply via email to