Skip to content

Commit

Permalink
[content-visibility] Rename shouldSkipContent to isSkippedContentRoot
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258974

Reviewed by Tim Nguyen.

Rename shouldSkipContent to isSkippedContentRoot to be consistent with isInertSubtreeRoot.

* Source/WebCore/dom/Document.cpp:
(WebCore::CallbackForContainIntrinsicSize):
(WebCore::Document::caretPositionFromPoint):
* Source/WebCore/editing/TextIterator.cpp:
(WebCore::TextIterator::advance):
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintContents):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
(WebCore::RenderBox::explicitIntrinsicInnerWidth const):
(WebCore::RenderBox::explicitIntrinsicInnerHeight const):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintList):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::isSkippedContentRoot const):
(WebCore::RenderObject::shouldSkipContent const): Deleted.
* Source/WebCore/rendering/RenderObject.h:
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* Source/WebCore/rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paint):
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):

Canonical link: https://commits.webkit.org/265846@main
  • Loading branch information
rwlbuis committed Jul 7, 2023
1 parent e4b3080 commit 7446735
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Source/WebCore/dom/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ static void CallbackForContainIntrinsicSize(const Vector<Ref<ResizeObserverEntry
observer.unobserve(*target);
continue;
}
ASSERT(!box->shouldSkipContent());
ASSERT(!box->isSkippedContentRoot());
ASSERT(box->style().hasAutoLengthContainIntrinsicSize());

auto contentBoxSize = entry->contentBoxSize().at(0);
Expand Down Expand Up @@ -1671,7 +1671,7 @@ std::optional<BoundaryPoint> Document::caretPositionFromPoint(const LayoutPoint&
if (!renderer)
return std::nullopt;

if (renderer->shouldSkipContent())
if (renderer->isSkippedContentRoot())
return { { *node, 0 } };

auto rangeCompliantPosition = renderer->positionForPoint(localPoint).parentAnchoredEquivalent();
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/editing/TextIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ void TextIterator::advance()
if (!isRendererVisible(renderer, m_behaviors)) {
m_handledNode = true;
m_handledChildren = !hasDisplayContents(*m_node) && !renderer;
} else if (is<Element>(m_node) && renderer->shouldSkipContent()) {
} else if (is<Element>(m_node) && renderer->isSkippedContentRoot()) {
m_handledChildren = true;
} else {
// handle current node according to its type
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)

void RenderBlock::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (shouldSkipContent())
if (isSkippedContentRoot())
return;

if (childrenInline())
Expand Down
6 changes: 3 additions & 3 deletions Source/WebCore/rendering/RenderBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ bool RenderBox::foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, u
if (!maxDepthToTest)
return false;

if (shouldSkipContent())
if (isSkippedContentRoot())
return false;

for (auto& childBox : childrenOfType<RenderBox>(*this)) {
Expand Down Expand Up @@ -5676,7 +5676,7 @@ std::optional<LayoutUnit> RenderBox::explicitIntrinsicInnerWidth() const
if (style().containIntrinsicWidthType() == ContainIntrinsicSizeType::None)
return std::nullopt;

if (element() && style().containIntrinsicWidthHasAuto() && shouldSkipContent()) {
if (element() && style().containIntrinsicWidthHasAuto() && isSkippedContentRoot()) {
if (auto width = isHorizontalWritingMode() ? element()->lastRememberedLogicalWidth() : element()->lastRememberedLogicalHeight())
return width;
}
Expand All @@ -5695,7 +5695,7 @@ std::optional<LayoutUnit> RenderBox::explicitIntrinsicInnerHeight() const
if (style().containIntrinsicHeightType() == ContainIntrinsicSizeType::None)
return std::nullopt;

if (element() && style().containIntrinsicHeightHasAuto() && shouldSkipContent()) {
if (element() && style().containIntrinsicHeightHasAuto() && isSkippedContentRoot()) {
if (auto height = isHorizontalWritingMode() ? element()->lastRememberedLogicalHeight() : element()->lastRememberedLogicalWidth())
return height;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3460,7 +3460,7 @@ void RenderLayer::paintList(LayerList layerIterator, GraphicsContext& context, c
if (layerIterator.begin() == layerIterator.end())
return;

if (!hasSelfPaintingLayerDescendant() || renderer().shouldSkipContent())
if (!hasSelfPaintingLayerDescendant() || renderer().isSkippedContentRoot())
return;

#if ASSERT_ENABLED
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2676,7 +2676,7 @@ bool RenderObject::isSkippedContent() const
return parent() && parent()->style().effectiveSkipsContent();
}

bool RenderObject::shouldSkipContent() const
bool RenderObject::isSkippedContentRoot() const
{
return style().contentVisibility() == ContentVisibility::Hidden;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ class RenderObject : public CachedImageClient {

bool isSkippedContent() const;

bool shouldSkipContent() const;
bool isSkippedContentRoot() const;

protected:
//////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderReplaced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void RenderReplaced::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
}

if (!completelyClippedOut) {
if (!shouldSkipContent())
if (!isSkippedContentRoot())
paintReplaced(paintInfo, adjustedPaintOffset);

if (style().hasBorderRadius())
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void RenderWidget::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
BackgroundPainter::clipRoundedInnerRect(paintInfo.context(), borderRect, roundedInnerRect);
}

if (m_widget && !shouldSkipContent())
if (m_widget && !isSkippedContentRoot())
paintContents(paintInfo, paintOffset);

if (style().hasBorderRadius())
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void RenderTreeUpdater::updateElementRenderer(Element& element, const Style::Ele
auto scopeExit = makeScopeExit([&] {
if (!hasDisplayContents) {
auto* box = element.renderBox();
if (box && box->style().hasAutoLengthContainIntrinsicSize() && !box->shouldSkipContent())
if (box && box->style().hasAutoLengthContainIntrinsicSize() && !box->isSkippedContentRoot())
m_document.observeForContainIntrinsicSize(element);
else
m_document.unobserveForContainIntrinsicSize(element);
Expand Down

0 comments on commit 7446735

Please sign in to comment.