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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2431473003: Intersection Observer support for OOPIF (Closed)
Patch Set: Created 4 years, 2 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index c1d058d3ad7f28cfc677ed799b0c5128e726c3e1..06eff4b2ca22e4a15b232efd33831a853165f12b 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -46,6 +46,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/TopControls.h"
#include "core/frame/VisualViewport.h"
@@ -4312,7 +4314,11 @@ void FrameView::updateViewportIntersectionIfNeeded() {
m_viewportIntersectionValid = true;
FrameView* parent = parentFrameView();
if (!parent) {
- m_viewportIntersection = frameRect();
+ Frame* parent = m_frame->tree().parent();
+ if (parent && parent->isRemoteFrame())
+ m_viewportIntersection = m_remoteViewportIntersection;
+ else
+ m_viewportIntersection = frameRect();
return;
}
ASSERT(!parent->m_needsUpdateViewportIntersection);
@@ -4367,13 +4373,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.
@@ -4480,4 +4492,18 @@ bool FrameView::canThrottleRendering() const {
(m_hiddenForThrottling && m_crossOriginForThrottling);
}
+void FrameView::setViewportIntersectionFromParent(
+ const IntRect& viewportIntersection,
+ const IntPoint& rootOffset) {
+ m_remoteViewportIntersection = viewportIntersection;
+ m_remoteRootOffset = rootOffset;
+ m_needsUpdateViewportIntersection = true;
+}
+
+IntRect FrameView::remoteViewportIntersection() {
+ IntRect intersection = m_remoteViewportIntersection;
+ intersection.moveBy(-m_remoteRootOffset);
+ return intersection;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698