Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 462cfec1fac9cc1a2bd64682d99f37e163c7fa67
https://github.com/WebKit/WebKit/commit/462cfec1fac9cc1a2bd64682d99f37e163c7fa67
Author: Alan Baradlay <[email protected]>
Date: 2026-05-22 (Fri, 22 May 2026)
Changed paths:
M
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp
M Source/WebCore/rendering/RenderBox.cpp
M Source/WebCore/rendering/RenderBox.h
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
M Source/WebCore/rendering/RenderListBox.cpp
M Source/WebCore/rendering/RenderTable.cpp
M Source/WebCore/rendering/RenderTableCell.cpp
M Source/WebCore/rendering/RenderTextControl.cpp
M Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
Log Message:
-----------
[cleanup] RenderFlexibleBox should own the policy for storing flex-item
content heights
https://bugs.webkit.org/show_bug.cgi?id=315319
Reviewed by Antti Koivisto.
The flex-item content-height cache that RenderFlexibleBox maintains was set up
through a hook on RenderBox -
shouldCacheIntrinsicContentLogicalHeightForFlexItem
and cacheIntrinsicContentLogicalHeightForFlexItem - that knew about flex parents
and made all the policy decisions before writing into RenderFlexibleBox state.
The flex-specific policy doesn't belong on RenderBox.
Moved the policy to a new
RenderFlexibleBox::setFlexItemContentLogicalHeightIfNeeded.
Five call sites (RenderBox::updateLogicalHeight plus four custom-height
subclasses:
RenderTable, RenderTableCell, RenderListBox, RenderTextControl) now do an inline
dispatch: if parent is a RenderFlexibleBox, call the helper. Folded the raw
setCachedFlexItem... setter into the gated entry by moving isRenderReplaced into
canSet. Also dropped the misleading "Intrinsic" qualifier from the cache API
(the value is just content logical height, not the spec sense of "intrinsic")
and "Cached" from method names (implementation detail; callers don't need it).
*
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp:
(WebCore::LayoutIntegration::formattingContextRootLogicalHeightForType):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::styleWillChange):
(WebCore::RenderBox::updateLogicalHeight):
(WebCore::RenderBox::shouldCacheIntrinsicContentLogicalHeightForFlexItem
const): Deleted.
(WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem const):
Deleted.
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::flexItemContentLogicalHeight const):
(WebCore::RenderFlexibleBox::clearFlexItemContentLogicalHeight):
(WebCore::canSetFlexItemContentLogicalHeight):
(WebCore::RenderFlexibleBox::setFlexItemContentLogicalHeightIfNeeded):
(WebCore::RenderFlexibleBox::flexItemIntrinsicLogicalHeight const):
(WebCore::RenderFlexibleBox::computeMainAxisExtentForFlexItem):
(WebCore::RenderFlexibleBox::blockAxisSizeForFlexItem):
(WebCore::RenderFlexibleBox::applyStretchAlignmentToFlexItem):
(WebCore::RenderFlexibleBox::cachedFlexItemIntrinsicContentLogicalHeight
const): Deleted.
(WebCore::RenderFlexibleBox::setCachedFlexItemIntrinsicContentLogicalHeight):
Deleted.
(WebCore::RenderFlexibleBox::clearCachedFlexItemIntrinsicContentLogicalHeight):
Deleted.
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computeLogicalHeight const):
* Source/WebCore/rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* Source/WebCore/rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::layout):
* Source/WebCore/rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeLogicalHeight const):
* Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:
(WebCore::resetRendererStateOnDetach):
Canonical link: https://commits.webkit.org/313742@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications