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

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: make visualviewportchanged per frame + other review feedback 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 3ae652d4a77fd109b1f91e9e93388b5ee049fd44..fd18957add20e3d040ac93821ed18a90500061c9 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1228,6 +1228,13 @@ Element* Document::scrollingElement()
return body();
}
+VisualViewport* Document::visualViewport()
+{
+ if (FrameHost* host = frameHost())
+ return &host->visualViewport();
esprehn 2016/03/31 05:15:37 does your spec say that a document without a view
bokan 2016/03/31 15:23:54 That seems correct to me. I've added the wording i
+ return nullptr;
+}
+
/*
* Performs three operations:
* 1. Convert control characters to spaces
@@ -4006,6 +4013,13 @@ void Document::enqueueMediaQueryChangeListeners(WillBeHeapVector<RefPtrWillBeMem
ensureScriptedAnimationController().enqueueMediaQueryChangeListeners(listeners);
}
+void Document::enqueueVisualViewportChangedEvent()
+{
+ RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::visualviewportchanged);
+ event->setTarget(this);
+ ensureScriptedAnimationController().enqueuePerFrameEvent(event.release());
+}
+
void Document::dispatchEventsForPrinting()
{
if (!m_scriptedAnimationController)

Powered by Google App Engine
This is Rietveld 408576698