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 361d7d7d76a76a023e0722dc03da6b3fafc397a4..a283d72b899683c7b01eba815bdc74d8ddd32ddd 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
@@ -343,6 +343,13 @@ void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, |
transformState.move(parentDocLayoutItem.contentBoxOffset()); |
parentDocLayoutItem.mapLocalToAncestor(ancestor, transformState, mode); |
+ } else if (!document().frame()->isMainFrame()) { |
+ // This is the case of a Frame with a remote parent. |
+ DCHECK(!ancestor); |
+ LayoutRect viewportIntersectionRect( |
+ frameView()->remoteViewportIntersection()); |
+ transformState.move(LayoutSize(-viewportIntersectionRect.x(), |
+ -viewportIntersectionRect.y())); |
} |
} |
} |
@@ -460,16 +467,25 @@ bool LayoutView::mapToVisualRectInAncestorSpace( |
rect.move(offsetForFixedPosition(true)); |
// Apply our transform if we have one (because of full page zooming). |
- if (!ancestor && layer() && layer()->transform()) |
+ if (layer() && layer()->transform()) |
rect = layer()->transform()->mapRect(rect); |
- ASSERT(ancestor); |
if (ancestor == this) |
return true; |
Element* owner = document().localOwner(); |
- if (!owner) |
+ if (!owner) { |
+ // This is the case of a Frame with a remote parent. |
+ if (!document().frame()->isMainFrame()) { |
+ DCHECK(!ancestor); |
+ LayoutRect viewportIntersectionRect( |
+ frameView()->remoteViewportIntersection()); |
+ rect.intersect(viewportIntersectionRect); |
+ if (rect.isEmpty()) |
+ return false; |
+ } |
return true; |
+ } |
if (LayoutBox* obj = owner->layoutBox()) { |
if (!(mode & InputIsInFrameCoordinates)) { |