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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1814013002: Visual viewport API initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Document.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index dae347c7eed3cb2beeaa3708f6564629b8a72db9..f1a072521f86e05d87fbfd27d910ce2a7e1e50c6 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1230,6 +1230,13 @@ Element* Document::scrollingElement()
return body();
}
+VisualViewport* Document::visualViewport()
+{
+ if (FrameHost* host = frameHost())
+ return &host->visualViewport();
+ return nullptr;
+}
+
/*
* Performs three operations:
* 1. Convert control characters to spaces
@@ -4018,6 +4025,13 @@ void Document::enqueueMediaQueryChangeListeners(HeapVector<Member<MediaQueryList
ensureScriptedAnimationController().enqueueMediaQueryChangeListeners(listeners);
}
+void Document::enqueueVisualViewportChangedEvent()
+{
+ RawPtr<Event> event = Event::create(EventTypeNames::visualviewportchanged);
+ event->setTarget(this);
+ ensureScriptedAnimationController().enqueuePerFrameEvent(event.release());
+}
+
void Document::dispatchEventsForPrinting()
{
if (!m_scriptedAnimationController)
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698