Make the various shouldApplyContainment() functions member functions on RenderElement
https://bugs.webkit.org/show_bug.cgi?id=240156
Reviewed by Alan Bujtas.
These were free functions, but make more sense as member functions on RenderElement
since most callers passed `*this`. Just one call site needs to downcast<> to
RenderElement.
No behavior change.
* rendering/GridTrackSizingAlgorithm.cpp:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeIntrinsicLogicalWidths const):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
(WebCore::RenderBlock::firstLineBaseline const):
(WebCore::RenderBlock::inlineBlockBaseline const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::adjustSizeContainmentChildForPagination):
(WebCore::RenderBlockFlow::firstLineBaseline const):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::updateLogicalHeight):
(WebCore::RenderBox::isUnsplittableForPagination const):
(WebCore::RenderBox::layoutOverflowRectForPropagation const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::updateFromStyle):
* rendering/RenderButton.cpp:
(WebCore::RenderButton::baselinePosition const):
* rendering/RenderCounter.cpp:
(WebCore::makeCounterNode):
(WebCore::RenderCounter::rendererSubtreeAttached):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths const):
* rendering/RenderElement.h:
(WebCore::RenderElement::canContainFixedPositionObjects const):
(WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
(WebCore::RenderElement::shouldApplyLayoutContainment const):
(WebCore::RenderElement::shouldApplySizeContainment const):
(WebCore::RenderElement::shouldApplyInlineSizeContainment const):
(WebCore::RenderElement::shouldApplyStyleContainment const):
(WebCore::RenderElement::shouldApplyPaintContainment const):
(WebCore::RenderElement::shouldApplyAnyContainment const):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths const):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const):
(WebCore::RenderFlexibleBox::firstLineBaseline const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const):
(WebCore::RenderGrid::firstLineBaseline const):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::computeIntrinsicRatioInformation const):
* rendering/RenderInline.h:
* rendering/RenderLayer.cpp:
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::shouldBeCSSStackingContext const):
(WebCore::RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant):
(WebCore::RenderLayer::setAncestorChainHasVisibleDescendant):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computeIntrinsicLogicalWidths const):
(WebCore::RenderListBox::baselinePosition const):
* rendering/RenderMenuList.cpp:
(RenderMenuList::computeIntrinsicLogicalWidths const):
* rendering/RenderObject.cpp:
(WebCore::objectIsRelayoutBoundary):
(WebCore::shouldApplyLayoutContainment): Deleted.
(WebCore::shouldApplySizeContainment): Deleted.
(WebCore::shouldApplyInlineSizeContainment): Deleted.
(WebCore::shouldApplyStyleContainment): Deleted.
(WebCore::shouldApplyPaintContainment): Deleted.
(WebCore::shouldApplyAnyContainment): Deleted.
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const):
(WebCore::RenderReplaced::computeIntrinsicRatioInformation const):
* rendering/RenderReplaced.h:
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::computeIntrinsicLogicalWidths const):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::firstLineBaseline const):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeIntrinsicLogicalWidths const):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::calculateIntrinsicSize):
* rendering/RenderView.cpp:
(WebCore::RenderView::rendererForRootBackground const):
* rendering/svg/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::computeIntrinsicRatioInformation const):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeIntrinsicRatioInformation const):
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::evaluateSizeFeature const):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@293900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index 83cf5a6..43b9842 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -345,7 +345,7 @@
void RenderBlockFlow::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
- auto shouldIgnoreDescendantContentForLogicalWidth = shouldApplySizeContainment(*this) || shouldApplyInlineSizeContainment(*this);
+ auto shouldIgnoreDescendantContentForLogicalWidth = shouldApplySizeContainment() || shouldApplyInlineSizeContainment();
if (!shouldIgnoreDescendantContentForLogicalWidth) {
if (childrenInline())
computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth);
@@ -1523,7 +1523,7 @@
}
}
- if (shouldApplySizeContainment(child))
+ if (child.shouldApplySizeContainment())
adjustSizeContainmentChildForPagination(child, result);
// For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
@@ -1903,7 +1903,7 @@
void RenderBlockFlow::adjustSizeContainmentChildForPagination(RenderBox& child, LayoutUnit offset)
{
- if (!shouldApplySizeContainment(child))
+ if (!child.shouldApplySizeContainment())
return;
LayoutUnit childOverflowHeight = child.isHorizontalWritingMode() ? child.layoutOverflowRect().maxY() : child.layoutOverflowRect().maxX();
@@ -2946,7 +2946,7 @@
if (isWritingModeRoot() && !isRubyRun() && !isGridItem())
return std::nullopt;
- if (shouldApplyLayoutContainment(*this))
+ if (shouldApplyLayoutContainment())
return std::nullopt;
if (!childrenInline())
@@ -2971,7 +2971,7 @@
if (isWritingModeRoot() && !isRubyRun())
return std::nullopt;
- if (shouldApplyLayoutContainment(*this))
+ if (shouldApplyLayoutContainment())
return RenderBlock::inlineBlockBaseline(lineDirection);
if (style().display() == DisplayType::InlineBlock) {
@@ -4083,7 +4083,7 @@
void RenderBlockFlow::computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
- ASSERT(!shouldApplyInlineSizeContainment(*this));
+ ASSERT(!shouldApplyInlineSizeContainment());
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
if (const_cast<RenderBlockFlow&>(*this).tryComputePreferredWidthsUsingModernPath(minLogicalWidth, maxLogicalWidth))