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

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

Issue 2070563002: Seperate DOMVisualViewport from Blink's VisualViewport class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index 130fa525436b6c9a99074fab4f406eab4484d746..047ea9fe1021a1dec3b4a8bf22bd88b9513cb6fe 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -48,6 +48,7 @@
#include "core/events/PopStateEvent.h"
#include "core/events/ScopedEventQueue.h"
#include "core/frame/BarProp.h"
+#include "core/frame/DOMVisualViewport.h"
#include "core/frame/EventHandlerRegistry.h"
#include "core/frame/FrameConsole.h"
#include "core/frame/FrameView.h"
@@ -302,6 +303,7 @@ bool LocalDOMWindow::allowPopUp()
LocalDOMWindow::LocalDOMWindow(LocalFrame& frame)
: m_frameObserver(WindowFrameObserver::create(this, frame))
+ , m_visualViewport(DOMVisualViewport::create(this))
, m_shouldPrintWhenFinishedLoading(false)
{
ThreadState::current()->registerPreFinalizer(this);
@@ -1031,16 +1033,12 @@ double LocalDOMWindow::scrollY() const
return adjustScrollForAbsoluteZoom(viewportY, frame()->pageZoomFactor());
}
-VisualViewport* LocalDOMWindow::visualViewport()
+DOMVisualViewport* LocalDOMWindow::visualViewport()
{
if (!frame())
return nullptr;
- FrameHost* host = frame()->host();
- if (!host)
- return nullptr;
-
- return &host->visualViewport();
+ return m_visualViewport;
}
const AtomicString& LocalDOMWindow::name() const
@@ -1541,6 +1539,7 @@ DEFINE_TRACE(LocalDOMWindow)
visitor->trace(m_applicationCache);
visitor->trace(m_eventQueue);
visitor->trace(m_postMessageTimers);
+ visitor->trace(m_visualViewport);
DOMWindow::trace(visitor);
Supplementable<LocalDOMWindow>::trace(visitor);
DOMWindowLifecycleNotifier::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698