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

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

Issue 1814013002: Visual viewport API initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 7003675a5570233f05ad4e4d54e441ca8274acd1..ebe8c73b4e6c985e549c7a20e6bfc197839f1f62 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -721,6 +721,22 @@ int Element::clientHeight()
return 0;
}
+VisualViewport* Element::viewport()
+{
+ if (this != document().documentElement())
+ return nullptr;
+
+ document().updateLayoutIgnorePendingStylesheets();
bokan 2016/03/18 16:05:07 You don't need this here. Having a VisualViewport
ymalik 2016/03/22 16:35:06 Done.
+
+ LocalFrame* frame = document().frame();
+ if (!frame)
+ return nullptr;
+ FrameHost* host = frame->host();
+ if (!host)
+ return nullptr;
+ return &host->visualViewport();
+}
+
double Element::scrollLeft()
{
document().updateLayoutIgnorePendingStylesheets();
@@ -2509,6 +2525,11 @@ void Element::dispatchFocusOutEvent(const AtomicString& eventType, Element* newF
dispatchScopedEvent(FocusEvent::create(eventType, true, false, document().domWindow(), 0, newFocusedElement, sourceCapabilities));
}
+void Element::dispatchViewportChangedEvent()
+{
+ dispatchEvent(Event::create(EventTypeNames::viewportchanged));
+}
+
String Element::innerHTML() const
{
return createMarkup(this, ChildrenOnly);

Powered by Google App Engine
This is Rietveld 408576698