Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6d6a25129627252e2066737dbc60245174ade259
      
https://github.com/WebKit/WebKit/commit/6d6a25129627252e2066737dbc60245174ade259
  Author: Alan Baradlay <[email protected]>
  Date:   2026-07-15 (Wed, 15 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] FlexLayout should ask RenderFlexibleBox for a flex item's 
block-axis content size
https://bugs.webkit.org/show_bug.cgi?id=318610

Reviewed by Antti Koivisto.

FlexLayout::ensureBlockAxisContentSizeForFlexItemIfNeeded laid a flex item out 
and measured it
itself: the percentage-resolution-disabling scope, 
setChildNeedsLayout/layoutIfNeeded, and
reading the item's logical height, border+padding, scrollbar and content 
height. That is
render-tree work the flex algorithm should not own; it should just ask the 
container for the
value, the way the LFC flex formatting context asks its integration layer to 
lay a box out.

Move it into RenderFlexibleBox::computeBlockAxisContentSizeForFlexItem, which 
owns the whole
operation: reuse the size cached in a previous layout while the item stays 
clean, otherwise lay
the item out, measure its block-axis content size, cache it, and record that 
the item was laid
out this iteration. FlexLayout::ensureBlockAxisContentSizeForFlexItemIfNeeded 
is left with just
the gate that decides whether the item's flex base needs this, plus the call.

RenderFlexibleBox already owned the block-axis size cache (m_blockAxisSize); 
this also moves the
laid-out-this-iteration set (m_flexItemsWithCompletedLayout) onto it, reached 
from FlexLayout via
markFlexItemLayoutComplete/hasFlexItemCompletedLayout, and drops the plumbing 
that had carried the
cached size in on FlexLayoutItem and back out on FlexLayout::Result.

No change in behavior: the reuse check, layout, measurement, caching and 
marking are the same
operations in the same order, moved to the render object.

* 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/317271@main



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

Reply via email to