| Index: Source/core/rendering/RenderBox.cpp
|
| diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
|
| index 608e44d391a48c36d36f7f45c76b26620cd684c5..65925c4b792de2322e3e045055422c255c9b07f0 100644
|
| --- a/Source/core/rendering/RenderBox.cpp
|
| +++ b/Source/core/rendering/RenderBox.cpp
|
| @@ -91,7 +91,7 @@ static bool skipBodyBackground(const RenderBox* bodyElementRenderer)
|
| ASSERT(bodyElementRenderer->isBody());
|
| // The <body> only paints its background if the root element has defined a background independent of the body,
|
| // or if the <body>'s parent is not the document element's renderer (e.g. inside SVG foreignObject).
|
| - RenderObject* documentElementRenderer = bodyElementRenderer->document().documentElement()->renderer();
|
| + LayoutObject* documentElementRenderer = bodyElementRenderer->document().documentElement()->renderer();
|
| return documentElementRenderer
|
| && !documentElementRenderer->hasBackground()
|
| && (documentElementRenderer == bodyElementRenderer->parent());
|
| @@ -152,7 +152,7 @@ void RenderBox::removeFloatingOrPositionedChildFromBlockLists()
|
|
|
| if (isFloating()) {
|
| RenderBlockFlow* parentBlockFlow = 0;
|
| - for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) {
|
| + for (LayoutObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) {
|
| if (curr->isRenderBlockFlow()) {
|
| RenderBlockFlow* currBlockFlow = toRenderBlockFlow(curr);
|
| if (!parentBlockFlow || currBlockFlow->containsFloat(this))
|
| @@ -236,7 +236,7 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
|
|
|
| // Our opaqueness might have changed without triggering layout.
|
| if (diff.needsPaintInvalidation()) {
|
| - RenderObject* parentToInvalidate = parent();
|
| + LayoutObject* parentToInvalidate = parent();
|
| for (unsigned i = 0; i < backgroundObscurationTestMaxDepth && parentToInvalidate; ++i) {
|
| parentToInvalidate->invalidateBackgroundObscurationStatus();
|
| parentToInvalidate = parentToInvalidate->parent();
|
| @@ -321,7 +321,7 @@ void RenderBox::updateFromStyle()
|
| if (boxHasOverflowClip != hasOverflowClip()) {
|
| // FIXME: This shouldn't be required if we tracked the visual overflow
|
| // generated by positioned children or self painting layers. crbug.com/345403
|
| - for (RenderObject* child = slowFirstChild(); child; child = child->nextSibling())
|
| + for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibling())
|
| child->setMayNeedPaintInvalidation();
|
| }
|
|
|
| @@ -335,7 +335,7 @@ void RenderBox::layout()
|
| {
|
| ASSERT(needsLayout());
|
|
|
| - RenderObject* child = slowFirstChild();
|
| + LayoutObject* child = slowFirstChild();
|
| if (!child) {
|
| clearNeedsLayout();
|
| return;
|
| @@ -810,7 +810,7 @@ IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con
|
| return windowAutoscrollPoint - windowPoint;
|
| }
|
|
|
| -RenderBox* RenderBox::findAutoscrollable(RenderObject* renderer)
|
| +RenderBox* RenderBox::findAutoscrollable(LayoutObject* renderer)
|
| {
|
| while (renderer && !(renderer->isBox() && toRenderBox(renderer)->canAutoscroll())) {
|
| if (!renderer->parent() && renderer->node() == renderer->document() && renderer->document().ownerElement())
|
| @@ -1135,7 +1135,7 @@ bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
|
| LayoutPoint adjustedLocation = accumulatedOffset + location();
|
|
|
| // Check kids first.
|
| - for (RenderObject* child = slowLastChild(); child; child = child->previousSibling()) {
|
| + for (LayoutObject* child = slowLastChild(); child; child = child->previousSibling()) {
|
| if ((!child->hasLayer() || !toLayoutLayerModelObject(child)->layer()->isSelfPaintingLayer()) && child->nodeAtPoint(request, result, locationInContainer, adjustedLocation, action)) {
|
| updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation));
|
| return true;
|
| @@ -1259,7 +1259,7 @@ bool RenderBox::foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, u
|
| {
|
| if (!maxDepthToTest)
|
| return false;
|
| - for (RenderObject* child = slowFirstChild(); child; child = child->nextSibling()) {
|
| + for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibling()) {
|
| if (!child->isBox())
|
| continue;
|
| RenderBox* childBox = toRenderBox(child);
|
| @@ -1365,7 +1365,7 @@ void RenderBox::imageChanged(WrappedImagePtr image, const IntRect*)
|
|
|
| bool RenderBox::paintInvalidationLayerRectsForImage(WrappedImagePtr image, const FillLayer& layers, bool drawingBackground)
|
| {
|
| - Vector<RenderObject*> layerRenderers;
|
| + Vector<LayoutObject*> layerRenderers;
|
|
|
| // A background of the body or document must extend to the total visible size of the document. This means the union of the
|
| // view and document bounds, since it can be the case that the view is larger than the document and vice-versa.
|
| @@ -1380,7 +1380,7 @@ bool RenderBox::paintInvalidationLayerRectsForImage(WrappedImagePtr image, const
|
| }
|
| for (const FillLayer* curLayer = &layers; curLayer; curLayer = curLayer->next()) {
|
| if (curLayer->image() && image == curLayer->image()->data() && curLayer->image()->canRender(*this, style()->effectiveZoom())) {
|
| - for (RenderObject* layerRenderer : layerRenderers)
|
| + for (LayoutObject* layerRenderer : layerRenderers)
|
| layerRenderer->setShouldDoFullPaintInvalidation();
|
| return true;
|
| }
|
| @@ -1575,7 +1575,7 @@ void RenderBox::mapLocalToContainer(const LayoutLayerModelObject* paintInvalidat
|
| }
|
|
|
| bool containerSkipped;
|
| - RenderObject* o = container(paintInvalidationContainer, &containerSkipped);
|
| + LayoutObject* o = container(paintInvalidationContainer, &containerSkipped);
|
| if (!o)
|
| return;
|
|
|
| @@ -1628,7 +1628,7 @@ void RenderBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState
|
| RenderBoxModelObject::mapAbsoluteToLocalPoint(mode, transformState);
|
| }
|
|
|
| -LayoutSize RenderBox::offsetFromContainer(const RenderObject* o, const LayoutPoint& point, bool* offsetDependsOnPoint) const
|
| +LayoutSize RenderBox::offsetFromContainer(const LayoutObject* o, const LayoutPoint& point, bool* offsetDependsOnPoint) const
|
| {
|
| ASSERT(o == container());
|
|
|
| @@ -1805,7 +1805,7 @@ void RenderBox::mapRectToPaintInvalidationBacking(const LayoutLayerModelObject*
|
| if (layer() && layer()->transform())
|
| rect = layer()->transform()->mapRect(pixelSnappedIntRect(rect));
|
|
|
| - // We can't trust the bits on RenderObject, because this might be called while re-resolving style.
|
| + // We can't trust the bits on LayoutObject, because this might be called while re-resolving style.
|
| if (styleToUse->hasInFlowPosition() && layer())
|
| rect.move(layer()->offsetForInFlowPosition());
|
|
|
| @@ -1823,7 +1823,7 @@ void RenderBox::mapRectToPaintInvalidationBacking(const LayoutLayerModelObject*
|
| }
|
|
|
| bool containerSkipped;
|
| - RenderObject* o = container(paintInvalidationContainer, &containerSkipped);
|
| + LayoutObject* o = container(paintInvalidationContainer, &containerSkipped);
|
| if (!o)
|
| return;
|
|
|
| @@ -1846,8 +1846,8 @@ void RenderBox::mapRectToPaintInvalidationBacking(const LayoutLayerModelObject*
|
| } else if (styleToUse->hasInFlowPosition() && layer()) {
|
| // Apply the relative position offset when invalidating a rectangle. The layer
|
| // is translated, but the render box isn't, so we need to do this to get the
|
| - // right dirty rect. Since this is called from RenderObject::setStyle, the relative position
|
| - // flag on the RenderObject has been cleared, so use the one on the style().
|
| + // right dirty rect. Since this is called from LayoutObject::setStyle, the relative position
|
| + // flag on the LayoutObject has been cleared, so use the one on the style().
|
| topLeft += layer()->offsetForInFlowPosition();
|
| }
|
|
|
| @@ -1918,12 +1918,12 @@ static float getMaxWidthListMarker(const RenderBox* renderer)
|
| ASSERT(renderer->style()->textAutosizingMultiplier() != 1);
|
| #endif
|
| float maxWidth = 0;
|
| - for (RenderObject* child = renderer->slowFirstChild(); child; child = child->nextSibling()) {
|
| + for (LayoutObject* child = renderer->slowFirstChild(); child; child = child->nextSibling()) {
|
| if (!child->isListItem())
|
| continue;
|
|
|
| RenderBox* listItem = toRenderBox(child);
|
| - for (RenderObject* itemChild = listItem->slowFirstChild(); itemChild; itemChild = itemChild->nextSibling()) {
|
| + for (LayoutObject* itemChild = listItem->slowFirstChild(); itemChild; itemChild = itemChild->nextSibling()) {
|
| if (!itemChild->isListMarker())
|
| continue;
|
| RenderBox* itemMarker = toRenderBox(itemChild);
|
| @@ -2084,9 +2084,9 @@ LayoutUnit RenderBox::computeLogicalWidthUsing(SizeType widthType, const Length&
|
| return logicalWidthResult;
|
| }
|
|
|
| -static bool columnFlexItemHasStretchAlignment(const RenderObject* flexitem)
|
| +static bool columnFlexItemHasStretchAlignment(const LayoutObject* flexitem)
|
| {
|
| - RenderObject* parent = flexitem->parent();
|
| + LayoutObject* parent = flexitem->parent();
|
| // auto margins mean we don't stretch. Note that this function will only be used for
|
| // widths, so we don't have to check marginBefore/marginAfter.
|
| ASSERT(parent->style()->isColumnFlexDirection());
|
| @@ -2095,9 +2095,9 @@ static bool columnFlexItemHasStretchAlignment(const RenderObject* flexitem)
|
| return flexitem->style()->alignSelf() == ItemPositionStretch || (flexitem->style()->alignSelf() == ItemPositionAuto && parent->style()->alignItems() == ItemPositionStretch);
|
| }
|
|
|
| -static bool isStretchingColumnFlexItem(const RenderObject* flexitem)
|
| +static bool isStretchingColumnFlexItem(const LayoutObject* flexitem)
|
| {
|
| - RenderObject* parent = flexitem->parent();
|
| + LayoutObject* parent = flexitem->parent();
|
| if (parent->isDeprecatedFlexibleBox() && parent->style()->boxOrient() == VERTICAL && parent->style()->boxAlign() == BSTRETCH)
|
| return true;
|
|
|
| @@ -2608,7 +2608,7 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(const Length& logicalHei
|
| case Percent:
|
| case Calculated:
|
| {
|
| - RenderObject* cb = isOutOfFlowPositioned() ? container() : containingBlock();
|
| + LayoutObject* cb = isOutOfFlowPositioned() ? container() : containingBlock();
|
| while (cb->isAnonymous())
|
| cb = cb->containingBlock();
|
| if (cb->isRenderBlock())
|
| @@ -2816,7 +2816,7 @@ static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRigh
|
| // FIXME: The static distance computation has not been patched for mixed writing modes yet.
|
| if (child->parent()->style()->direction() == LTR) {
|
| LayoutUnit staticPosition = child->layer()->staticInlinePosition() - containerBlock->borderLogicalLeft();
|
| - for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
|
| + for (LayoutObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
|
| if (curr->isBox()) {
|
| staticPosition += toRenderBox(curr)->logicalLeft();
|
| if (toRenderBox(curr)->isRelPositioned())
|
| @@ -2834,7 +2834,7 @@ static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRigh
|
| } else {
|
| RenderBox* enclosingBox = child->parent()->enclosingBox();
|
| LayoutUnit staticPosition = child->layer()->staticInlinePosition() + containerLogicalWidth + containerBlock->borderLogicalLeft();
|
| - for (RenderObject* curr = child->parent(); curr; curr = curr->container()) {
|
| + for (LayoutObject* curr = child->parent(); curr; curr = curr->container()) {
|
| if (curr->isBox()) {
|
| if (curr != containerBlock) {
|
| staticPosition -= toRenderBox(curr)->logicalLeft();
|
| @@ -3175,7 +3175,7 @@ static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBottom
|
|
|
| // FIXME: The static distance computation has not been patched for mixed writing modes.
|
| LayoutUnit staticLogicalTop = child->layer()->staticBlockPosition() - containerBlock->borderBefore();
|
| - for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
|
| + for (LayoutObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
|
| if (curr->isBox() && !curr->isTableRow())
|
| staticLogicalTop += toRenderBox(curr)->logicalTop();
|
| }
|
| @@ -3782,7 +3782,7 @@ LayoutRect RenderBox::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit
|
| PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point)
|
| {
|
| // no children...return this render object's element, if there is one, and offset 0
|
| - RenderObject* firstChild = slowFirstChild();
|
| + LayoutObject* firstChild = slowFirstChild();
|
| if (!firstChild)
|
| return createPositionWithAffinity(nonPseudoNode() ? firstPositionInOrBeforeNode(nonPseudoNode()) : Position());
|
|
|
| @@ -3804,15 +3804,15 @@ PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point)
|
| if (isTableRow())
|
| adjustedPoint.moveBy(location());
|
|
|
| - for (RenderObject* renderObject = firstChild; renderObject; renderObject = renderObject->nextSibling()) {
|
| - if ((!renderObject->slowFirstChild() && !renderObject->isInline() && !renderObject->isRenderBlockFlow() )
|
| - || renderObject->style()->visibility() != VISIBLE)
|
| + for (LayoutObject* layoutObject = firstChild; layoutObject; layoutObject = layoutObject->nextSibling()) {
|
| + if ((!layoutObject->slowFirstChild() && !layoutObject->isInline() && !layoutObject->isRenderBlockFlow() )
|
| + || layoutObject->style()->visibility() != VISIBLE)
|
| continue;
|
|
|
| - if (!renderObject->isBox())
|
| + if (!layoutObject->isBox())
|
| continue;
|
|
|
| - RenderBox* renderer = toRenderBox(renderObject);
|
| + RenderBox* renderer = toRenderBox(layoutObject);
|
|
|
| LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? LayoutUnit() : renderer->location().y());
|
| LayoutUnit bottom = top + renderer->contentHeight();
|
| @@ -3952,7 +3952,7 @@ PaintInvalidationReason RenderBox::paintInvalidationReason(const LayoutLayerMode
|
|
|
| void RenderBox::incrementallyInvalidatePaint(const LayoutLayerModelObject& paintInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const LayoutPoint& positionFromPaintInvalidationBacking)
|
| {
|
| - RenderObject::incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newBounds, positionFromPaintInvalidationBacking);
|
| + LayoutObject::incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newBounds, positionFromPaintInvalidationBacking);
|
|
|
| bool hasBoxDecorations = style()->hasBoxDecorations();
|
| if (!style()->hasBackground() && !hasBoxDecorations)
|
| @@ -3965,7 +3965,7 @@ void RenderBox::incrementallyInvalidatePaint(const LayoutLayerModelObject& paint
|
| if (oldBorderBoxSize == newBorderBoxSize)
|
| return;
|
|
|
| - // If size of the paint invalidation rect equals to size of border box, RenderObject::incrementallyInvalidatePaint()
|
| + // If size of the paint invalidation rect equals to size of border box, LayoutObject::incrementallyInvalidatePaint()
|
| // is good for boxes having background without box decorations.
|
| ASSERT(oldBounds.location() == newBounds.location()); // Otherwise we won't do incremental invalidation.
|
| if (!hasBoxDecorations
|
| @@ -4269,7 +4269,7 @@ int RenderBox::baselinePosition(FontBaseline baselineType, bool /*firstLine*/, L
|
|
|
| Layer* RenderBox::enclosingFloatPaintingLayer() const
|
| {
|
| - const RenderObject* curr = this;
|
| + const LayoutObject* curr = this;
|
| while (curr) {
|
| Layer* layer = curr->hasLayer() && curr->isBox() ? toRenderBox(curr)->layer() : 0;
|
| if (layer && layer->isSelfPaintingLayer())
|
| @@ -4449,7 +4449,7 @@ static void markBoxForRelayoutAfterSplit(RenderBox* box)
|
| box->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
|
| }
|
|
|
| -RenderObject* RenderBox::splitAnonymousBoxesAroundChild(RenderObject* beforeChild)
|
| +LayoutObject* RenderBox::splitAnonymousBoxesAroundChild(LayoutObject* beforeChild)
|
| {
|
| bool didSplitParentAnonymousBoxes = false;
|
|
|
|
|