Commit 56695510 authored by wangxianzhu's avatar wangxianzhu Committed by Commit bot

paintInvalidationContainerSkipped/containerSkipped => ancestorSkipped

These were overlooked in the previous CL which renamed
paintInvalidationContainer to ancestor in some places that the parameter
is not necessary a paintInvalidtionContainer.

Review URL: https://codereview.chromium.org/1841643004

Cr-Commit-Position: refs/heads/master@{#383920}
parent 65c03640
...@@ -1960,8 +1960,8 @@ bool LayoutBox::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ance ...@@ -1960,8 +1960,8 @@ bool LayoutBox::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ance
return true; return true;
} }
bool containerSkipped; bool ancestorSkipped;
LayoutObject* container = this->container(ancestor, &containerSkipped); LayoutObject* container = this->container(ancestor, &ancestorSkipped);
if (!container) if (!container)
return true; return true;
...@@ -1999,11 +1999,11 @@ bool LayoutBox::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ance ...@@ -1999,11 +1999,11 @@ bool LayoutBox::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ance
return false; return false;
} }
if (containerSkipped) { if (ancestorSkipped) {
// If the paintInvalidationContainer is below o, then we need to map the rect into paintInvalidationContainer's coordinates. // If the ancestor is below o, then we need to map the rect into paintInvalidationContainer's coordinates.
LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(container); LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(container);
rect.move(-containerOffset); rect.move(-containerOffset);
// If the paintInvalidationContainer is fixed, then the rect is already in its coordinates so doesn't need viewport-adjusting. // If the ancestor is fixed, then the rect is already in its coordinates so doesn't need viewport-adjusting.
if (ancestor->style()->position() != FixedPosition && container->isLayoutView() && position == FixedPosition) if (ancestor->style()->position() != FixedPosition && container->isLayoutView() && position == FixedPosition)
toLayoutView(container)->adjustOffsetForFixedPosition(rect); toLayoutView(container)->adjustOffsetForFixedPosition(rect);
return true; return true;
......
...@@ -881,7 +881,7 @@ inline void LayoutObject::invalidateContainerPreferredLogicalWidths() ...@@ -881,7 +881,7 @@ inline void LayoutObject::invalidateContainerPreferredLogicalWidths()
} }
} }
LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped) const
{ {
// We technically just want our containing block, but // We technically just want our containing block, but
// we may not have one if we're part of an uninstalled // we may not have one if we're part of an uninstalled
...@@ -890,25 +890,25 @@ LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObj ...@@ -890,25 +890,25 @@ LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObj
if (object->canContainAbsolutePositionObjects()) if (object->canContainAbsolutePositionObjects())
return object; return object;
if (paintInvalidationContainerSkipped && object == paintInvalidationContainer) if (ancestorSkipped && object == ancestor)
*paintInvalidationContainerSkipped = true; *ancestorSkipped = true;
} }
return nullptr; return nullptr;
} }
LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped) const
{ {
ASSERT(!paintInvalidationContainerSkipped || !*paintInvalidationContainerSkipped); ASSERT(!ancestorSkipped || !*ancestorSkipped);
ASSERT(!isText()); ASSERT(!isText());
LayoutObject* ancestor = parent(); LayoutObject* object = parent();
for (; ancestor && !ancestor->canContainFixedPositionObjects(); ancestor = ancestor->parent()) { for (; object && !object->canContainFixedPositionObjects(); object = object->parent()) {
if (paintInvalidationContainerSkipped && ancestor == paintInvalidationContainer) if (ancestorSkipped && object == ancestor)
*paintInvalidationContainerSkipped = true; *ancestorSkipped = true;
} }
ASSERT(!ancestor || !ancestor->isAnonymousBlock()); ASSERT(!object || !object->isAnonymousBlock());
return toLayoutBlock(ancestor); return toLayoutBlock(object);
} }
LayoutBlock* LayoutObject::containingBlockForAbsolutePosition() const LayoutBlock* LayoutObject::containingBlockForAbsolutePosition() const
...@@ -2245,8 +2245,8 @@ void LayoutObject::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tran ...@@ -2245,8 +2245,8 @@ void LayoutObject::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tran
if (ancestor == this) if (ancestor == this)
return; return;
bool containerSkipped; bool ancestorSkipped;
const LayoutObject* o = container(ancestor, &containerSkipped); const LayoutObject* o = container(ancestor, &ancestorSkipped);
if (!o) if (!o)
return; return;
...@@ -2280,7 +2280,7 @@ void LayoutObject::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tran ...@@ -2280,7 +2280,7 @@ void LayoutObject::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tran
transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform); transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
} }
if (containerSkipped) { if (ancestorSkipped) {
// There can't be a transform between |ancestor| and |o|, because transforms create // There can't be a transform between |ancestor| and |o|, because transforms create
// containers, so it should be safe to just subtract the delta between the ancestor and |o|. // containers, so it should be safe to just subtract the delta between the ancestor and |o|.
LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(o); LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(o);
...@@ -2302,8 +2302,8 @@ void LayoutObject::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Tran ...@@ -2302,8 +2302,8 @@ void LayoutObject::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Tran
if (this == ancestor) if (this == ancestor)
return; return;
bool containerSkipped; bool ancestorSkipped;
LayoutObject* o = container(ancestor, &containerSkipped); LayoutObject* o = container(ancestor, &ancestorSkipped);
if (!o) if (!o)
return; return;
...@@ -2317,7 +2317,7 @@ void LayoutObject::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Tran ...@@ -2317,7 +2317,7 @@ void LayoutObject::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Tran
} }
} }
if (!containerSkipped) if (!ancestorSkipped)
o->mapAncestorToLocal(ancestor, transformState, mode); o->mapAncestorToLocal(ancestor, transformState, mode);
LayoutSize containerOffset = offsetFromContainer(o); LayoutSize containerOffset = offsetFromContainer(o);
...@@ -2341,7 +2341,7 @@ void LayoutObject::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Tran ...@@ -2341,7 +2341,7 @@ void LayoutObject::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Tran
transformState.move(centerPoint - toLayoutBox(o)->flipForWritingMode(LayoutPoint(centerPoint))); transformState.move(centerPoint - toLayoutBox(o)->flipForWritingMode(LayoutPoint(centerPoint)));
} }
if (containerSkipped) { if (ancestorSkipped) {
containerOffset = ancestor->offsetFromAncestorContainer(o); containerOffset = ancestor->offsetFromAncestorContainer(o);
transformState.move(-containerOffset.width(), -containerOffset.height()); transformState.move(-containerOffset.width(), -containerOffset.height());
} }
...@@ -2585,10 +2585,10 @@ RespectImageOrientationEnum LayoutObject::shouldRespectImageOrientation(const La ...@@ -2585,10 +2585,10 @@ RespectImageOrientationEnum LayoutObject::shouldRespectImageOrientation(const La
return DoNotRespectImageOrientation; return DoNotRespectImageOrientation;
} }
LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const LayoutObject* LayoutObject::container(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped) const
{ {
if (paintInvalidationContainerSkipped) if (ancestorSkipped)
*paintInvalidationContainerSkipped = false; *ancestorSkipped = false;
LayoutObject* o = parent(); LayoutObject* o = parent();
...@@ -2597,19 +2597,19 @@ LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidat ...@@ -2597,19 +2597,19 @@ LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidat
EPosition pos = m_style->position(); EPosition pos = m_style->position();
if (pos == FixedPosition) if (pos == FixedPosition)
return containerForFixedPosition(paintInvalidationContainer, paintInvalidationContainerSkipped); return containerForFixedPosition(ancestor, ancestorSkipped);
if (pos == AbsolutePosition) if (pos == AbsolutePosition)
return containerForAbsolutePosition(paintInvalidationContainer, paintInvalidationContainerSkipped); return containerForAbsolutePosition(ancestor, ancestorSkipped);
if (isColumnSpanAll()) { if (isColumnSpanAll()) {
LayoutObject* multicolContainer = spannerPlaceholder()->container(); LayoutObject* multicolContainer = spannerPlaceholder()->container();
if (paintInvalidationContainerSkipped && paintInvalidationContainer) { if (ancestorSkipped && ancestor) {
// We jumped directly from the spanner to the multicol container. Need to check if // We jumped directly from the spanner to the multicol container. Need to check if
// we skipped |paintInvalidationContainer| on the way. // we skipped |paintInvalidationContainer| on the way.
for (LayoutObject* walker = parent(); walker && walker != multicolContainer; walker = walker->parent()) { for (LayoutObject* walker = parent(); walker && walker != multicolContainer; walker = walker->parent()) {
if (walker == paintInvalidationContainer) { if (walker == ancestor) {
*paintInvalidationContainerSkipped = true; *ancestorSkipped = true;
break; break;
} }
} }
......
...@@ -1618,7 +1618,7 @@ private: ...@@ -1618,7 +1618,7 @@ private:
LayoutRect previousSelectionRectForPaintInvalidation() const; LayoutRect previousSelectionRectForPaintInvalidation() const;
void setPreviousSelectionRectForPaintInvalidation(const LayoutRect&); void setPreviousSelectionRectForPaintInvalidation(const LayoutRect&);
LayoutObject* containerForAbsolutePosition(const LayoutBoxModelObject* paintInvalidationContainer = nullptr, bool* paintInvalidationContainerSkipped = nullptr) const; LayoutObject* containerForAbsolutePosition(const LayoutBoxModelObject* ancestor = nullptr, bool* ancestorSkipped = nullptr) const;
const LayoutBoxModelObject* enclosingCompositedContainer() const; const LayoutBoxModelObject* enclosingCompositedContainer() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment