| Index: Source/core/rendering/RenderBlock.cpp
|
| diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
|
| index 2809b179c301c998a10a2eaa7a667bdde2eaf116..c687c9de68d37677d6cd3c18d66d592664debb24 100644
|
| --- a/Source/core/rendering/RenderBlock.cpp
|
| +++ b/Source/core/rendering/RenderBlock.cpp
|
| @@ -41,6 +41,7 @@
|
| #include "core/layout/HitTestLocation.h"
|
| #include "core/layout/HitTestResult.h"
|
| #include "core/layout/Layer.h"
|
| +#include "core/layout/LayoutObject.h"
|
| #include "core/layout/LayoutTableCell.h"
|
| #include "core/layout/LayoutTheme.h"
|
| #include "core/layout/line/InlineIterator.h"
|
| @@ -57,7 +58,6 @@
|
| #include "core/rendering/RenderFlowThread.h"
|
| #include "core/rendering/RenderGrid.h"
|
| #include "core/rendering/RenderInline.h"
|
| -#include "core/rendering/RenderObjectInlines.h"
|
| #include "core/rendering/RenderRegion.h"
|
| #include "core/rendering/RenderTextControl.h"
|
| #include "core/rendering/RenderTextFragment.h"
|
| @@ -78,7 +78,7 @@ namespace blink {
|
| using namespace HTMLNames;
|
|
|
| struct SameSizeAsRenderBlock : public RenderBox {
|
| - RenderObjectChildList children;
|
| + LayoutObjectChildList children;
|
| RenderLineBoxList lineBoxes;
|
| int pageLogicalOffset;
|
| uint32_t bitfields;
|
| @@ -291,7 +291,7 @@ void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newSt
|
| } else if (!oldStyleIsContainer && newStyleIsContainer) {
|
| // Remove our absolutely positioned descendants from their current containing block.
|
| // They will be inserted into our positioned objects list during layout.
|
| - RenderObject* cb = parent();
|
| + LayoutObject* cb = parent();
|
| while (cb && (cb->style()->position() == StaticPosition || (cb->isInline() && !cb->isReplaced())) && !cb->isRenderView()) {
|
| if (cb->style()->position() == RelativePosition && cb->isInline() && !cb->isReplaced()) {
|
| cb = cb->containingBlock();
|
| @@ -355,9 +355,9 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
|
| Vector<ImageResource*> images;
|
| appendImagesFromStyle(images, *newStyle);
|
| if (images.isEmpty())
|
| - ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRenderObject(this);
|
| + ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeLayoutObject(this);
|
| else
|
| - ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRenderObject(this);
|
| + ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addLayoutObject(this);
|
| }
|
|
|
| void RenderBlock::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState)
|
| @@ -388,7 +388,7 @@ void RenderBlock::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState
|
| // a relatively positioned inline element, we need to account for
|
| // the inline elements position in PaintInvalidationState.
|
| if (box->style()->position() == AbsolutePosition) {
|
| - RenderObject* container = box->container(&paintInvalidationContainerForChild, 0);
|
| + LayoutObject* container = box->container(&paintInvalidationContainerForChild, 0);
|
| if (container->isRelPositioned() && container->isRenderInline()) {
|
| // FIXME: We should be able to use PaintInvalidationState for this.
|
| // Currently, we will place absolutely positioned elements inside
|
| @@ -405,7 +405,7 @@ void RenderBlock::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState
|
| }
|
| }
|
|
|
| -RenderBlock* RenderBlock::continuationBefore(RenderObject* beforeChild)
|
| +RenderBlock* RenderBlock::continuationBefore(LayoutObject* beforeChild)
|
| {
|
| if (beforeChild && beforeChild->parent() == this)
|
| return this;
|
| @@ -430,7 +430,7 @@ RenderBlock* RenderBlock::continuationBefore(RenderObject* beforeChild)
|
| return last;
|
| }
|
|
|
| -void RenderBlock::addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild)
|
| +void RenderBlock::addChildToContinuation(LayoutObject* newChild, LayoutObject* beforeChild)
|
| {
|
| RenderBlock* flow = continuationBefore(beforeChild);
|
| RenderBoxModelObject* beforeChildParent = 0;
|
| @@ -489,14 +489,14 @@ void RenderBlock::addChildToContinuation(RenderObject* newChild, RenderObject* b
|
| }
|
|
|
|
|
| -void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild)
|
| +void RenderBlock::addChildToAnonymousColumnBlocks(LayoutObject* newChild, LayoutObject* beforeChild)
|
| {
|
| ASSERT(!continuation()); // We don't yet support column spans that aren't immediate children of the multi-column block.
|
|
|
| // The goal is to locate a suitable box in which to place our child.
|
| RenderBlock* beforeChildParent = 0;
|
| if (beforeChild) {
|
| - RenderObject* curr = beforeChild;
|
| + LayoutObject* curr = beforeChild;
|
| while (curr && curr->parent() != this)
|
| curr = curr->parent();
|
| beforeChildParent = toRenderBlock(curr);
|
| @@ -528,7 +528,7 @@ void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, Render
|
| return;
|
| }
|
|
|
| - RenderObject* immediateChild = beforeChild;
|
| + LayoutObject* immediateChild = beforeChild;
|
| bool isPreviousBlockViable = true;
|
| while (immediateChild->parent() != this) {
|
| if (isPreviousBlockViable)
|
| @@ -541,7 +541,7 @@ void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, Render
|
| }
|
|
|
| // Split our anonymous blocks.
|
| - RenderObject* newBeforeChild = splitAnonymousBoxesAroundChild(beforeChild);
|
| + LayoutObject* newBeforeChild = splitAnonymousBoxesAroundChild(beforeChild);
|
|
|
|
|
| // Create a new anonymous box of the appropriate type.
|
| @@ -554,7 +554,7 @@ void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, Render
|
| RenderBlockFlow* RenderBlock::containingColumnsBlock(bool allowAnonymousColumnBlock)
|
| {
|
| RenderBlock* firstChildIgnoringAnonymousWrappers = 0;
|
| - for (RenderObject* curr = this; curr; curr = curr->parent()) {
|
| + for (LayoutObject* curr = this; curr; curr = curr->parent()) {
|
| if (!curr->isRenderBlock() || curr->isFloatingOrOutOfFlowPositioned() || curr->isTableCell() || curr->isDocumentElement() || curr->isRenderView() || curr->hasOverflowClip()
|
| || curr->isInlineBlockOrInlineTable())
|
| return 0;
|
| @@ -586,7 +586,7 @@ RenderBlock* RenderBlock::clone() const
|
| cloneBlock->setChildrenInline(childrenInline());
|
| }
|
| else {
|
| - RenderObject* cloneRenderer = toElement(node())->createRenderer(styleRef());
|
| + LayoutObject* cloneRenderer = toElement(node())->createRenderer(styleRef());
|
| cloneBlock = toRenderBlock(cloneRenderer);
|
| cloneBlock->setStyle(style());
|
|
|
| @@ -600,8 +600,8 @@ RenderBlock* RenderBlock::clone() const
|
| }
|
|
|
| void RenderBlock::splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock,
|
| - RenderBlock* middleBlock,
|
| - RenderObject* beforeChild, RenderBoxModelObject* oldCont)
|
| + RenderBlock* middleBlock,
|
| + LayoutObject* beforeChild, RenderBoxModelObject* oldCont)
|
| {
|
| ASSERT(isDescendantOf(fromBlock));
|
|
|
| @@ -609,7 +609,7 @@ void RenderBlock::splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock,
|
| beforeChild = lastChild();
|
|
|
| Vector<RenderBlock*> blocksToClone;
|
| - for (RenderObject* o = this; o != fromBlock; o = o->parent())
|
| + for (LayoutObject* o = this; o != fromBlock; o = o->parent())
|
| blocksToClone.append(toRenderBlock(o));
|
|
|
| // Create a new clone of the top-most block.
|
| @@ -668,8 +668,8 @@ void RenderBlock::splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock,
|
| moveChildrenTo(cloneBlock, beforeChild, nullptr, true);
|
| }
|
|
|
| -void RenderBlock::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
|
| - RenderObject* newChild, RenderBoxModelObject* oldCont)
|
| +void RenderBlock::splitFlow(LayoutObject* beforeChild, RenderBlock* newBlockBox,
|
| + LayoutObject* newChild, RenderBoxModelObject* oldCont)
|
| {
|
| RenderBlock* pre = 0;
|
| RenderBlock* block = containingColumnsBlock();
|
| @@ -695,7 +695,7 @@ void RenderBlock::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
|
| RenderBlock* post = block->createAnonymousColumnsBlock();
|
| post->setChildrenInline(false);
|
|
|
| - RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
|
| + LayoutObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
|
| if (madeNewBeforeBlock)
|
| block->children()->insertChildNode(block, pre, boxFirst);
|
| block->children()->insertChildNode(block, newBlockBox, boxFirst);
|
| @@ -721,7 +721,7 @@ void RenderBlock::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
|
| post->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
|
| }
|
|
|
| -void RenderBlock::makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlockFlow* newBlockBox, RenderObject* newChild)
|
| +void RenderBlock::makeChildrenAnonymousColumnBlocks(LayoutObject* beforeChild, RenderBlockFlow* newBlockBox, LayoutObject* newChild)
|
| {
|
| RenderBlockFlow* pre = 0;
|
| RenderBlockFlow* post = 0;
|
| @@ -744,7 +744,7 @@ void RenderBlock::makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, R
|
| post->setChildrenInline(block->childrenInline());
|
| }
|
|
|
| - RenderObject* boxFirst = block->firstChild();
|
| + LayoutObject* boxFirst = block->firstChild();
|
| if (pre)
|
| block->children()->insertChildNode(block, pre, boxFirst);
|
| block->children()->insertChildNode(block, newBlockBox, boxFirst);
|
| @@ -772,7 +772,7 @@ void RenderBlock::makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, R
|
| post->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
|
| }
|
|
|
| -RenderBlockFlow* RenderBlock::columnsBlockForSpanningElement(RenderObject* newChild)
|
| +RenderBlockFlow* RenderBlock::columnsBlockForSpanningElement(LayoutObject* newChild)
|
| {
|
| // FIXME: This function is the gateway for the addition of column-span support. It will
|
| // be added to in three stages:
|
| @@ -789,7 +789,7 @@ RenderBlockFlow* RenderBlock::columnsBlockForSpanningElement(RenderObject* newCh
|
| if (columnsBlockAncestor) {
|
| // Make sure that none of the parent ancestors have a continuation.
|
| // If yes, we do not want split the block into continuations.
|
| - RenderObject* curr = this;
|
| + LayoutObject* curr = this;
|
| while (curr && curr != columnsBlockAncestor) {
|
| if (curr->isRenderBlock() && toRenderBlock(curr)->continuation()) {
|
| columnsBlockAncestor = 0;
|
| @@ -802,10 +802,10 @@ RenderBlockFlow* RenderBlock::columnsBlockForSpanningElement(RenderObject* newCh
|
| return columnsBlockAncestor;
|
| }
|
|
|
| -void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild)
|
| +void RenderBlock::addChildIgnoringAnonymousColumnBlocks(LayoutObject* newChild, LayoutObject* beforeChild)
|
| {
|
| if (beforeChild && beforeChild->parent() != this) {
|
| - RenderObject* beforeChildContainer = beforeChild->parent();
|
| + LayoutObject* beforeChildContainer = beforeChild->parent();
|
| while (beforeChildContainer->parent() != this)
|
| beforeChildContainer = beforeChildContainer->parent();
|
| ASSERT(beforeChildContainer);
|
| @@ -813,7 +813,7 @@ void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild,
|
| if (beforeChildContainer->isAnonymous()) {
|
| // If the requested beforeChild is not one of our children, then this is because
|
| // there is an anonymous container within this object that contains the beforeChild.
|
| - RenderObject* beforeChildAnonymousContainer = beforeChildContainer;
|
| + LayoutObject* beforeChildAnonymousContainer = beforeChildContainer;
|
| if (beforeChildAnonymousContainer->isAnonymousBlock()
|
| // Full screen renderers and full screen placeholders act as anonymous blocks, not tables:
|
| || beforeChildAnonymousContainer->isRenderFullScreen()
|
| @@ -894,7 +894,7 @@ void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild,
|
| // If we're inserting an inline child but all of our children are blocks, then we have to make sure
|
| // it is put into an anomyous block box. We try to use an existing anonymous box if possible, otherwise
|
| // a new one is created and inserted into our list of children in the appropriate position.
|
| - RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : lastChild();
|
| + LayoutObject* afterChild = beforeChild ? beforeChild->previousSibling() : lastChild();
|
|
|
| if (afterChild && afterChild->isAnonymousBlock()) {
|
| afterChild->addChild(newChild);
|
| @@ -917,7 +917,7 @@ void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild,
|
| // this object may be dead here
|
| }
|
|
|
| -void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild)
|
| +void RenderBlock::addChild(LayoutObject* newChild, LayoutObject* beforeChild)
|
| {
|
| if (continuation() && !isAnonymousBlock())
|
| addChildToContinuation(newChild, beforeChild);
|
| @@ -925,7 +925,7 @@ void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild)
|
| addChildIgnoringContinuation(newChild, beforeChild);
|
| }
|
|
|
| -void RenderBlock::addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild)
|
| +void RenderBlock::addChildIgnoringContinuation(LayoutObject* newChild, LayoutObject* beforeChild)
|
| {
|
| if (!isAnonymousBlock() && firstChild() && (firstChild()->isAnonymousColumnsBlock() || firstChild()->isAnonymousColumnSpanBlock()))
|
| addChildToAnonymousColumnBlocks(newChild, beforeChild);
|
| @@ -933,9 +933,9 @@ void RenderBlock::addChildIgnoringContinuation(RenderObject* newChild, RenderObj
|
| addChildIgnoringAnonymousColumnBlocks(newChild, beforeChild);
|
| }
|
|
|
| -static void getInlineRun(RenderObject* start, RenderObject* boundary,
|
| - RenderObject*& inlineRunStart,
|
| - RenderObject*& inlineRunEnd)
|
| +static void getInlineRun(LayoutObject* start, LayoutObject* boundary,
|
| + LayoutObject*& inlineRunStart,
|
| + LayoutObject*& inlineRunEnd)
|
| {
|
| // Beginning at |start| we find the largest contiguous run of inlines that
|
| // we can. We denote the run with start and end points, |inlineRunStart|
|
| @@ -950,7 +950,7 @@ static void getInlineRun(RenderObject* start, RenderObject* boundary,
|
| // a non-inline.
|
|
|
| // Start by skipping as many non-inlines as we can.
|
| - RenderObject * curr = start;
|
| + LayoutObject * curr = start;
|
| bool sawInline;
|
| do {
|
| while (curr && !(curr->isInline() || curr->isFloatingOrOutOfFlowPositioned()))
|
| @@ -978,7 +978,7 @@ void RenderBlock::deleteLineBoxTree()
|
| ASSERT(!m_lineBoxes.firstLineBox());
|
| }
|
|
|
| -void RenderBlock::makeChildrenNonInline(RenderObject *insertionPoint)
|
| +void RenderBlock::makeChildrenNonInline(LayoutObject *insertionPoint)
|
| {
|
| // makeChildrenNonInline takes a block whose children are *all* inline and it
|
| // makes sure that inline children are coalesced under anonymous
|
| @@ -992,14 +992,15 @@ void RenderBlock::makeChildrenNonInline(RenderObject *insertionPoint)
|
|
|
| setChildrenInline(false);
|
|
|
| - RenderObject *child = firstChild();
|
| + LayoutObject* child = firstChild();
|
| if (!child)
|
| return;
|
|
|
| deleteLineBoxTree();
|
|
|
| while (child) {
|
| - RenderObject *inlineRunStart, *inlineRunEnd;
|
| + LayoutObject* inlineRunStart;
|
| + LayoutObject* inlineRunEnd;
|
| getInlineRun(child, insertionPoint, inlineRunStart, inlineRunEnd);
|
|
|
| if (!inlineRunStart)
|
| @@ -1013,7 +1014,7 @@ void RenderBlock::makeChildrenNonInline(RenderObject *insertionPoint)
|
| }
|
|
|
| #if ENABLE(ASSERT)
|
| - for (RenderObject *c = firstChild(); c; c = c->nextSibling())
|
| + for (LayoutObject *c = firstChild(); c; c = c->nextSibling())
|
| ASSERT(!c->isInline());
|
| #endif
|
|
|
| @@ -1028,10 +1029,10 @@ void RenderBlock::removeLeftoverAnonymousBlock(RenderBlock* child)
|
| if (child->continuation() || (child->firstChild() && (child->isAnonymousColumnSpanBlock() || child->isAnonymousColumnsBlock())))
|
| return;
|
|
|
| - RenderObject* firstAnChild = child->m_children.firstChild();
|
| - RenderObject* lastAnChild = child->m_children.lastChild();
|
| + LayoutObject* firstAnChild = child->m_children.firstChild();
|
| + LayoutObject* lastAnChild = child->m_children.lastChild();
|
| if (firstAnChild) {
|
| - RenderObject* o = firstAnChild;
|
| + LayoutObject* o = firstAnChild;
|
| while (o) {
|
| o->setParent(this);
|
| o = o->nextSibling();
|
| @@ -1076,7 +1077,7 @@ void RenderBlock::removeLeftoverAnonymousBlock(RenderBlock* child)
|
| child->destroy();
|
| }
|
|
|
| -static bool canMergeContiguousAnonymousBlocks(RenderObject* oldChild, RenderObject* prev, RenderObject* next)
|
| +static bool canMergeContiguousAnonymousBlocks(LayoutObject* oldChild, LayoutObject* prev, LayoutObject* next)
|
| {
|
| if (oldChild->documentBeingDestroyed() || oldChild->isInline() || oldChild->virtualContinuation())
|
| return false;
|
| @@ -1128,7 +1129,7 @@ void RenderBlock::collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock*
|
| return;
|
| parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
|
| parent->setChildrenInline(child->childrenInline());
|
| - RenderObject* nextSibling = child->nextSibling();
|
| + LayoutObject* nextSibling = child->nextSibling();
|
|
|
| parent->children()->removeChildNode(parent, child, child->hasLayer());
|
| // FIXME: Get rid of the temporary disabling of continuations. This is needed by the old
|
| @@ -1147,7 +1148,7 @@ void RenderBlock::collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock*
|
| child->destroy();
|
| }
|
|
|
| -void RenderBlock::removeChild(RenderObject* oldChild)
|
| +void RenderBlock::removeChild(LayoutObject* oldChild)
|
| {
|
| // No need to waste time in merging or removing empty anonymous blocks.
|
| // We can just bail out if our document is getting destroyed.
|
| @@ -1162,8 +1163,8 @@ void RenderBlock::removeChild(RenderObject* oldChild)
|
| // If this child is a block, and if our previous and next siblings are
|
| // both anonymous blocks with inline content, then we can go ahead and
|
| // fold the inline content back together.
|
| - RenderObject* prev = oldChild->previousSibling();
|
| - RenderObject* next = oldChild->nextSibling();
|
| + LayoutObject* prev = oldChild->previousSibling();
|
| + LayoutObject* next = oldChild->nextSibling();
|
| bool canMergeAnonymousBlocks = canMergeContiguousAnonymousBlocks(oldChild, prev, next);
|
| if (canMergeAnonymousBlocks && prev && next) {
|
| prev->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
|
| @@ -1210,7 +1211,7 @@ void RenderBlock::removeChild(RenderObject* oldChild)
|
|
|
| RenderBox::removeChild(oldChild);
|
|
|
| - RenderObject* child = prev ? prev : next;
|
| + LayoutObject* child = prev ? prev : next;
|
| if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child->nextSibling() && canCollapseAnonymousBlockChild()) {
|
| // The removal has knocked us down to containing only a single anonymous
|
| // box. We can go ahead and pull the content right back up into our
|
| @@ -1236,10 +1237,10 @@ void RenderBlock::removeChild(RenderObject* oldChild)
|
| // If we are an empty anonymous block in the continuation chain,
|
| // we need to remove ourself and fix the continuation chain.
|
| if (!beingDestroyed() && isAnonymousBlockContinuation() && !oldChild->isListMarker()) {
|
| - RenderObject* containingBlockIgnoringAnonymous = containingBlock();
|
| + LayoutObject* containingBlockIgnoringAnonymous = containingBlock();
|
| while (containingBlockIgnoringAnonymous && containingBlockIgnoringAnonymous->isAnonymous())
|
| containingBlockIgnoringAnonymous = containingBlockIgnoringAnonymous->containingBlock();
|
| - for (RenderObject* curr = this; curr; curr = curr->previousInPreOrder(containingBlockIgnoringAnonymous)) {
|
| + for (LayoutObject* curr = this; curr; curr = curr->previousInPreOrder(containingBlockIgnoringAnonymous)) {
|
| if (curr->virtualContinuation() != this)
|
| continue;
|
|
|
| @@ -1555,7 +1556,7 @@ void RenderBlock::simplifiedNormalFlowLayout()
|
| if (childrenInline()) {
|
| ListHashSet<RootInlineBox*> lineBoxes;
|
| for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) {
|
| - RenderObject* o = walker.current();
|
| + LayoutObject* o = walker.current();
|
| if (!o->isOutOfFlowPositioned() && (o->isReplaced() || o->isFloating())) {
|
| o->layoutIfNeeded();
|
| if (toRenderBox(o)->inlineBoxWrapper()) {
|
| @@ -1633,7 +1634,7 @@ bool RenderBlock::simplifiedLayout()
|
| return true;
|
| }
|
|
|
| -void RenderBlock::markFixedPositionObjectForLayoutIfNeeded(RenderObject* child, SubtreeLayoutScope& layoutScope)
|
| +void RenderBlock::markFixedPositionObjectForLayoutIfNeeded(LayoutObject* child, SubtreeLayoutScope& layoutScope)
|
| {
|
| if (child->style()->position() != FixedPosition)
|
| return;
|
| @@ -1643,7 +1644,7 @@ void RenderBlock::markFixedPositionObjectForLayoutIfNeeded(RenderObject* child,
|
| if (!hasStaticBlockPosition && !hasStaticInlinePosition)
|
| return;
|
|
|
| - RenderObject* o = child->parent();
|
| + LayoutObject* o = child->parent();
|
| while (o && !o->isRenderView() && o->style()->position() != AbsolutePosition)
|
| o = o->parent();
|
| if (o->style()->position() != AbsolutePosition)
|
| @@ -1889,8 +1890,8 @@ RenderBlock* RenderBlock::blockBeforeWithinSelectionRoot(LayoutSize& offset) con
|
| if (isSelectionRoot())
|
| return 0;
|
|
|
| - const RenderObject* object = this;
|
| - RenderObject* sibling;
|
| + const LayoutObject* object = this;
|
| + LayoutObject* sibling;
|
| do {
|
| sibling = object->previousSibling();
|
| while (sibling && (!sibling->isRenderBlock() || toRenderBlock(sibling)->isSelectionRoot()))
|
| @@ -1907,7 +1908,7 @@ RenderBlock* RenderBlock::blockBeforeWithinSelectionRoot(LayoutSize& offset) con
|
|
|
| offset += LayoutSize(beforeBlock->logicalLeft(), beforeBlock->logicalTop());
|
|
|
| - RenderObject* child = beforeBlock->lastChild();
|
| + LayoutObject* child = beforeBlock->lastChild();
|
| while (child && child->isRenderBlock()) {
|
| beforeBlock = toRenderBlock(child);
|
| offset += LayoutSize(beforeBlock->logicalLeft(), beforeBlock->logicalTop());
|
| @@ -2023,7 +2024,7 @@ void RenderBlock::removePositionedObjects(RenderBlock* o, ContainingBlockState c
|
|
|
| // It is parent blocks job to add positioned child to positioned objects list of its containing block
|
| // Parent layout needs to be invalidated to ensure this happens.
|
| - RenderObject* p = r->parent();
|
| + LayoutObject* p = r->parent();
|
| while (p && !p->isRenderBlock())
|
| p = p->parent();
|
| if (p)
|
| @@ -2107,7 +2108,7 @@ void RenderBlock::removePercentHeightDescendantIfNeeded(RenderBox* descendant)
|
| void RenderBlock::clearPercentHeightDescendantsFrom(RenderBox* parent)
|
| {
|
| ASSERT(gPercentHeightContainerMap);
|
| - for (RenderObject* curr = parent->slowFirstChild(); curr; curr = curr->nextInPreOrder(parent)) {
|
| + for (LayoutObject* curr = parent->slowFirstChild(); curr; curr = curr->nextInPreOrder(parent)) {
|
| if (!curr->isBox())
|
| continue;
|
|
|
| @@ -2389,7 +2390,7 @@ Position RenderBlock::positionForBox(InlineBox *box, bool start) const
|
| return createLegacyEditingPosition(box->renderer().nonPseudoNode(), start ? textBox->start() : textBox->start() + textBox->len());
|
| }
|
|
|
| -static inline bool isEditingBoundary(RenderObject* ancestor, RenderObject* child)
|
| +static inline bool isEditingBoundary(LayoutObject* ancestor, LayoutObject* child)
|
| {
|
| ASSERT(!ancestor || ancestor->nonPseudoNode());
|
| ASSERT(child && child->nonPseudoNode());
|
| @@ -2397,7 +2398,7 @@ static inline bool isEditingBoundary(RenderObject* ancestor, RenderObject* child
|
| || ancestor->nonPseudoNode()->hasEditableStyle() == child->nonPseudoNode()->hasEditableStyle();
|
| }
|
|
|
| -// FIXME: This function should go on RenderObject as an instance method. Then
|
| +// FIXME: This function should go on LayoutObject as an instance method. Then
|
| // all cases in which positionForPoint recurs could call this instead to
|
| // prevent crossing editable boundaries. This would require many tests.
|
| static PositionWithAffinity positionForPointRespectingEditingBoundaries(RenderBlock* parent, RenderBox* child, const LayoutPoint& pointInParentCoordinates)
|
| @@ -2416,7 +2417,7 @@ static PositionWithAffinity positionForPointRespectingEditingBoundaries(RenderBl
|
|
|
| // Otherwise, first make sure that the editability of the parent and child agree.
|
| // If they don't agree, then we return a visible position just before or after the child
|
| - RenderObject* ancestor = parent;
|
| + LayoutObject* ancestor = parent;
|
| while (ancestor && !ancestor->nonPseudoNode())
|
| ancestor = ancestor->parent();
|
|
|
| @@ -3039,7 +3040,7 @@ void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
|
| RenderStyle* styleToUse = style();
|
| bool nowrap = styleToUse->whiteSpace() == NOWRAP;
|
|
|
| - RenderObject* child = firstChild();
|
| + LayoutObject* child = firstChild();
|
| RenderBlock* containingBlock = this->containingBlock();
|
| LayoutUnit floatLeftWidth = 0, floatRightWidth = 0;
|
| while (child) {
|
| @@ -3297,7 +3298,7 @@ int RenderBlock::lastLineBoxBaseline(LineDirectionMode lineDirection) const
|
| return -1;
|
| }
|
|
|
| -static inline bool isRenderBlockFlowOrRenderButton(RenderObject* renderObject)
|
| +static inline bool isRenderBlockFlowOrRenderButton(LayoutObject* layoutObject)
|
| {
|
| // We include isRenderButton in this check because buttons are implemented
|
| // using flex box but should still support first-line|first-letter.
|
| @@ -3305,7 +3306,7 @@ static inline bool isRenderBlockFlowOrRenderButton(RenderObject* renderObject)
|
| // support first-line|first-letter, though.
|
| // FIXME: Remove when buttons are implemented with align-items instead
|
| // of flex box.
|
| - return renderObject->isRenderBlockFlow() || renderObject->isRenderButton();
|
| + return layoutObject->isRenderBlockFlow() || layoutObject->isRenderButton();
|
| }
|
|
|
| RenderBlock* RenderBlock::firstLineBlock() const
|
| @@ -3316,7 +3317,7 @@ RenderBlock* RenderBlock::firstLineBlock() const
|
| hasPseudo = firstLineBlock->style()->hasPseudoStyle(FIRST_LINE);
|
| if (hasPseudo)
|
| break;
|
| - RenderObject* parentBlock = firstLineBlock->parent();
|
| + LayoutObject* parentBlock = firstLineBlock->parent();
|
| if (firstLineBlock->isReplaced() || firstLineBlock->isFloatingOrOutOfFlowPositioned()
|
| || !parentBlock
|
| || !isRenderBlockFlowOrRenderButton(parentBlock))
|
| @@ -3335,7 +3336,7 @@ RenderBlock* RenderBlock::firstLineBlock() const
|
|
|
| // Helper methods for obtaining the last line, computing line counts and heights for line counts
|
| // (crawling into blocks).
|
| -static bool shouldCheckLines(RenderObject* obj)
|
| +static bool shouldCheckLines(LayoutObject* obj)
|
| {
|
| return !obj->isFloatingOrOutOfFlowPositioned()
|
| && obj->isRenderBlock() && obj->style()->height().isAuto()
|
| @@ -3381,7 +3382,7 @@ RootInlineBox* RenderBlock::lineAtIndex(int i) const
|
| if (!i--)
|
| return box;
|
| } else {
|
| - for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
|
| + for (LayoutObject* child = firstChild(); child; child = child->nextSibling()) {
|
| if (!shouldCheckLines(child))
|
| continue;
|
| if (RootInlineBox* box = toRenderBlock(child)->lineAtIndex(i))
|
| @@ -3407,7 +3408,7 @@ int RenderBlock::lineCount(const RootInlineBox* stopRootInlineBox, bool* found)
|
| }
|
| }
|
| else
|
| - for (RenderObject* obj = firstChild(); obj; obj = obj->nextSibling())
|
| + for (LayoutObject* obj = firstChild(); obj; obj = obj->nextSibling())
|
| if (shouldCheckLines(obj)) {
|
| bool recursiveFound = false;
|
| count += toRenderBlock(obj)->lineCount(stopRootInlineBox, &recursiveFound);
|
| @@ -3435,7 +3436,7 @@ void RenderBlock::clearTruncation()
|
| for (RootInlineBox* box = firstRootBox(); box; box = box->nextRootBox())
|
| box->clearTruncation();
|
| } else {
|
| - for (RenderObject* obj = firstChild(); obj; obj = obj->nextSibling()) {
|
| + for (LayoutObject* obj = firstChild(); obj; obj = obj->nextSibling()) {
|
| if (shouldCheckLines(obj))
|
| toRenderBlock(obj)->clearTruncation();
|
| }
|
| @@ -3485,7 +3486,7 @@ LayoutRect RenderBlock::rectWithOutlineForPaintInvalidation(const LayoutLayerMod
|
| return r;
|
| }
|
|
|
| -RenderObject* RenderBlock::hoverAncestor() const
|
| +LayoutObject* RenderBlock::hoverAncestor() const
|
| {
|
| return isAnonymousBlockContinuation() ? continuation() : RenderBox::hoverAncestor();
|
| }
|
| @@ -3497,7 +3498,7 @@ void RenderBlock::updateDragState(bool dragOn)
|
| continuation()->updateDragState(dragOn);
|
| }
|
|
|
| -void RenderBlock::childBecameNonInline(RenderObject*)
|
| +void RenderBlock::childBecameNonInline(LayoutObject*)
|
| {
|
| makeChildrenNonInline();
|
| if (isAnonymousBlock() && parent() && parent()->isRenderBlock())
|
| @@ -3594,7 +3595,7 @@ void RenderBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou
|
| }
|
| }
|
|
|
| -RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const
|
| +RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const LayoutObject* parent) const
|
| {
|
| if (isAnonymousColumnsBlock())
|
| return createAnonymousColumnsWithParentRenderer(parent);
|
| @@ -3763,7 +3764,7 @@ const char* RenderBlock::renderName() const
|
| return "RenderBlock";
|
| }
|
|
|
| -RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const RenderObject* parent, EDisplay display)
|
| +RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const LayoutObject* parent, EDisplay display)
|
| {
|
| // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ?
|
| EDisplay newDisplay;
|
| @@ -3782,7 +3783,7 @@ RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const Rend
|
| return newBox;
|
| }
|
|
|
| -RenderBlockFlow* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderObject* parent)
|
| +RenderBlockFlow* RenderBlock::createAnonymousColumnsWithParentRenderer(const LayoutObject* parent)
|
| {
|
| RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(parent->style(), BLOCK);
|
| newStyle->inheritColumnPropertiesFrom(parent->style());
|
| @@ -3793,7 +3794,7 @@ RenderBlockFlow* RenderBlock::createAnonymousColumnsWithParentRenderer(const Ren
|
| return newBox;
|
| }
|
|
|
| -RenderBlockFlow* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const RenderObject* parent)
|
| +RenderBlockFlow* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const LayoutObject* parent)
|
| {
|
| RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(parent->style(), BLOCK);
|
| newStyle->setColumnSpan(ColumnSpanAll);
|
| @@ -3804,7 +3805,7 @@ RenderBlockFlow* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const
|
| return newBox;
|
| }
|
|
|
| -static bool recalcNormalFlowChildOverflowIfNeeded(RenderObject* renderer)
|
| +static bool recalcNormalFlowChildOverflowIfNeeded(LayoutObject* renderer)
|
| {
|
| if (renderer->isOutOfFlowPositioned() || !renderer->needsOverflowRecalcAfterStyleChange())
|
| return false;
|
| @@ -3823,7 +3824,7 @@ bool RenderBlock::recalcChildOverflowAfterStyleChange()
|
| if (childrenInline()) {
|
| ListHashSet<RootInlineBox*> lineBoxes;
|
| for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) {
|
| - RenderObject* renderer = walker.current();
|
| + LayoutObject* renderer = walker.current();
|
| if (recalcNormalFlowChildOverflowIfNeeded(renderer)) {
|
| childrenOverflowChanged = true;
|
| if (InlineBox* inlineBoxWrapper = toRenderBlock(renderer)->inlineBoxWrapper())
|
| @@ -3941,9 +3942,9 @@ bool RenderBlock::paintsContinuationOutline(RenderInline* flow)
|
|
|
| #ifndef NDEBUG
|
|
|
| -void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* markedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const RenderObject* obj) const
|
| +void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* markedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const LayoutObject* obj) const
|
| {
|
| - showRenderObject();
|
| + showLayoutObject();
|
| for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRootBox())
|
| root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLabel2, obj, 1);
|
| }
|
|
|