| Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| index 4fc4b88d0b30ee3b40066ef8b3237f68d14340cc..9ae99b8f0ad4a618bae43e4b29e791df37d09c61 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| @@ -991,15 +991,11 @@ bool LayoutBox::mapScrollingContentsRectToBoxSpace(LayoutRect& rect, ApplyOverfl
|
| return true;
|
|
|
| LayoutSize offset = LayoutSize(-scrolledContentOffset());
|
| - if (UNLIKELY(hasFlippedBlocksWritingMode()))
|
| - offset.setWidth(-offset.width());
|
| rect.move(offset);
|
|
|
| if (applyOverflowClip == ApplyNonScrollOverflowClip && scrollsOverflow())
|
| return true;
|
|
|
| - flipForWritingMode(rect);
|
| -
|
| LayoutRect clipRect = overflowClipRect(LayoutPoint());
|
|
|
| bool doesIntersect;
|
| @@ -1009,8 +1005,6 @@ bool LayoutBox::mapScrollingContentsRectToBoxSpace(LayoutRect& rect, ApplyOverfl
|
| rect.intersect(clipRect);
|
| doesIntersect = !rect.isEmpty();
|
| }
|
| - if (doesIntersect)
|
| - flipForWritingMode(rect);
|
| return doesIntersect;
|
| }
|
|
|
| @@ -2043,34 +2037,23 @@ bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances
|
| {
|
| inflateVisualRectForReflectionAndFilter(rect);
|
|
|
| - if (ancestor == this) {
|
| - // The final rect returned is always in the physical coordinate space of the ancestor.
|
| - flipForWritingMode(rect);
|
| + if (ancestor == this)
|
| return true;
|
| - }
|
|
|
| bool ancestorSkipped;
|
| bool filterOrReflectionSkipped;
|
| LayoutObject* container = this->container(ancestor, &ancestorSkipped, &filterOrReflectionSkipped);
|
| + LayoutBox* localContainingBlock = containingBlock();
|
| + if (container->isTableRow()) {
|
| + localContainingBlock = toLayoutBox(container->parent());
|
| + container = container->parent();
|
| + }
|
| if (!container)
|
| return true;
|
|
|
| if (filterOrReflectionSkipped)
|
| inflateVisualRectForReflectionAndFilterUnderContainer(rect, *container, ancestor);
|
|
|
| - // The rect we compute at each step is shifted by our x/y offset in the parent container's coordinate space.
|
| - // Only when we cross a writing mode boundary will we have to possibly flipForWritingMode (to convert into a more
|
| - // appropriate offset corner for the enclosing container).
|
| - if (isWritingModeRoot()) {
|
| - flipForWritingMode(rect);
|
| - // Then flip rect currently in physical direction to container's block direction.
|
| - if (container->styleRef().isFlippedBlocksWritingMode())
|
| - rect.setX(m_frameRect.width() - rect.maxX());
|
| - }
|
| -
|
| - LayoutPoint topLeft = rect.location();
|
| - topLeft.move(locationOffset());
|
| -
|
| // We are now in our parent container's coordinate space. Apply our transform to obtain a bounding box
|
| // in the parent's coordinate space that encloses us.
|
| if (hasLayer() && layer()->transform()) {
|
| @@ -2078,9 +2061,10 @@ bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances
|
| // the transform since we don't know the desired subpixel accumulation at this point, and the transform may
|
| // include a scale.
|
| rect = LayoutRect(layer()->transform()->mapRect(enclosingIntRect(rect)));
|
| - topLeft = rect.location();
|
| - topLeft.move(locationOffset());
|
| }
|
| + LayoutPoint topLeft = rect.location();
|
| + if (!(isInline() && isLayoutInline()))
|
| + topLeft.moveBy(topLeftLocation(localContainingBlock));
|
|
|
| const ComputedStyle& styleToUse = styleRef();
|
| EPosition position = styleToUse.position();
|
| @@ -2102,7 +2086,7 @@ bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances
|
| return false;
|
|
|
| if (ancestorSkipped) {
|
| - // If the ancestor is below o, then we need to map the rect into ancestor's coordinates.
|
| + // If the ancestor is below the container, then we need to map the rect into ancestor's coordinates.
|
| LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(container);
|
| rect.move(-containerOffset);
|
| // If the ancestor is fixed, then the rect is already in its coordinates so doesn't need viewport-adjusting.
|
| @@ -4475,12 +4459,12 @@ LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const
|
| return LayoutPoint(point.x() + size().width() - child->size().width() - (2 * child->location().x()), point.y());
|
| }
|
|
|
| -LayoutPoint LayoutBox::topLeftLocation() const
|
| +LayoutPoint LayoutBox::topLeftLocation(const LayoutBox* container) const
|
| {
|
| - LayoutBlock* containerBlock = containingBlock();
|
| - if (!containerBlock || containerBlock == this)
|
| + const LayoutBox* containerBox = container ? container : containingBlock();
|
| + if (!containerBox || containerBox == this)
|
| return location();
|
| - return containerBlock->flipForWritingModeForChild(this, location());
|
| + return containerBox->flipForWritingModeForChild(this, location());
|
| }
|
|
|
| bool LayoutBox::hasRelativeLogicalWidth() const
|
|
|