Chromium Code Reviews| 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); |