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

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: nits Created 4 years, 9 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/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 9d85b6563e4b8cca9fe8f99838c6e15ffeae7a32..0c9b8d2fcedc37c6fda618e7f159cd26d6576b89 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1230,6 +1230,18 @@ Element* Document::scrollingElement()
return body();
}
+VisualViewport* Document::visualViewport()
+{
+ if (FrameHost* host = frameHost())
+ return &host->visualViewport();
+ return nullptr;
+}
+
+void Document::dispatchVisualViewportChangedEvent()
+{
+ dispatchEvent(Event::create(EventTypeNames::visualviewportchanged));
+}
+
/*
* Performs three operations:
* 1. Convert control characters to spaces

Powered by Google App Engine
This is Rietveld 408576698