| Index: third_party/WebKit/Source/core/layout/LayoutView.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
|
| index 7abdf095176938fe46d1931bbb85ecd5bd0e806a..4ce9d02ac82988520dab9ba4ae14d2fe5df89866 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
|
| @@ -479,12 +479,31 @@ void LayoutView::invalidatePaintForViewAndCompositedLayers()
|
| compositor()->fullyInvalidatePaint();
|
| }
|
|
|
| -bool LayoutView::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, VisualRectFlags visualRectFlags) const
|
| +bool LayoutView::mapContentRectToFrameSpace(const LayoutBox* contentObject, LayoutRect& rect, VisualRectFlags visualRectFlags) const
|
| {
|
| - return mapToVisualRectInAncestorSpace(ancestor, rect, 0, visualRectFlags);
|
| + if (document().settings() && document().settings()->rootLayerScrolls())
|
| + return true;
|
| +
|
| + if (contentObject && contentObject->styleRef().position() == FixedPosition)
|
| + adjustOffsetForFixedPosition(rect);
|
| +
|
| + // Intersect the viewport with the paint invalidation rect.
|
| + LayoutRect viewRectangle = viewRect();
|
| + if (visualRectFlags & EdgeInclusive) {
|
| + if (!rect.inclusiveIntersect(viewRectangle))
|
| + return false;
|
| + } else {
|
| + rect.intersect(viewRectangle);
|
| + if (rect.isEmpty())
|
| + return false;
|
| + }
|
| +
|
| + // Adjust for scroll offset of the view.
|
| + rect.moveBy(-viewRectangle.location());
|
| + return true;
|
| }
|
|
|
| -bool LayoutView::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, MapCoordinatesFlags mode, VisualRectFlags visualRectFlags) const
|
| +bool LayoutView::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, VisualRectFlags visualRectFlags) const
|
| {
|
| if (document().printing())
|
| return true;
|
| @@ -495,43 +514,21 @@ bool LayoutView::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ance
|
| rect.setX(viewWidth() - rect.maxX());
|
| }
|
|
|
| - if (mode & IsFixed)
|
| - adjustOffsetForFixedPosition(rect);
|
| -
|
| - // Apply our transform if we have one (because of full page zooming).
|
| - if (!ancestor && layer() && layer()->transform())
|
| - rect = layer()->transform()->mapRect(rect);
|
| + ASSERT(!layer()->transform());
|
|
|
| ASSERT(ancestor);
|
| if (ancestor == this)
|
| return true;
|
|
|
| - Element* owner = document().ownerElement();
|
| - if (!owner)
|
| - return true;
|
| -
|
| - if (LayoutBox* obj = owner->layoutBox()) {
|
| - if (!(mode & InputIsInFrameCoordinates)) {
|
| - // Intersect the viewport with the paint invalidation rect.
|
| - LayoutRect viewRectangle = viewRect();
|
| - if (visualRectFlags & EdgeInclusive) {
|
| - if (!rect.inclusiveIntersect(viewRectangle))
|
| - return false;
|
| - } else {
|
| - rect.intersect(viewRectangle);
|
| - }
|
| -
|
| - // Adjust for scroll offset of the view.
|
| - rect.moveBy(-viewRectangle.location());
|
| - }
|
| + if (LayoutPart* owner = frame()->ownerLayoutObject()) {
|
| // Frames are painted at rounded-int position. Since we cannot efficiently compute the subpixel offset
|
| // of painting at this point in a a bottom-up walk, round to the enclosing int rect, which will enclose
|
| // the actual visible rect.
|
| rect = LayoutRect(enclosingIntRect(rect));
|
|
|
| // Adjust for frame border.
|
| - rect.move(obj->contentBoxOffset());
|
| - return obj->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFlags);
|
| + rect.move(owner->contentBoxOffset());
|
| + return owner->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFlags);
|
| }
|
|
|
| return true;
|
|
|