| Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| index c9bf7393540467dee08ab8c15b8e043ae016d421..fcadb1717ff1d5c9fc061e7d3fa5de1fe353cad8 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| @@ -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 may not have one if we're part of an uninstalled
|
| @@ -890,25 +890,25 @@ LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObj
|
| if (object->canContainAbsolutePositionObjects())
|
| return object;
|
|
|
| - if (paintInvalidationContainerSkipped && object == paintInvalidationContainer)
|
| - *paintInvalidationContainerSkipped = true;
|
| + if (ancestorSkipped && object == ancestor)
|
| + *ancestorSkipped = true;
|
| }
|
| 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());
|
|
|
| - LayoutObject* ancestor = parent();
|
| - for (; ancestor && !ancestor->canContainFixedPositionObjects(); ancestor = ancestor->parent()) {
|
| - if (paintInvalidationContainerSkipped && ancestor == paintInvalidationContainer)
|
| - *paintInvalidationContainerSkipped = true;
|
| + LayoutObject* object = parent();
|
| + for (; object && !object->canContainFixedPositionObjects(); object = object->parent()) {
|
| + if (ancestorSkipped && object == ancestor)
|
| + *ancestorSkipped = true;
|
| }
|
|
|
| - ASSERT(!ancestor || !ancestor->isAnonymousBlock());
|
| - return toLayoutBlock(ancestor);
|
| + ASSERT(!object || !object->isAnonymousBlock());
|
| + return toLayoutBlock(object);
|
| }
|
|
|
| LayoutBlock* LayoutObject::containingBlockForAbsolutePosition() const
|
| @@ -1641,17 +1641,19 @@ LayoutRect LayoutObject::localOverflowRectForPaintInvalidation() const
|
| bool LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, VisibleRectFlags visibleRectFlags) const
|
| {
|
| // For any layout object that doesn't override this method (the main example is LayoutText),
|
| - // the rect is assumed to be in the coordinate space of the object's parent.
|
| + // the rect is assumed to be in the contents coordinate space of the object's parent.
|
|
|
| if (ancestor == this)
|
| return true;
|
|
|
| if (LayoutObject* parent = this->parent()) {
|
| - if (parent->hasOverflowClip()) {
|
| + if (parent->isBox()) {
|
| LayoutBox* parentBox = toLayoutBox(parent);
|
| - parentBox->mapScrollingContentsRectToBoxSpace(rect);
|
| - if (parent != ancestor && !parentBox->applyOverflowClip(rect, visibleRectFlags))
|
| + if (!parentBox->mapContentsRectToVisibleRectInBorderBoxSpace(rect, visibleRectFlags))
|
| return false;
|
| +
|
| + if (parentBox == ancestor || parentBox->isWritingModeRoot())
|
| + parentBox->flipForWritingMode(rect);
|
| }
|
|
|
| return parent->mapToVisibleRectInAncestorSpace(ancestor, rect, visibleRectFlags);
|
| @@ -2588,10 +2590,10 @@ RespectImageOrientationEnum LayoutObject::shouldRespectImageOrientation(const La
|
| return DoNotRespectImageOrientation;
|
| }
|
|
|
| -LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const
|
| +LayoutObject* LayoutObject::container(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped) const
|
| {
|
| - if (paintInvalidationContainerSkipped)
|
| - *paintInvalidationContainerSkipped = false;
|
| + if (ancestorSkipped)
|
| + *ancestorSkipped = false;
|
|
|
| LayoutObject* o = parent();
|
|
|
| @@ -2600,19 +2602,19 @@ LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidat
|
|
|
| EPosition pos = m_style->position();
|
| if (pos == FixedPosition)
|
| - return containerForFixedPosition(paintInvalidationContainer, paintInvalidationContainerSkipped);
|
| + return containerForFixedPosition(ancestor, ancestorSkipped);
|
|
|
| if (pos == AbsolutePosition)
|
| - return containerForAbsolutePosition(paintInvalidationContainer, paintInvalidationContainerSkipped);
|
| + return containerForAbsolutePosition(ancestor, ancestorSkipped);
|
|
|
| if (isColumnSpanAll()) {
|
| 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 skipped |paintInvalidationContainer| on the way.
|
| for (LayoutObject* walker = parent(); walker && walker != multicolContainer; walker = walker->parent()) {
|
| - if (walker == paintInvalidationContainer) {
|
| - *paintInvalidationContainerSkipped = true;
|
| + if (walker == ancestor) {
|
| + *ancestorSkipped = true;
|
| break;
|
| }
|
| }
|
|
|