Index: third_party/WebKit/Source/core/frame/FrameView.cpp |
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp |
index 8a3bfdab13304af8192d6e487225889e4d25b60f..e5879b2f89d6373e1ddff669a0135259c275bb7a 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
@@ -47,6 +47,8 @@ |
#include "core/frame/LocalFrame.h" |
#include "core/frame/Location.h" |
#include "core/frame/PageScaleConstraintsSet.h" |
+#include "core/frame/RemoteFrame.h" |
+#include "core/frame/RemoteFrameView.h" |
#include "core/frame/Settings.h" |
#include "core/frame/VisualViewport.h" |
#include "core/html/HTMLFrameElement.h" |
@@ -4339,6 +4341,10 @@ void FrameView::updateViewportIntersectionIfNeeded() { |
m_viewportIntersectionValid = true; |
FrameView* parent = parentFrameView(); |
if (!parent) { |
+ // TODO(kenrb): For an OOPIF, we could use m_remoteViewportIntersection |
+ // to compute m_viewportIntersection, but there needs to be a way to |
+ // convert to the root frame's coordinate space when there are remote |
+ // frame ancestors in the tree. |
HTMLFrameOwnerElement* element = frame().deprecatedLocalOwner(); |
if (!element) |
frame().document()->maybeRecordLoadReason(WouldLoadOutOfProcess); |
@@ -4416,13 +4422,19 @@ void FrameView::updateViewportIntersectionsForSubtree( |
for (Frame* child = m_frame->tree().firstChild(); child; |
child = child->tree().nextSibling()) { |
- if (!child->isLocalFrame()) |
- continue; |
- if (FrameView* view = toLocalFrame(child)->view()) |
+ if (child->isRemoteFrame() && toRemoteFrame(child)->view()) |
+ toRemoteFrame(child)->view()->updateRemoteViewportIntersection(); |
+ else if (FrameView* view = toLocalFrame(child)->view()) |
view->updateViewportIntersectionsForSubtree(targetState); |
} |
} |
+IntRect FrameView::viewportIntersection() { |
+ if (m_viewportIntersectionValid) |
+ return m_viewportIntersection; |
+ return IntRect(); |
+} |
+ |
void FrameView::updateThrottlingStatus() { |
// Only offscreen frames can be throttled. Note that we disallow throttling |
// of 0x0 frames because some sites use them to drive UI logic. |
@@ -4546,4 +4558,17 @@ int FrameView::initialViewportHeight() const { |
return m_initialViewportSize.height(); |
} |
+void FrameView::setViewportIntersectionFromParent( |
+ const IntRect& viewportIntersection) { |
+ m_remoteViewportIntersection = viewportIntersection; |
+ setNeedsUpdateViewportIntersection(); |
+ updateAllLifecyclePhases(); |
kenrb
2016/11/07 18:48:49
Is this call okay? I was finding that the test was
szager1
2016/11/16 18:57:58
This is not kosher. I think you just want to:
if
kenrb
2016/11/21 19:37:35
Done.
|
+} |
+ |
+IntRect FrameView::remoteViewportIntersection() { |
+ IntRect intersection(m_remoteViewportIntersection); |
+ intersection.move(scrollOffsetInt()); |
+ return intersection; |
+} |
+ |
} // namespace blink |