Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 34d062eac39f58063b156b6aa888ace64deeff8f
https://github.com/WebKit/WebKit/commit/34d062eac39f58063b156b6aa888ace64deeff8f
Author: Alan Baradlay <[email protected]>
Date: 2026-05-25 (Mon, 25 May 2026)
Changed paths:
M Source/WebCore/rendering/RelayoutScopeForScrollbarChange.cpp
M Source/WebCore/rendering/RenderBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
M Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
Log Message:
-----------
[cleanup] Introduce flexItemWillBeRemoved as the cache cleanup entry point in
RenderFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=315435
Reviewed by Antti Koivisto.
Two sites outside RenderFlexibleBox were clearing the per-flex-item caches in
the same paired pattern: RenderBox::styleWillChange when an item transitioned
out of flow, and resetRendererStateOnDetach when a flex item was being
detached from the render tree. Each called clearFlexItemContentLogicalHeight
and clearCachedBlockAxisSizeForFlexItem back-to-back. The pair encoded a
lifecycle event (the flex item is leaving) but the event itself was unnamed
and the contract of "wipe everything we cached for this item" was implicit
in the call order.
Introduced flexItemWillBeRemoved on RenderFlexibleBox as a single named entry
point for that lifecycle event. The two sites now make one call. The third
site, RelayoutScopeForScrollbarChange's destructor, only needs to invalidate
the block-axis-size cache (m_contentLogicalHeights is auto-refreshed by the
follow-up relayout via the setFlexItemContentLogicalHeightIfNeeded callback),
so it keeps a narrower entry point: clearCachedBlockAxisSizeForFlexItem
renamed to invalidateBlockAxisSizeForFlexItem to use rendering-idiomatic
vocabulary.
clearFlexItemContentLogicalHeight is now unused outside flexItemWillBeRemoved
and was deleted.
No behavior change.
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::flexItemWillBeRemoved):
(WebCore::RenderFlexibleBox::invalidateBlockAxisSizeForFlexItem):
(WebCore::RenderFlexibleBox::clearFlexItemContentLogicalHeight): Deleted.
(WebCore::RenderFlexibleBox::clearCachedBlockAxisSizeForFlexItem): Deleted.
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::styleWillChange):
* Source/WebCore/rendering/RelayoutScopeForScrollbarChange.cpp:
(WebCore::RelayoutScopeForScrollbarChange::~RelayoutScopeForScrollbarChange):
* Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:
(WebCore::resetRendererStateOnDetach):
Canonical link: https://commits.webkit.org/313845@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications