Bug 1151940 part 1. Make some readonly properties defined on Window by CSSOM-view replaceable. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 08 Apr 2015 22:50:45 -0400
changeset 238258 3044755948fd0a9ed6171c64939b3cff4e3daa94
parent 238257 55fefc16edbaaacb56f67fa340fb8aefd3082d52
child 238259 ab636388d337132c08add96ad722d77f02d78ec9
push id58167
push userbzbarsky@mozilla.com
push dateThu, 09 Apr 2015 02:51:03 +0000
treeherdermozilla-inbound@6607b7fca4f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1151940
milestone40.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 1151940 part 1. Make some readonly properties defined on Window by CSSOM-view replaceable. r=smaug
dom/webidl/Window.webidl
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -155,18 +155,20 @@ dictionary ScrollOptions {
 dictionary ScrollToOptions : ScrollOptions {
   unrestricted double left;
   unrestricted double top;
 };
 
 partial interface Window {
   //[Throws,NewObject] MediaQueryList matchMedia(DOMString query);
   [Throws,NewObject] MediaQueryList? matchMedia(DOMString query);
-  //[SameObject]
-  [Throws] readonly attribute Screen screen;
+  // Per spec, screen is SameObject, but we don't actually guarantee that given
+  // nsGlobalWindow::Cleanup.  :(
+  //[SameObject, Replaceable, Throws] readonly attribute Screen screen;
+  [Replaceable, Throws] readonly attribute Screen screen;
 
   // browsing context
   //[Throws] void moveTo(double x, double y);
   //[Throws] void moveBy(double x, double y);
   //[Throws] void resizeTo(double x, double y);
   //[Throws] void resizeBy(double x, double y);
   [Throws, UnsafeInPrerendering] void moveTo(long x, long y);
   [Throws, UnsafeInPrerendering] void moveBy(long x, long y);
@@ -175,35 +177,37 @@ partial interface Window {
 
   // viewport
   //[Throws] readonly attribute double innerWidth;
   //[Throws] readonly attribute double innerHeight;
   [Throws] attribute long innerWidth;
   [Throws] attribute long innerHeight;
 
   // viewport scrolling
-  //[Throws] readonly attribute double scrollX;
-  //[Throws] readonly attribute double pageXOffset;
-  //[Throws] readonly attribute double scrollY;
-  //[Throws] readonly attribute double pageYOffset;
   void scroll(unrestricted double x, unrestricted double y);
   void scroll(optional ScrollToOptions options);
   void scrollTo(unrestricted double x, unrestricted double y);
   void scrollTo(optional ScrollToOptions options);
   void scrollBy(unrestricted double x, unrestricted double y);
   void scrollBy(optional ScrollToOptions options);
   // mozScrollSnap is used by chrome to perform scroll snapping after the
   // user performs actions that may affect scroll position
   // mozScrollSnap is deprecated, to be replaced by a web accessible API, such
   // as an extension to the ScrollOptions dictionary.  See bug 1137937.
   [ChromeOnly] void mozScrollSnap();
+  // The four properties below are double per spec at the moment, but whether
+  // that will continue is unclear.
+  //[Replaceable, Throws] readonly attribute double scrollX;
+  //[Replaceable, Throws] readonly attribute double pageXOffset;
+  //[Replaceable, Throws] readonly attribute double scrollY;
+  //[Replaceable, Throws] readonly attribute double pageYOffset;
   [Replaceable, Throws] readonly attribute long scrollX;
-  [Throws] readonly attribute long pageXOffset;
+  [Replaceable, Throws] readonly attribute long pageXOffset;
   [Replaceable, Throws] readonly attribute long scrollY;
-  [Throws] readonly attribute long pageYOffset;
+  [Replaceable, Throws] readonly attribute long pageYOffset;
 
   // client
   //[Throws] readonly attribute double screenX;
   //[Throws] readonly attribute double screenY;
   //[Throws] readonly attribute double outerWidth;
   //[Throws] readonly attribute double outerHeight;
   [Throws] attribute long screenX;
   [Throws] attribute long screenY;
@@ -298,17 +302,17 @@ partial interface Window {
 
   // XXX Shouldn't this be in nsIDOMChromeWindow?
   [ChromeOnly, Replaceable, Throws] readonly attribute MozControllers controllers;
 
   [ChromeOnly, Throws] readonly attribute Element? realFrameElement;
 
   [Throws] readonly attribute float               mozInnerScreenX;
   [Throws] readonly attribute float               mozInnerScreenY;
-  [Throws] readonly attribute float               devicePixelRatio;
+  [Replaceable, Throws] readonly attribute float  devicePixelRatio;
 
   /* The maximum offset that the window can be scrolled to
      (i.e., the document width/height minus the scrollport width/height) */
   [Replaceable, Throws] readonly attribute long   scrollMaxX;
   [Replaceable, Throws] readonly attribute long   scrollMaxY;
 
   [Throws, UnsafeInPrerendering] attribute boolean            fullScreen;