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

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

Issue 2431473003: Intersection Observer support for OOPIF (Closed)
Patch Set: Rebase only Created 3 years, 12 months 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 269ad5bb07092e2f6d9ab4d97ddcf9000953944d..335c1d53c765b0fc2e6587e8c4611989151fde54 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()));
}
}
}
@@ -463,16 +470,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.
dcheng 2017/01/05 07:10:19 While I'm OK with this patch as written, my origin
szager1 2017/01/05 20:25:22 +1, it should be straightforward to add something
kenrb 2017/01/09 19:31:20 Done. I similarly moved the logic out of mapLocalT
+ 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