Rename RenderObject::isRoot() to isDocumentElementRenderer()
https://bugs.webkit.org/show_bug.cgi?id=149976
Reviewed by Zalan Bujtas.
RenderObject::isRoot() was confusingly named, because it returns true for
the document element's renderer, not for the actual root (the RenderView).
In this way it mismatched RenderLayer::isRootLayer(), which returned true
for the RenderView's layer.
Rename it to the more accurate isDocumentElementRenderer().
* dom/Node.cpp:
(WebCore::Node::renderRect):
* page/ios/FrameIOS.mm:
(WebCore::Frame::renderRectForPoint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
(WebCore::RenderBlock::isSelectionRoot):
(WebCore::RenderBlock::selectionGaps):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::requiresColumns):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleWillChange):
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::updateFromStyle):
(WebCore::RenderBox::paintBackground):
(WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
(WebCore::RenderBox::repaintLayerRectsForImage):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::createsNewFormattingContext):
(WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
* rendering/RenderBox.h:
(WebCore::RenderBox::stretchesToViewport):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/RenderBoxModelObject.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::rendererForRootBackground):
(WebCore::shouldRepaintForImageAnimation):
* rendering/RenderElement.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
* rendering/RenderLayer.cpp:
(WebCore::shouldSuppressPaintingLayer):
(WebCore::paintForFixedRootBackground):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::rendererBackgroundColor):
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleDidChange):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintSlowRepaintObject):
(WebCore::RenderObject::offsetParent):
* rendering/RenderObject.h:
(WebCore::RenderObject::isDocumentElementRenderer):
(WebCore::RenderObject::isRoot): Deleted.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paint):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
(WebCore::RenderSVGRoot::shouldApplyViewportClip):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::isOverflowHidden):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@190834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 4c9d07a..bdaa678 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,83 @@
+2015-10-09 Simon Fraser <simon.fraser@apple.com>
+
+ Rename RenderObject::isRoot() to isDocumentElementRenderer()
+ https://bugs.webkit.org/show_bug.cgi?id=149976
+
+ Reviewed by Zalan Bujtas.
+
+ RenderObject::isRoot() was confusingly named, because it returns true for
+ the document element's renderer, not for the actual root (the RenderView).
+ In this way it mismatched RenderLayer::isRootLayer(), which returned true
+ for the RenderView's layer.
+
+ Rename it to the more accurate isDocumentElementRenderer().
+
+ * dom/Node.cpp:
+ (WebCore::Node::renderRect):
+ * page/ios/FrameIOS.mm:
+ (WebCore::Frame::renderRectForPoint):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paint):
+ (WebCore::RenderBlock::isSelectionRoot):
+ (WebCore::RenderBlock::selectionGaps):
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
+ (WebCore::RenderBlockFlow::layoutBlock):
+ (WebCore::RenderBlockFlow::requiresColumns):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::styleWillChange):
+ (WebCore::RenderBox::styleDidChange):
+ (WebCore::RenderBox::updateFromStyle):
+ (WebCore::RenderBox::paintBackground):
+ (WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
+ (WebCore::RenderBox::repaintLayerRectsForImage):
+ (WebCore::RenderBox::computeLogicalHeight):
+ (WebCore::RenderBox::computePercentageLogicalHeight):
+ (WebCore::RenderBox::createsNewFormattingContext):
+ (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::stretchesToViewport):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+ (WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates):
+ (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+ * rendering/RenderBoxModelObject.h:
+ * rendering/RenderDeprecatedFlexibleBox.cpp:
+ (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::styleWillChange):
+ (WebCore::RenderElement::rendererForRootBackground):
+ (WebCore::shouldRepaintForImageAnimation):
+ * rendering/RenderElement.h:
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutBlock):
+ * rendering/RenderGrid.cpp:
+ (WebCore::RenderGrid::layoutBlock):
+ * rendering/RenderLayer.cpp:
+ (WebCore::shouldSuppressPaintingLayer):
+ (WebCore::paintForFixedRootBackground):
+ (WebCore::RenderLayer::paintLayerContents):
+ (WebCore::RenderLayer::calculateClipRects):
+ * rendering/RenderLayer.h:
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::rendererBackgroundColor):
+ (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
+ * rendering/RenderLayerModelObject.cpp:
+ (WebCore::RenderLayerModelObject::styleDidChange):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::repaintSlowRepaintObject):
+ (WebCore::RenderObject::offsetParent):
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isDocumentElementRenderer):
+ (WebCore::RenderObject::isRoot): Deleted.
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::paint):
+ * rendering/svg/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::layout):
+ (WebCore::RenderSVGRoot::shouldApplyViewportClip):
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::isOverflowHidden):
+
2015-10-09 Nan Wang <n_wang@apple.com>
AX: ARIA 1.1 implement aria-colcount, aria-colindex, aria-colspan, aria-rowcount, aria-rowindex and aria-rowspan
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index e840bdc..aeaad00 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -721,7 +721,7 @@
RenderObject* hitRenderer = this->renderer();
ASSERT(hitRenderer);
RenderObject* renderer = hitRenderer;
- while (renderer && !renderer->isBody() && !renderer->isRoot()) {
+ while (renderer && !renderer->isBody() && !renderer->isDocumentElementRenderer()) {
if (renderer->isRenderBlock() || renderer->isInlineBlockOrInlineTable() || renderer->isReplaced()) {
*isReplaced = renderer->isReplaced();
return renderer->absoluteBoundingBoxRect();
diff --git a/Source/WebCore/page/ios/FrameIOS.mm b/Source/WebCore/page/ios/FrameIOS.mm
index a3e7e8d..3565b36 100644
--- a/Source/WebCore/page/ios/FrameIOS.mm
+++ b/Source/WebCore/page/ios/FrameIOS.mm
@@ -241,7 +241,7 @@
#if RECT_LOGGING
printf("\n%f %f\n", point.x, point.y);
#endif
- while (renderer && !renderer->isBody() && !renderer->isRoot()) {
+ while (renderer && !renderer->isBody() && !renderer->isDocumentElementRenderer()) {
#if RECT_LOGGING
CGRect rect = renderer->absoluteBoundingBoxRect(true);
if (renderer->node()) {
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index 80f8245..3f3c222 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -1395,9 +1395,9 @@
PaintPhase phase = paintInfo.phase;
// Check if we need to do anything at all.
- // FIXME: Could eliminate the isRoot() check if we fix background painting so that the RenderView
+ // FIXME: Could eliminate the isDocumentElementRenderer() check if we fix background painting so that the RenderView
// paints the root's background.
- if (!isRoot()) {
+ if (!isDocumentElementRenderer()) {
LayoutRect overflowBox = overflowRectForPaintRejection(namedFlowFragment);
flipForWritingMode(overflowBox);
adjustRectWithMaximumOutline(phase, overflowBox);
@@ -1723,7 +1723,7 @@
if (isTable())
return false;
- if (isBody() || isRoot() || hasOverflowClip()
+ if (isBody() || isDocumentElementRenderer() || hasOverflowClip()
|| isPositioned() || isFloating()
|| isTableCell() || isInlineBlockOrInlineTable()
|| hasTransform() || hasReflection() || hasMask() || isWritingModeRoot()
@@ -1833,9 +1833,10 @@
rootBlock.flipForWritingMode(flippedBlockRect);
flippedBlockRect.moveBy(rootBlockPhysicalPosition);
clipOutPositionedObjects(paintInfo, flippedBlockRect.location(), positionedObjects());
- if (isBody() || isRoot()) // The <body> must make sure to examine its containingBlock's positioned objects.
+ if (isBody() || isDocumentElementRenderer()) { // The <body> must make sure to examine its containingBlock's positioned objects.
for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock())
clipOutPositionedObjects(paintInfo, LayoutPoint(cb->x(), cb->y()), cb->positionedObjects()); // FIXME: Not right for flipped writing modes.
+ }
clipOutFloatingObjects(rootBlock, paintInfo, rootBlockPhysicalPosition, offsetFromRootBlock);
}
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index 9a1d269..58c4954 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -213,7 +213,7 @@
}
// Inline blocks are covered by the isReplaced() check in the avoidFloats method.
- if (avoidsFloats() || isRoot() || isRenderView() || isFloatingOrOutOfFlowPositioned() || isTableCell()) {
+ if (avoidsFloats() || isDocumentElementRenderer() || isRenderView() || isFloatingOrOutOfFlowPositioned() || isTableCell()) {
if (m_floatingObjects)
m_floatingObjects->clear();
if (!oldIntrudingFloatSet.isEmpty())
@@ -521,7 +521,7 @@
if (heightChanged)
relayoutChildren = true;
- layoutPositionedObjects(relayoutChildren || isRoot());
+ layoutPositionedObjects(relayoutChildren || isDocumentElementRenderer());
// Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
computeOverflow(oldClientAfterEdge);
@@ -3838,7 +3838,7 @@
{
// If overflow-y is set to paged-x or paged-y on the body or html element, we'll handle the paginating
// in the RenderView instead.
- bool isPaginated = (style().overflowY() == OPAGEDX || style().overflowY() == OPAGEDY) && !(isRoot() || isBody());
+ bool isPaginated = (style().overflowY() == OPAGEDX || style().overflowY() == OPAGEDY) && !(isDocumentElementRenderer() || isBody());
return firstChild() && (desiredColumnCount != 1 || !style().hasAutoColumnWidth() || !style().hasInlineColumnAxis() || isPaginated);
}
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index 3b2df1a..81f7d86 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -293,7 +293,7 @@
if (oldStyle) {
// The background of the root element or the body element could propagate up to
// the canvas. Issue full repaint, when our style changes substantially.
- if (diff >= StyleDifferenceRepaint && (isRoot() || isBody())) {
+ if (diff >= StyleDifferenceRepaint && (isDocumentElementRenderer() || isBody())) {
view().repaintRootContents();
if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFixedBackground())
view().compositor().rootFixedBackgroundsChanged();
@@ -373,20 +373,20 @@
}
bool isBodyRenderer = isBody();
- bool isRootRenderer = isRoot();
+ bool isDocElementRenderer = isDocumentElementRenderer();
// Set the text color if we're the body.
if (isBodyRenderer)
document().setTextColor(newStyle.visitedDependentColor(CSSPropertyColor));
- if (isRootRenderer || isBodyRenderer) {
+ if (isDocElementRenderer || isBodyRenderer) {
// Propagate the new writing mode and direction up to the RenderView.
RenderStyle& viewStyle = view().style();
bool viewChangedWritingMode = false;
bool rootStyleChanged = false;
bool viewStyleChanged = false;
RenderObject* rootRenderer = isBodyRenderer ? document().documentElement()->renderer() : nullptr;
- if (viewStyle.direction() != newStyle.direction() && (isRootRenderer || !document().directionSetOnDocumentElement())) {
+ if (viewStyle.direction() != newStyle.direction() && (isDocElementRenderer || !document().directionSetOnDocumentElement())) {
viewStyle.setDirection(newStyle.direction());
viewStyleChanged = true;
if (isBodyRenderer) {
@@ -396,7 +396,7 @@
setNeedsLayoutAndPrefWidthsRecalc();
}
- if (viewStyle.writingMode() != newStyle.writingMode() && (isRootRenderer || !document().writingModeSetOnDocumentElement())) {
+ if (viewStyle.writingMode() != newStyle.writingMode() && (isDocElementRenderer || !document().writingModeSetOnDocumentElement())) {
viewStyle.setWritingMode(newStyle.writingMode());
viewChangedWritingMode = true;
viewStyleChanged = true;
@@ -477,17 +477,17 @@
RenderBoxModelObject::updateFromStyle();
const RenderStyle& styleToUse = style();
- bool isRootObject = isRoot();
+ bool isDocElementRenderer = isDocumentElementRenderer();
bool isViewObject = isRenderView();
// The root and the RenderView always paint their backgrounds/borders.
- if (isRootObject || isViewObject)
+ if (isDocElementRenderer || isViewObject)
setHasBoxDecorations(true);
setFloating(!isOutOfFlowPositioned() && styleToUse.isFloating());
// We also handle <body> and <html>, whose overflow applies to the viewport.
- if (styleToUse.overflowX() != OVISIBLE && !isRootObject && isRenderBlock()) {
+ if (styleToUse.overflowX() != OVISIBLE && !isDocElementRenderer && isRenderBlock()) {
bool boxHasOverflowClip = true;
if (isBody()) {
// Overflow on the body can propagate to the viewport under the following conditions.
@@ -1325,7 +1325,7 @@
void RenderBox::paintBackground(const PaintInfo& paintInfo, const LayoutRect& paintRect, BackgroundBleedAvoidance bleedAvoidance)
{
- if (isRoot()) {
+ if (isDocumentElementRenderer()) {
paintRootBoxFillLayers(paintInfo);
return;
}
@@ -1463,7 +1463,7 @@
if (!hasBackground())
return false;
// Table and root background painting is special.
- if (isTable() || isRoot())
+ if (isTable() || isDocumentElementRenderer())
return false;
LayoutRect backgroundRect;
@@ -1670,7 +1670,7 @@
for (const FillLayer* curLayer = layers; curLayer; curLayer = curLayer->next()) {
if (curLayer->image() && image == curLayer->image()->data() && curLayer->image()->canRender(this, style().effectiveZoom())) {
// Now that we know this image is being used, compute the renderer and the rect if we haven't already.
- bool drawingRootBackground = drawingBackground && (isRoot() || (isBody() && !document().documentElement()->renderer()->hasBackground()));
+ bool drawingRootBackground = drawingBackground && (isDocumentElementRenderer() || (isBody() && !document().documentElement()->renderer()->hasBackground()));
if (!layerRenderer) {
if (drawingRootBackground) {
layerRenderer = &view();
@@ -2801,11 +2801,11 @@
// height since we don't set a height in RenderView when we're printing. So without this quirk, the
// height has nothing to be a percentage of, and it ends up being 0. That is bad.
bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercentOrCalculated()
- && (isRoot() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercentOrCalculated())) && !isInline();
+ && (isDocumentElementRenderer() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercentOrCalculated())) && !isInline();
if (stretchesToViewport() || paginatedContentNeedsBaseHeight) {
LayoutUnit margins = collapsedMarginBefore() + collapsedMarginAfter();
LayoutUnit visibleHeight = view().pageOrViewLogicalHeight();
- if (isRoot())
+ if (isDocumentElementRenderer())
computedValues.m_extent = std::max(computedValues.m_extent, visibleHeight - margins);
else {
LayoutUnit marginsBordersPadding = margins + parentBox()->marginBefore() + parentBox()->marginAfter() + parentBox()->borderAndPaddingLogicalHeight();
@@ -2879,7 +2879,7 @@
LayoutUnit rootMarginBorderPaddingHeight = 0;
bool isHorizontal = isHorizontalWritingMode();
while (!cb->isRenderView() && skipContainingBlockForPercentHeightCalculation(cb, isHorizontal != cb->isHorizontalWritingMode())) {
- if (cb->isBody() || cb->isRoot())
+ if (cb->isBody() || cb->isDocumentElementRenderer())
rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfter() + cb->borderAndPaddingLogicalHeight();
skippedAutoHeightContainingBlock = true;
containingBlockChild = cb;
@@ -4381,7 +4381,7 @@
bool RenderBox::createsNewFormattingContext() const
{
return (isInlineBlockOrInlineTable() && !isAnonymousInlineBlock()) || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
- || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isRoot() || isRenderFlowThread() || isRenderRegion()
+ || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElementRenderer() || isRenderFlowThread() || isRenderRegion()
#if ENABLE(CSS_GRID_LAYOUT)
|| isGridItem()
#endif
@@ -4608,7 +4608,7 @@
return percentageLogicalHeightIsResolvableFromBlock(cb->containingBlock(), cb->isOutOfFlowPositioned());
if (cb->isRenderView() || inQuirksMode || isOutOfFlowPositionedWithSpecifiedHeight)
return true;
- if (cb->isRoot() && isOutOfFlowPositioned) {
+ if (cb->isDocumentElementRenderer() && isOutOfFlowPositioned) {
// Match the positioned objects behavior, which is that positioned objects will fill their viewport
// always. Note we could only hit this case by recurring into computePercentageLogicalHeight on a positioned containing block.
return true;
diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h
index 6d5703a..7fcd185 100644
--- a/Source/WebCore/rendering/RenderBox.h
+++ b/Source/WebCore/rendering/RenderBox.h
@@ -53,7 +53,7 @@
// position:static elements that are not flex-items get their z-index coerced to auto.
virtual bool requiresLayer() const override
{
- return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip()
+ return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip()
|| hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection() || style().specifiesColumns()
|| !style().hasAutoZIndex();
}
@@ -407,7 +407,7 @@
bool stretchesToViewport() const
{
- return document().inQuirksMode() && style().logicalHeight().isAuto() && !isFloatingOrOutOfFlowPositioned() && (isRoot() || isBody()) && !isInline();
+ return document().inQuirksMode() && style().logicalHeight().isAuto() && !isFloatingOrOutOfFlowPositioned() && (isDocumentElementRenderer() || isBody()) && !isInline();
}
virtual LayoutSize intrinsicSize() const { return LayoutSize(); }
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp
index fca97ad..1dcbbce 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp
@@ -628,7 +628,7 @@
bool hasRoundedBorder = style().hasBorderRadius() && (includeLeftEdge || includeRightEdge);
bool clippedWithLocalScrolling = hasOverflowClip() && bgLayer->attachment() == LocalBackgroundAttachment;
bool isBorderFill = bgLayer->clip() == BorderFillBox;
- bool isRoot = this->isRoot();
+ bool isRoot = this->isDocumentElementRenderer();
Color bgColor = color;
StyleImage* bgImage = bgLayer->image();
@@ -1028,7 +1028,7 @@
bool RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates() const
{
- if (!isRoot())
+ if (!isDocumentElementRenderer())
return false;
if (view().frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers)
@@ -1084,7 +1084,7 @@
// The background of the box generated by the root element covers the entire canvas including
// its margins. Since those were added in already, we have to factor them out when computing
// the background positioning area.
- if (isRoot()) {
+ if (isDocumentElementRenderer()) {
positioningAreaSize = downcast<RenderBox>(*this).size() - LayoutSize(left + right, top + bottom);
positioningAreaSize = LayoutSize(snapSizeToDevicePixel(positioningAreaSize, LayoutPoint(), deviceScaleFactor));
if (view().frameView().hasExtendedBackgroundRectForPainting()) {
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.h b/Source/WebCore/rendering/RenderBoxModelObject.h
index 58805e0..c94205d 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.h
+++ b/Source/WebCore/rendering/RenderBoxModelObject.h
@@ -127,7 +127,7 @@
virtual void updateFromStyle() override;
- virtual bool requiresLayer() const override { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection(); }
+ virtual bool requiresLayer() const override { return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasClipPath() || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection(); }
// This will work on inlines to return the bounding box of all of the lines' border boxes.
virtual IntRect borderBoundingBox() const = 0;
diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
index 61350b4..3e8c496 100644
--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -321,7 +321,7 @@
if (previousSize.height() != height())
relayoutChildren = true;
- layoutPositionedObjects(relayoutChildren || isRoot());
+ layoutPositionedObjects(relayoutChildren || isDocumentElementRenderer());
computeOverflow(oldClientAfterEdge);
diff --git a/Source/WebCore/rendering/RenderElement.cpp b/Source/WebCore/rendering/RenderElement.cpp
index 3715f7b..996ef7f 100644
--- a/Source/WebCore/rendering/RenderElement.cpp
+++ b/Source/WebCore/rendering/RenderElement.cpp
@@ -895,7 +895,7 @@
bool newStyleSlowScroll = repaintFixedBackgroundsOnScroll && newStyleUsesFixedBackgrounds;
bool oldStyleSlowScroll = oldStyle && repaintFixedBackgroundsOnScroll && oldStyleUsesFixedBackgrounds;
- bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document().documentElement()->renderer()));
+ bool drawsRootBackground = isDocumentElementRenderer() || (isBody() && !rendererHasBackground(document().documentElement()->renderer()));
if (drawsRootBackground && repaintFixedBackgroundsOnScroll) {
if (view().compositor().supportsFixedRootBackgroundCompositing()) {
if (newStyleSlowScroll && newStyle.hasEntirelyFixedBackground())
@@ -915,7 +915,7 @@
}
}
- if (isRoot() || isBody())
+ if (isDocumentElementRenderer() || isBody())
view().frameView().updateExtendBackgroundIfNecessary();
if (!oldStyle || (oldStyle->outlineSize() != newStyle.outlineSize()
@@ -1155,7 +1155,7 @@
RenderElement& RenderElement::rendererForRootBackground()
{
- ASSERT(isRoot());
+ ASSERT(isDocumentElementRenderer());
if (!hasBackground() && is<HTMLHtmlElement>(element())) {
// Locate the <body> element using the DOM. This is easier than trying
// to crawl around a render tree with potential :before/:after content and
@@ -1441,10 +1441,10 @@
// FIXME: This is overly conservative as the image may not be a background-image, in which case it will not
// be propagated to the root. At this point, we unfortunately don't have access to the image anymore so we
// can no longer check if it is a background image.
- bool backgroundIsPaintedByRoot = renderer.isRoot();
+ bool backgroundIsPaintedByRoot = renderer.isDocumentElementRenderer();
if (renderer.isBody()) {
auto& rootRenderer = *renderer.parent(); // If <body> has a renderer then <html> does too.
- ASSERT(rootRenderer.isRoot());
+ ASSERT(rootRenderer.isDocumentElementRenderer());
ASSERT(is<HTMLHtmlElement>(rootRenderer.element()));
// FIXME: Should share body background propagation code.
backgroundIsPaintedByRoot = !rootRenderer.hasBackground();
diff --git a/Source/WebCore/rendering/RenderElement.h b/Source/WebCore/rendering/RenderElement.h
index 3b9fd93..e49f529 100644
--- a/Source/WebCore/rendering/RenderElement.h
+++ b/Source/WebCore/rendering/RenderElement.h
@@ -134,7 +134,7 @@
/* This function performs a layout only if one is needed. */
void layoutIfNeeded() { if (needsLayout()) layout(); }
- // Return the renderer whose background style is used to paint the root background. Should only be called on the renderer for which isRoot() is true.
+ // Return the renderer whose background style is used to paint the root background. Should only be called on the renderer for which isDocumentElementRenderer() is true.
RenderElement& rendererForRootBackground();
// Used only by Element::pseudoStyleCacheIsInvalid to get a first line style based off of a
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp
index 3a02812..4379d73 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp
@@ -279,7 +279,7 @@
if (logicalHeight() != previousHeight)
relayoutChildren = true;
- layoutPositionedObjects(relayoutChildren || isRoot());
+ layoutPositionedObjects(relayoutChildren || isDocumentElementRenderer());
repaintChildrenDuringLayoutIfMoved(oldChildRects);
// FIXME: css3/flexbox/repaint-rtl-column.html seems to repaint more overflow than it needs to.
diff --git a/Source/WebCore/rendering/RenderGrid.cpp b/Source/WebCore/rendering/RenderGrid.cpp
index 5dc3f76..8f1d33d 100644
--- a/Source/WebCore/rendering/RenderGrid.cpp
+++ b/Source/WebCore/rendering/RenderGrid.cpp
@@ -320,7 +320,7 @@
if (size() != previousSize)
relayoutChildren = true;
- layoutPositionedObjects(relayoutChildren || isRoot());
+ layoutPositionedObjects(relayoutChildren || isDocumentElementRenderer());
computeOverflow(oldClientAfterEdge);
statePusher.pop();
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 0b2519f..351b704 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -3864,7 +3864,7 @@
// Avoid painting descendants of the root layer when stylesheets haven't loaded. This eliminates FOUC.
// It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document
// will do a full repaint().
- if (layer->renderer().document().didLayoutWithPendingStylesheets() && !layer->isRootLayer() && !layer->renderer().isRoot())
+ if (layer->renderer().document().didLayoutWithPendingStylesheets() && !layer->isRootLayer() && !layer->renderer().isDocumentElementRenderer())
return true;
// Avoid painting all layers if the document is in a state where visual updates aren't allowed.
@@ -3877,7 +3877,7 @@
static inline bool paintForFixedRootBackground(const RenderLayer* layer, RenderLayer::PaintLayerFlags paintFlags)
{
- return layer->renderer().isRoot() && (paintFlags & RenderLayer::PaintLayerPaintingRootBackgroundOnly);
+ return layer->renderer().isDocumentElementRenderer() && (paintFlags & RenderLayer::PaintLayerPaintingRootBackgroundOnly);
}
void RenderLayer::paintLayer(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
@@ -4234,7 +4234,7 @@
|| (!isPaintingScrollingContent && isPaintingCompositedForeground));
bool shouldPaintContent = m_hasVisibleContent && isSelfPaintingLayer && !isPaintingOverlayScrollbars;
- if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly && !renderer().isRenderView() && !renderer().isRoot())
+ if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly && !renderer().isRenderView() && !renderer().isDocumentElementRenderer())
return;
// Ensure our lists are up-to-date.
@@ -5759,9 +5759,9 @@
bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutSize& offsetFromRoot, const LayoutRect* cachedBoundingBox) const
{
// Always examine the canvas and the root.
- // FIXME: Could eliminate the isRoot() check if we fix background painting so that the RenderView
+ // FIXME: Could eliminate the isDocumentElementRenderer() check if we fix background painting so that the RenderView
// paints the root's background.
- if (isRootLayer() || renderer().isRoot())
+ if (isRootLayer() || renderer().isDocumentElementRenderer())
return true;
if (damageRect.isEmpty())
@@ -5932,7 +5932,7 @@
renderer().containingBlock()->flipForWritingMode(boundingBoxRect);
}
- if (renderer().isRoot()) {
+ if (renderer().isDocumentElementRenderer()) {
// If the root layer becomes composited (e.g. because some descendant with negative z-index is composited),
// then it has to be big enough to cover the viewport in order to display the background. This is akin
// to the code in RenderBox::paintRootBoxFillLayers().
@@ -6127,7 +6127,7 @@
if (paintsWithTransparency(PaintBehaviorNormal))
return false;
- if (renderer().isRoot()) {
+ if (renderer().isDocumentElementRenderer()) {
// Normally the document element doens't have a layer. If it does have a layer, its background propagates to the RenderView
// so this layer doesn't draw it.
return false;
diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h
index 979b6c0..0f21aa0 100644
--- a/Source/WebCore/rendering/RenderLayer.h
+++ b/Source/WebCore/rendering/RenderLayer.h
@@ -616,7 +616,7 @@
bool paintsWithTransparency(PaintBehavior paintBehavior) const
{
- return (isTransparent() || hasBlendMode() || (isolatesBlending() && !renderer().isRoot())) && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited());
+ return (isTransparent() || hasBlendMode() || (isolatesBlending() && !renderer().isDocumentElementRenderer())) && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited());
}
bool paintsWithTransform(PaintBehavior) const;
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 39041a7..618d82c 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -1703,7 +1703,7 @@
Color RenderLayerBacking::rendererBackgroundColor() const
{
- const auto& backgroundRenderer = renderer().isRoot() ? renderer().rendererForRootBackground() : renderer();
+ const auto& backgroundRenderer = renderer().isDocumentElementRenderer() ? renderer().rendererForRootBackground() : renderer();
return backgroundRenderer.style().visitedDependentColor(CSSPropertyBackgroundColor);
}
@@ -1860,7 +1860,7 @@
if (renderer().isRenderNamedFlowFragmentContainer())
return false;
- if (renderer().isRoot() && m_owningLayer.isolatesCompositedBlending())
+ if (renderer().isDocumentElementRenderer() && m_owningLayer.isolatesCompositedBlending())
return false;
if (renderer().isRenderView()) {
diff --git a/Source/WebCore/rendering/RenderLayerModelObject.cpp b/Source/WebCore/rendering/RenderLayerModelObject.cpp
index 599a173..117b6ff 100644
--- a/Source/WebCore/rendering/RenderLayerModelObject.cpp
+++ b/Source/WebCore/rendering/RenderLayerModelObject.cpp
@@ -190,7 +190,7 @@
if (RenderLayer* renderLayer = layer()) {
renderLayer->updateSnapOffsets();
renderLayer->updateScrollSnapState();
- } else if (isBody() || isRoot()) {
+ } else if (isBody() || isDocumentElementRenderer()) {
FrameView& frameView = view().frameView();
frameView.updateSnapOffsets();
frameView.updateScrollSnapState();
@@ -204,7 +204,7 @@
if (style.scrollSnapType() != ScrollSnapType::None) {
scrollSnapBox->layer()->updateSnapOffsets();
scrollSnapBox->layer()->updateScrollSnapState();
- if (scrollSnapBox->isBody() || scrollSnapBox->isRoot())
+ if (scrollSnapBox->isBody() || scrollSnapBox->isDocumentElementRenderer())
scrollSnapBox->view().frameView().updateScrollingCoordinatorScrollSnapProperties();
}
}
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index 2ccf77f..7d4df34 100644
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -966,7 +966,7 @@
IntRect repaintRect;
// If this is the root background, we need to check if there is an extended background rect. If
// there is, then we should not allow painting to clip to the layer size.
- if (isRoot() || isBody()) {
+ if (isDocumentElementRenderer() || isBody()) {
shouldClipToLayer = !view.frameView().hasExtendedBackgroundRectForPainting();
repaintRect = snappedIntRect(view.backgroundRect());
} else
@@ -1915,7 +1915,7 @@
// A is the root element.
// A is the HTML body element.
// The computed value of the position property for element A is fixed.
- if (isRoot() || isBody() || (isOutOfFlowPositioned() && style().position() == FixedPosition))
+ if (isDocumentElementRenderer() || isBody() || (isOutOfFlowPositioned() && style().position() == FixedPosition))
return nullptr;
// If A is an area HTML element which has a map HTML element somewhere in the ancestor
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index e1a3817..d81cebd 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -345,7 +345,7 @@
virtual bool isRenderScrollbarPart() const { return false; }
- bool isRoot() const { return document().documentElement() == &m_node; }
+ bool isDocumentElementRenderer() const { return document().documentElement() == &m_node; }
bool isBody() const { return node() && node()->hasTagName(HTMLNames::bodyTag); }
bool isHR() const { return node() && node()->hasTagName(HTMLNames::hrTag); }
bool isLegend() const;
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index 485595a..00c8993 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -658,7 +658,7 @@
PaintPhase paintPhase = paintInfo.phase;
- if (!isRoot()) {
+ if (!isDocumentElementRenderer()) {
LayoutRect overflowBox = visualOverflowRect();
adjustRectWithMaximumOutline(paintInfo.phase, overflowBox);
flipForWritingMode(overflowBox);
diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
index e42f010..9fef1d3 100644
--- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
@@ -202,7 +202,7 @@
}
updateLayerTransform();
- m_hasBoxDecorations = isRoot() ? hasBoxDecorationStyle() : hasBoxDecorations();
+ m_hasBoxDecorations = isDocumentElementRenderer() ? hasBoxDecorationStyle() : hasBoxDecorations();
invalidateBackgroundObscurationStatus();
repainter.repaintAfterLayout();
@@ -218,7 +218,7 @@
return style().overflowX() == OHIDDEN
|| style().overflowX() == OAUTO
|| style().overflowX() == OSCROLL
- || this->isRoot();
+ || this->isDocumentElementRenderer();
}
void RenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
index 3db3cc9..3fb4f11 100644
--- a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
@@ -299,7 +299,7 @@
bool SVGRenderSupport::isOverflowHidden(const RenderElement& renderer)
{
// RenderSVGRoot should never query for overflow state - it should always clip itself to the initial viewport size.
- ASSERT(!renderer.isRoot());
+ ASSERT(!renderer.isDocumentElementRenderer());
return renderer.style().overflowX() == OHIDDEN || renderer.style().overflowX() == OSCROLL;
}