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

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

Issue 2631853002: Give OOPIF FrameViews their own scroll animation timelines and hosts (Closed)
Patch Set: Fixes from bokan comments Created 3 years, 11 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 dff9ec6cdf05317ec33675b3d62167066f24030e..3a64c6c5290a0d1137c5f125ccef4d75e90585b5 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -569,11 +569,30 @@ ScrollingCoordinator* FrameView::scrollingCoordinator() const {
}
CompositorAnimationHost* FrameView::compositorAnimationHost() const {
+ // When m_animationHost is not nullptr, this is the FrameView for an OOPIF.
+ if (m_animationHost)
+ return m_animationHost.get();
+
+ if (m_frame->localFrameRoot() != m_frame)
+ return m_frame->localFrameRoot()->view()->compositorAnimationHost();
+
+ if (!m_frame->isMainFrame())
+ return nullptr;
+
ScrollingCoordinator* c = scrollingCoordinator();
return c ? c->compositorAnimationHost() : nullptr;
}
CompositorAnimationTimeline* FrameView::compositorAnimationTimeline() const {
+ if (m_animationTimeline)
+ return m_animationTimeline.get();
+
+ if (m_frame->localFrameRoot() != m_frame)
+ return m_frame->localFrameRoot()->view()->compositorAnimationTimeline();
+
+ if (!m_frame->isMainFrame())
+ return nullptr;
+
ScrollingCoordinator* c = scrollingCoordinator();
return c ? c->compositorAnimationTimeline() : nullptr;
}
@@ -4992,4 +5011,14 @@ void FrameView::applyTransformForTopFrameSpace(TransformState& transformState) {
LayoutSize(-viewportIntersectionRect.x(), -viewportIntersectionRect.y()));
}
+void FrameView::setAnimationTimeline(
+ std::unique_ptr<CompositorAnimationTimeline> timeline) {
+ m_animationTimeline = std::move(timeline);
+}
+
+void FrameView::setAnimationHost(
+ std::unique_ptr<CompositorAnimationHost> host) {
+ m_animationHost = std::move(host);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/frame/VisualViewport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698