Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 812f3d0650854fa12baf8af7077baee4e2c02ebc
      
https://github.com/WebKit/WebKit/commit/812f3d0650854fa12baf8af7077baee4e2c02ebc
  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] Separate layout-forcing from size querying in RenderFlexibleBox 
flex base path
https://bugs.webkit.org/show_bug.cgi?id=315431

Reviewed by Antti Koivisto.

blockAxisSizeForFlexItem did two things in one call: it forced layoutIfNeeded
on the flex item, populated m_blockAxisSize as a side effect, and returned the
cached value. That blurred the action (force layout) and the query (read the
cached size) into a single named operation, and the predicate that gated it
(flexItemNeedsBlockAxisSize) sounded like a generic question about the item
when it really only mattered for the flex base size computation.

Extracted the layout-forcing side into 
ensureBlockAxisContentSizeForFlexItemIfNeeded,
which self-gates on the renamed predicate flexBaseSizeNeedsBlockAxisContentSize.
flexBaseSizeForFlexItem now calls the ensure helper unconditionally and reads
m_blockAxisSize directly at the one use site. Comments at the read site in
computeMainAxisExtentForFlexItem split into two: one about computeContent-
LogicalHeight handling auto, one about the staleness contract for
scrollbarLogicalHeight.

No behavior change.

* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeMainAxisExtentForFlexItem):
(WebCore::RenderFlexibleBox::flexBaseSizeForFlexItem):
(WebCore::RenderFlexibleBox::ensureBlockAxisContentSizeForFlexItemIfNeeded):
(WebCore::RenderFlexibleBox::flexBaseSizeNeedsBlockAxisContentSize):
(WebCore::RenderFlexibleBox::blockAxisSizeForFlexItem): Deleted.
(WebCore::RenderFlexibleBox::flexItemNeedsBlockAxisSize): Deleted.
* Source/WebCore/rendering/RenderFlexibleBox.h:

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



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

Reply via email to