Changeset 190834 in webkit


Ignore:
Timestamp:
Oct 9, 2015 7:20:52 PM (9 years ago)
Author:
Simon Fraser
Message:

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):

Location:
trunk/Source/WebCore
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r190833 r190834  
     12015-10-09  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Rename RenderObject::isRoot() to isDocumentElementRenderer()
     4        https://bugs.webkit.org/show_bug.cgi?id=149976
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        RenderObject::isRoot() was confusingly named, because it returns true for
     9        the document element's renderer, not for the actual root (the RenderView).
     10        In this way it mismatched RenderLayer::isRootLayer(), which returned true
     11        for the RenderView's layer.
     12       
     13        Rename it to the more accurate isDocumentElementRenderer().
     14
     15        * dom/Node.cpp:
     16        (WebCore::Node::renderRect):
     17        * page/ios/FrameIOS.mm:
     18        (WebCore::Frame::renderRectForPoint):
     19        * rendering/RenderBlock.cpp:
     20        (WebCore::RenderBlock::paint):
     21        (WebCore::RenderBlock::isSelectionRoot):
     22        (WebCore::RenderBlock::selectionGaps):
     23        * rendering/RenderBlockFlow.cpp:
     24        (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
     25        (WebCore::RenderBlockFlow::layoutBlock):
     26        (WebCore::RenderBlockFlow::requiresColumns):
     27        * rendering/RenderBox.cpp:
     28        (WebCore::RenderBox::styleWillChange):
     29        (WebCore::RenderBox::styleDidChange):
     30        (WebCore::RenderBox::updateFromStyle):
     31        (WebCore::RenderBox::paintBackground):
     32        (WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
     33        (WebCore::RenderBox::repaintLayerRectsForImage):
     34        (WebCore::RenderBox::computeLogicalHeight):
     35        (WebCore::RenderBox::computePercentageLogicalHeight):
     36        (WebCore::RenderBox::createsNewFormattingContext):
     37        (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
     38        * rendering/RenderBox.h:
     39        (WebCore::RenderBox::stretchesToViewport):
     40        * rendering/RenderBoxModelObject.cpp:
     41        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
     42        (WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates):
     43        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
     44        * rendering/RenderBoxModelObject.h:
     45        * rendering/RenderDeprecatedFlexibleBox.cpp:
     46        (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
     47        * rendering/RenderElement.cpp:
     48        (WebCore::RenderElement::styleWillChange):
     49        (WebCore::RenderElement::rendererForRootBackground):
     50        (WebCore::shouldRepaintForImageAnimation):
     51        * rendering/RenderElement.h:
     52        * rendering/RenderFlexibleBox.cpp:
     53        (WebCore::RenderFlexibleBox::layoutBlock):
     54        * rendering/RenderGrid.cpp:
     55        (WebCore::RenderGrid::layoutBlock):
     56        * rendering/RenderLayer.cpp:
     57        (WebCore::shouldSuppressPaintingLayer):
     58        (WebCore::paintForFixedRootBackground):
     59        (WebCore::RenderLayer::paintLayerContents):
     60        (WebCore::RenderLayer::calculateClipRects):
     61        * rendering/RenderLayer.h:
     62        * rendering/RenderLayerBacking.cpp:
     63        (WebCore::RenderLayerBacking::rendererBackgroundColor):
     64        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
     65        * rendering/RenderLayerModelObject.cpp:
     66        (WebCore::RenderLayerModelObject::styleDidChange):
     67        * rendering/RenderObject.cpp:
     68        (WebCore::RenderObject::repaintSlowRepaintObject):
     69        (WebCore::RenderObject::offsetParent):
     70        * rendering/RenderObject.h:
     71        (WebCore::RenderObject::isDocumentElementRenderer):
     72        (WebCore::RenderObject::isRoot): Deleted.
     73        * rendering/RenderTable.cpp:
     74        (WebCore::RenderTable::paint):
     75        * rendering/svg/RenderSVGRoot.cpp:
     76        (WebCore::RenderSVGRoot::layout):
     77        (WebCore::RenderSVGRoot::shouldApplyViewportClip):
     78        * rendering/svg/SVGRenderSupport.cpp:
     79        (WebCore::SVGRenderSupport::isOverflowHidden):
     80
    1812015-10-09  Nan Wang  <n_wang@apple.com>
    282
  • trunk/Source/WebCore/dom/Node.cpp

    r190530 r190834  
    722722    ASSERT(hitRenderer);
    723723    RenderObject* renderer = hitRenderer;
    724     while (renderer && !renderer->isBody() && !renderer->isRoot()) {
     724    while (renderer && !renderer->isBody() && !renderer->isDocumentElementRenderer()) {
    725725        if (renderer->isRenderBlock() || renderer->isInlineBlockOrInlineTable() || renderer->isReplaced()) {
    726726            *isReplaced = renderer->isReplaced();
  • trunk/Source/WebCore/page/ios/FrameIOS.mm

    r189576 r190834  
    242242    printf("\n%f %f\n", point.x, point.y);
    243243#endif
    244     while (renderer && !renderer->isBody() && !renderer->isRoot()) {
     244    while (renderer && !renderer->isBody() && !renderer->isDocumentElementRenderer()) {
    245245#if RECT_LOGGING
    246246        CGRect rect = renderer->absoluteBoundingBoxRect(true);
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r190169 r190834  
    13961396
    13971397    // Check if we need to do anything at all.
    1398     // FIXME: Could eliminate the isRoot() check if we fix background painting so that the RenderView
     1398    // FIXME: Could eliminate the isDocumentElementRenderer() check if we fix background painting so that the RenderView
    13991399    // paints the root's background.
    1400     if (!isRoot()) {
     1400    if (!isDocumentElementRenderer()) {
    14011401        LayoutRect overflowBox = overflowRectForPaintRejection(namedFlowFragment);
    14021402        flipForWritingMode(overflowBox);
     
    17241724        return false;
    17251725       
    1726     if (isBody() || isRoot() || hasOverflowClip()
     1726    if (isBody() || isDocumentElementRenderer() || hasOverflowClip()
    17271727        || isPositioned() || isFloating()
    17281728        || isTableCell() || isInlineBlockOrInlineTable()
     
    18341834        flippedBlockRect.moveBy(rootBlockPhysicalPosition);
    18351835        clipOutPositionedObjects(paintInfo, flippedBlockRect.location(), positionedObjects());
    1836         if (isBody() || isRoot()) // The <body> must make sure to examine its containingBlock's positioned objects.
     1836        if (isBody() || isDocumentElementRenderer()) { // The <body> must make sure to examine its containingBlock's positioned objects.
    18371837            for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock())
    18381838                clipOutPositionedObjects(paintInfo, LayoutPoint(cb->x(), cb->y()), cb->positionedObjects()); // FIXME: Not right for flipped writing modes.
     1839        }
    18391840        clipOutFloatingObjects(rootBlock, paintInfo, rootBlockPhysicalPosition, offsetFromRootBlock);
    18401841    }
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r189830 r190834  
    214214
    215215    // Inline blocks are covered by the isReplaced() check in the avoidFloats method.
    216     if (avoidsFloats() || isRoot() || isRenderView() || isFloatingOrOutOfFlowPositioned() || isTableCell()) {
     216    if (avoidsFloats() || isDocumentElementRenderer() || isRenderView() || isFloatingOrOutOfFlowPositioned() || isTableCell()) {
    217217        if (m_floatingObjects)
    218218            m_floatingObjects->clear();
     
    522522        relayoutChildren = true;
    523523
    524     layoutPositionedObjects(relayoutChildren || isRoot());
     524    layoutPositionedObjects(relayoutChildren || isDocumentElementRenderer());
    525525
    526526    // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
     
    38393839    // If overflow-y is set to paged-x or paged-y on the body or html element, we'll handle the paginating
    38403840    // in the RenderView instead.
    3841     bool isPaginated = (style().overflowY() == OPAGEDX || style().overflowY() == OPAGEDY) && !(isRoot() || isBody());
     3841    bool isPaginated = (style().overflowY() == OPAGEDX || style().overflowY() == OPAGEDY) && !(isDocumentElementRenderer() || isBody());
    38423842
    38433843    return firstChild() && (desiredColumnCount != 1 || !style().hasAutoColumnWidth() || !style().hasInlineColumnAxis() || isPaginated);
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r190732 r190834  
    294294        // The background of the root element or the body element could propagate up to
    295295        // the canvas. Issue full repaint, when our style changes substantially.
    296         if (diff >= StyleDifferenceRepaint && (isRoot() || isBody())) {
     296        if (diff >= StyleDifferenceRepaint && (isDocumentElementRenderer() || isBody())) {
    297297            view().repaintRootContents();
    298298            if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFixedBackground())
     
    374374
    375375    bool isBodyRenderer = isBody();
    376     bool isRootRenderer = isRoot();
     376    bool isDocElementRenderer = isDocumentElementRenderer();
    377377
    378378    // Set the text color if we're the body.
     
    380380        document().setTextColor(newStyle.visitedDependentColor(CSSPropertyColor));
    381381
    382     if (isRootRenderer || isBodyRenderer) {
     382    if (isDocElementRenderer || isBodyRenderer) {
    383383        // Propagate the new writing mode and direction up to the RenderView.
    384384        RenderStyle& viewStyle = view().style();
     
    387387        bool viewStyleChanged = false;
    388388        RenderObject* rootRenderer = isBodyRenderer ? document().documentElement()->renderer() : nullptr;
    389         if (viewStyle.direction() != newStyle.direction() && (isRootRenderer || !document().directionSetOnDocumentElement())) {
     389        if (viewStyle.direction() != newStyle.direction() && (isDocElementRenderer || !document().directionSetOnDocumentElement())) {
    390390            viewStyle.setDirection(newStyle.direction());
    391391            viewStyleChanged = true;
     
    397397        }
    398398
    399         if (viewStyle.writingMode() != newStyle.writingMode() && (isRootRenderer || !document().writingModeSetOnDocumentElement())) {
     399        if (viewStyle.writingMode() != newStyle.writingMode() && (isDocElementRenderer || !document().writingModeSetOnDocumentElement())) {
    400400            viewStyle.setWritingMode(newStyle.writingMode());
    401401            viewChangedWritingMode = true;
     
    478478
    479479    const RenderStyle& styleToUse = style();
    480     bool isRootObject = isRoot();
     480    bool isDocElementRenderer = isDocumentElementRenderer();
    481481    bool isViewObject = isRenderView();
    482482
    483483    // The root and the RenderView always paint their backgrounds/borders.
    484     if (isRootObject || isViewObject)
     484    if (isDocElementRenderer || isViewObject)
    485485        setHasBoxDecorations(true);
    486486
     
    488488
    489489    // We also handle <body> and <html>, whose overflow applies to the viewport.
    490     if (styleToUse.overflowX() != OVISIBLE && !isRootObject && isRenderBlock()) {
     490    if (styleToUse.overflowX() != OVISIBLE && !isDocElementRenderer && isRenderBlock()) {
    491491        bool boxHasOverflowClip = true;
    492492        if (isBody()) {
     
    13261326void RenderBox::paintBackground(const PaintInfo& paintInfo, const LayoutRect& paintRect, BackgroundBleedAvoidance bleedAvoidance)
    13271327{
    1328     if (isRoot()) {
     1328    if (isDocumentElementRenderer()) {
    13291329        paintRootBoxFillLayers(paintInfo);
    13301330        return;
     
    14641464        return false;
    14651465    // Table and root background painting is special.
    1466     if (isTable() || isRoot())
     1466    if (isTable() || isDocumentElementRenderer())
    14671467        return false;
    14681468
     
    16711671        if (curLayer->image() && image == curLayer->image()->data() && curLayer->image()->canRender(this, style().effectiveZoom())) {
    16721672            // Now that we know this image is being used, compute the renderer and the rect if we haven't already.
    1673             bool drawingRootBackground = drawingBackground && (isRoot() || (isBody() && !document().documentElement()->renderer()->hasBackground()));
     1673            bool drawingRootBackground = drawingBackground && (isDocumentElementRenderer() || (isBody() && !document().documentElement()->renderer()->hasBackground()));
    16741674            if (!layerRenderer) {
    16751675                if (drawingRootBackground) {
     
    28022802    // height has nothing to be a percentage of, and it ends up being 0. That is bad.
    28032803    bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercentOrCalculated()
    2804         && (isRoot() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercentOrCalculated())) && !isInline();
     2804        && (isDocumentElementRenderer() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercentOrCalculated())) && !isInline();
    28052805    if (stretchesToViewport() || paginatedContentNeedsBaseHeight) {
    28062806        LayoutUnit margins = collapsedMarginBefore() + collapsedMarginAfter();
    28072807        LayoutUnit visibleHeight = view().pageOrViewLogicalHeight();
    2808         if (isRoot())
     2808        if (isDocumentElementRenderer())
    28092809            computedValues.m_extent = std::max(computedValues.m_extent, visibleHeight - margins);
    28102810        else {
     
    28802880    bool isHorizontal = isHorizontalWritingMode();
    28812881    while (!cb->isRenderView() && skipContainingBlockForPercentHeightCalculation(cb, isHorizontal != cb->isHorizontalWritingMode())) {
    2882         if (cb->isBody() || cb->isRoot())
     2882        if (cb->isBody() || cb->isDocumentElementRenderer())
    28832883            rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfter() + cb->borderAndPaddingLogicalHeight();
    28842884        skippedAutoHeightContainingBlock = true;
     
    43824382{
    43834383    return (isInlineBlockOrInlineTable() && !isAnonymousInlineBlock()) || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
    4384         || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isRoot() || isRenderFlowThread() || isRenderRegion()
     4384        || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElementRenderer() || isRenderFlowThread() || isRenderRegion()
    43854385#if ENABLE(CSS_GRID_LAYOUT)
    43864386        || isGridItem()
     
    46094609    if (cb->isRenderView() || inQuirksMode || isOutOfFlowPositionedWithSpecifiedHeight)
    46104610        return true;
    4611     if (cb->isRoot() && isOutOfFlowPositioned) {
     4611    if (cb->isDocumentElementRenderer() && isOutOfFlowPositioned) {
    46124612        // Match the positioned objects behavior, which is that positioned objects will fill their viewport
    46134613        // always.  Note we could only hit this case by recurring into computePercentageLogicalHeight on a positioned containing block.
  • trunk/Source/WebCore/rendering/RenderBox.h

    r190685 r190834  
    5454    virtual bool requiresLayer() const override
    5555    {
    56         return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip()
     56        return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip()
    5757            || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection() || style().specifiesColumns()
    5858            || !style().hasAutoZIndex();
     
    408408    bool stretchesToViewport() const
    409409    {
    410         return document().inQuirksMode() && style().logicalHeight().isAuto() && !isFloatingOrOutOfFlowPositioned() && (isRoot() || isBody()) && !isInline();
     410        return document().inQuirksMode() && style().logicalHeight().isAuto() && !isFloatingOrOutOfFlowPositioned() && (isDocumentElementRenderer() || isBody()) && !isInline();
    411411    }
    412412
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r189144 r190834  
    629629    bool clippedWithLocalScrolling = hasOverflowClip() && bgLayer->attachment() == LocalBackgroundAttachment;
    630630    bool isBorderFill = bgLayer->clip() == BorderFillBox;
    631     bool isRoot = this->isRoot();
     631    bool isRoot = this->isDocumentElementRenderer();
    632632
    633633    Color bgColor = color;
     
    10291029bool RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates() const
    10301030{
    1031     if (!isRoot())
     1031    if (!isDocumentElementRenderer())
    10321032        return false;
    10331033
     
    10851085        // its margins. Since those were added in already, we have to factor them out when computing
    10861086        // the background positioning area.
    1087         if (isRoot()) {
     1087        if (isDocumentElementRenderer()) {
    10881088            positioningAreaSize = downcast<RenderBox>(*this).size() - LayoutSize(left + right, top + bottom);
    10891089            positioningAreaSize = LayoutSize(snapSizeToDevicePixel(positioningAreaSize, LayoutPoint(), deviceScaleFactor));
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.h

    r189144 r190834  
    128128    virtual void updateFromStyle() override;
    129129
    130     virtual bool requiresLayer() const override { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection(); }
     130    virtual bool requiresLayer() const override { return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasClipPath() || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection(); }
    131131
    132132    // This will work on inlines to return the bounding box of all of the lines' border boxes.
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r184339 r190834  
    322322        relayoutChildren = true;
    323323
    324     layoutPositionedObjects(relayoutChildren || isRoot());
     324    layoutPositionedObjects(relayoutChildren || isDocumentElementRenderer());
    325325
    326326    computeOverflow(oldClientAfterEdge);
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r190169 r190834  
    896896        bool newStyleSlowScroll = repaintFixedBackgroundsOnScroll && newStyleUsesFixedBackgrounds;
    897897        bool oldStyleSlowScroll = oldStyle && repaintFixedBackgroundsOnScroll && oldStyleUsesFixedBackgrounds;
    898         bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document().documentElement()->renderer()));
     898        bool drawsRootBackground = isDocumentElementRenderer() || (isBody() && !rendererHasBackground(document().documentElement()->renderer()));
    899899        if (drawsRootBackground && repaintFixedBackgroundsOnScroll) {
    900900            if (view().compositor().supportsFixedRootBackgroundCompositing()) {
     
    916916    }
    917917
    918     if (isRoot() || isBody())
     918    if (isDocumentElementRenderer() || isBody())
    919919        view().frameView().updateExtendBackgroundIfNecessary();
    920920
     
    11561156RenderElement& RenderElement::rendererForRootBackground()
    11571157{
    1158     ASSERT(isRoot());
     1158    ASSERT(isDocumentElementRenderer());
    11591159    if (!hasBackground() && is<HTMLHtmlElement>(element())) {
    11601160        // Locate the <body> element using the DOM. This is easier than trying
     
    14421442    // be propagated to the root. At this point, we unfortunately don't have access to the image anymore so we
    14431443    // can no longer check if it is a background image.
    1444     bool backgroundIsPaintedByRoot = renderer.isRoot();
     1444    bool backgroundIsPaintedByRoot = renderer.isDocumentElementRenderer();
    14451445    if (renderer.isBody()) {
    14461446        auto& rootRenderer = *renderer.parent(); // If <body> has a renderer then <html> does too.
    1447         ASSERT(rootRenderer.isRoot());
     1447        ASSERT(rootRenderer.isDocumentElementRenderer());
    14481448        ASSERT(is<HTMLHtmlElement>(rootRenderer.element()));
    14491449        // FIXME: Should share body background propagation code.
  • trunk/Source/WebCore/rendering/RenderElement.h

    r190169 r190834  
    135135    void layoutIfNeeded() { if (needsLayout()) layout(); }
    136136
    137     // 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.
     137    // 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.
    138138    RenderElement& rendererForRootBackground();
    139139
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r190484 r190834  
    280280        relayoutChildren = true;
    281281
    282     layoutPositionedObjects(relayoutChildren || isRoot());
     282    layoutPositionedObjects(relayoutChildren || isDocumentElementRenderer());
    283283
    284284    repaintChildrenDuringLayoutIfMoved(oldChildRects);
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r190784 r190834  
    321321        relayoutChildren = true;
    322322
    323     layoutPositionedObjects(relayoutChildren || isRoot());
     323    layoutPositionedObjects(relayoutChildren || isDocumentElementRenderer());
    324324
    325325    computeOverflow(oldClientAfterEdge);
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r190820 r190834  
    38653865    // It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document
    38663866    // will do a full repaint().
    3867     if (layer->renderer().document().didLayoutWithPendingStylesheets() && !layer->isRootLayer() && !layer->renderer().isRoot())
     3867    if (layer->renderer().document().didLayoutWithPendingStylesheets() && !layer->isRootLayer() && !layer->renderer().isDocumentElementRenderer())
    38683868        return true;
    38693869
     
    38783878static inline bool paintForFixedRootBackground(const RenderLayer* layer, RenderLayer::PaintLayerFlags paintFlags)
    38793879{
    3880     return layer->renderer().isRoot() && (paintFlags & RenderLayer::PaintLayerPaintingRootBackgroundOnly);
     3880    return layer->renderer().isDocumentElementRenderer() && (paintFlags & RenderLayer::PaintLayerPaintingRootBackgroundOnly);
    38813881}
    38823882
     
    42354235    bool shouldPaintContent = m_hasVisibleContent && isSelfPaintingLayer && !isPaintingOverlayScrollbars;
    42364236
    4237     if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly && !renderer().isRenderView() && !renderer().isRoot())
     4237    if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly && !renderer().isRenderView() && !renderer().isDocumentElementRenderer())
    42384238        return;
    42394239
     
    57605760{
    57615761    // Always examine the canvas and the root.
    5762     // FIXME: Could eliminate the isRoot() check if we fix background painting so that the RenderView
     5762    // FIXME: Could eliminate the isDocumentElementRenderer() check if we fix background painting so that the RenderView
    57635763    // paints the root's background.
    5764     if (isRootLayer() || renderer().isRoot())
     5764    if (isRootLayer() || renderer().isDocumentElementRenderer())
    57655765        return true;
    57665766
     
    59335933    }
    59345934
    5935     if (renderer().isRoot()) {
     5935    if (renderer().isDocumentElementRenderer()) {
    59365936        // If the root layer becomes composited (e.g. because some descendant with negative z-index is composited),
    59375937        // then it has to be big enough to cover the viewport in order to display the background. This is akin
     
    61286128        return false;
    61296129
    6130     if (renderer().isRoot()) {
     6130    if (renderer().isDocumentElementRenderer()) {
    61316131        // Normally the document element doens't have a layer.  If it does have a layer, its background propagates to the RenderView
    61326132        // so this layer doesn't draw it.
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r190658 r190834  
    617617    bool paintsWithTransparency(PaintBehavior paintBehavior) const
    618618    {
    619         return (isTransparent() || hasBlendMode() || (isolatesBlending() && !renderer().isRoot())) && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited());
     619        return (isTransparent() || hasBlendMode() || (isolatesBlending() && !renderer().isDocumentElementRenderer())) && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited());
    620620    }
    621621
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r189144 r190834  
    17041704Color RenderLayerBacking::rendererBackgroundColor() const
    17051705{
    1706     const auto& backgroundRenderer = renderer().isRoot() ? renderer().rendererForRootBackground() : renderer();
     1706    const auto& backgroundRenderer = renderer().isDocumentElementRenderer() ? renderer().rendererForRootBackground() : renderer();
    17071707    return backgroundRenderer.style().visitedDependentColor(CSSPropertyBackgroundColor);
    17081708}
     
    18611861        return false;
    18621862
    1863     if (renderer().isRoot() && m_owningLayer.isolatesCompositedBlending())
     1863    if (renderer().isDocumentElementRenderer() && m_owningLayer.isolatesCompositedBlending())
    18641864        return false;
    18651865
  • trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp

    r190658 r190834  
    191191            renderLayer->updateSnapOffsets();
    192192            renderLayer->updateScrollSnapState();
    193         } else if (isBody() || isRoot()) {
     193        } else if (isBody() || isDocumentElementRenderer()) {
    194194            FrameView& frameView = view().frameView();
    195195            frameView.updateSnapOffsets();
     
    205205                scrollSnapBox->layer()->updateSnapOffsets();
    206206                scrollSnapBox->layer()->updateScrollSnapState();
    207                 if (scrollSnapBox->isBody() || scrollSnapBox->isRoot())
     207                if (scrollSnapBox->isBody() || scrollSnapBox->isDocumentElementRenderer())
    208208                    scrollSnapBox->view().frameView().updateScrollingCoordinatorScrollSnapProperties();
    209209            }
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r190734 r190834  
    967967    // If this is the root background, we need to check if there is an extended background rect. If
    968968    // there is, then we should not allow painting to clip to the layer size.
    969     if (isRoot() || isBody()) {
     969    if (isDocumentElementRenderer() || isBody()) {
    970970        shouldClipToLayer = !view.frameView().hasExtendedBackgroundRectForPainting();
    971971        repaintRect = snappedIntRect(view.backgroundRect());
     
    19161916    // A is the HTML body element.
    19171917    // The computed value of the position property for element A is fixed.
    1918     if (isRoot() || isBody() || (isOutOfFlowPositioned() && style().position() == FixedPosition))
     1918    if (isDocumentElementRenderer() || isBody() || (isOutOfFlowPositioned() && style().position() == FixedPosition))
    19191919        return nullptr;
    19201920
  • trunk/Source/WebCore/rendering/RenderObject.h

    r190685 r190834  
    346346    virtual bool isRenderScrollbarPart() const { return false; }
    347347
    348     bool isRoot() const { return document().documentElement() == &m_node; }
     348    bool isDocumentElementRenderer() const { return document().documentElement() == &m_node; }
    349349    bool isBody() const { return node() && node()->hasTagName(HTMLNames::bodyTag); }
    350350    bool isHR() const { return node() && node()->hasTagName(HTMLNames::hrTag); }
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r189144 r190834  
    659659    PaintPhase paintPhase = paintInfo.phase;
    660660
    661     if (!isRoot()) {
     661    if (!isDocumentElementRenderer()) {
    662662        LayoutRect overflowBox = visualOverflowRect();
    663663        adjustRectWithMaximumOutline(paintInfo.phase, overflowBox);
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp

    r190816 r190834  
    203203
    204204    updateLayerTransform();
    205     m_hasBoxDecorations = isRoot() ? hasBoxDecorationStyle() : hasBoxDecorations();
     205    m_hasBoxDecorations = isDocumentElementRenderer() ? hasBoxDecorationStyle() : hasBoxDecorations();
    206206    invalidateBackgroundObscurationStatus();
    207207
     
    219219        || style().overflowX() == OAUTO
    220220        || style().overflowX() == OSCROLL
    221         || this->isRoot();
     221        || this->isDocumentElementRenderer();
    222222}
    223223
  • trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp

    r190685 r190834  
    300300{
    301301    // RenderSVGRoot should never query for overflow state - it should always clip itself to the initial viewport size.
    302     ASSERT(!renderer.isRoot());
     302    ASSERT(!renderer.isDocumentElementRenderer());
    303303
    304304    return renderer.style().overflowX() == OHIDDEN || renderer.style().overflowX() == OSCROLL;
Note: See TracChangeset for help on using the changeset viewer.