Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 2431473003: Intersection Observer support for OOPIF (Closed)
Patch Set: Applying root scroll offset better Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)) {

Powered by Google App Engine
This is Rietveld 408576698