Bug 1478776 - Part 5: Define Visual Viewport event handlers. r=botond,Ehsan
authorJan Henning <jh+bugzilla@buttercookie.de>
Fri, 21 Dec 2018 17:08:47 +0000
changeset 451696 24951c9d732d81bc1747f089c683e2ffecd78ea0
parent 451695 b056dade814dc2018a7fb3114b21ab33301a44fe
child 451697 63749e66f2665bfb64988809fbd541874084cfe1
push id35251
push userccoroiu@mozilla.com
push dateFri, 21 Dec 2018 21:54:30 +0000
treeherdermozilla-central@74101900e7d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond, Ehsan
bugs1478776
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1478776 - Part 5: Define Visual Viewport event handlers. r=botond,Ehsan As per https://wicg.github.io/visual-viewport/#the-visualviewport-interface. Differential Revision: https://phabricator.services.mozilla.com/D14042
dom/base/VisualViewport.h
dom/webidl/VisualViewport.webidl
--- a/dom/base/VisualViewport.h
+++ b/dom/base/VisualViewport.h
@@ -23,16 +23,18 @@ class VisualViewport final : public mozi
 
   double OffsetLeft() const;
   double OffsetTop() const;
   double PageLeft() const;
   double PageTop() const;
   double Width() const;
   double Height() const;
   double Scale() const;
+  IMPL_EVENT_HANDLER(resize)
+  IMPL_EVENT_HANDLER(scroll)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
 
  private:
   virtual ~VisualViewport();
 
   CSSSize VisualViewportSize() const;
--- a/dom/webidl/VisualViewport.webidl
+++ b/dom/webidl/VisualViewport.webidl
@@ -13,9 +13,12 @@ interface VisualViewport : EventTarget {
 
   readonly attribute double pageLeft;
   readonly attribute double pageTop;
 
   readonly attribute double width;
   readonly attribute double height;
 
   readonly attribute double scale;
+
+  attribute EventHandler onresize;
+  attribute EventHandler onscroll;
 };