Enable WebIDL bindings for Window. default tip
authorPeter Van der Beken <peterv@propagandism.org>
Tue, 08 Apr 2014 20:48:37 +0200
changeset 181847 a0ac38f0d5b8
parent 181846 2a388ff19a0a
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
milestone32.0a1
Enable WebIDL bindings for Window.
dom/base/test/test_openDialogChromeOnly.html
dom/bindings/Bindings.conf
dom/imptests/failures/html/html/browsers/the-window-object/mochitest.ini
dom/imptests/failures/html/html/browsers/the-window-object/test_window-properties.html.json
dom/imptests/failures/html/html/browsers/the-window-object/test_window-prototype-chain.html.json
js/xpconnect/tests/mochitest/test_bug870423.html
modules/libpref/src/init/all.js
--- a/dom/base/test/test_openDialogChromeOnly.html
+++ b/dom/base/test/test_openDialogChromeOnly.html
@@ -11,21 +11,18 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript">
 
   /** Test for Bug 931768 **/
 
   try {
     openDialog("chrome://browser/content/browser.xul");
     ok(false, "Calling openDialog from unprivileged script should throw.");
   } catch (e) {
-    // FIXME e should be a ReferenceError once we switch Window to new WebIDL bindings
-    ok(e.name == "SecurityError",
-       "openDialog shouldn't be callable to unprivileged script.");
-    todo(e instanceof ReferenceError,
-         "openDialog shouldn't be available to unprivileged script.");
+    ok(e instanceof ReferenceError,
+       "openDialog shouldn't be available to unprivileged script.");
   }
 </script>
 </body>
 
 
   </script>
 </head>
 <body>
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -212,17 +212,16 @@ DOMInterfaces = {
 
 'CharacterData': {
     'nativeType': 'nsGenericDOMDataNode',
     'concrete': False
 },
 
 'ChromeWindow': {
     'concrete': False,
-    'register': False,
 },
 
 'ChromeWorker': {
     'headerFile': 'mozilla/dom/WorkerPrivate.h',
     'nativeType': 'mozilla::dom::workers::ChromeWorkerPrivate',
 },
 
 'Console': {
@@ -1511,17 +1510,16 @@ DOMInterfaces = {
     'headerFile': 'WebSocket.h',
 },
 
 'Window': {
     'nativeType': 'nsGlobalWindow',
     # When turning on Window, remember to drop the "'register': False"
     # from ChromeWindow.
     'hasXPConnectImpls': True,
-    'register': False,
     'binaryNames': {
         'postMessage': 'postMessageMoz',
     },
 },
 
 'WindowProxy': [
 {
     'nativeType': 'nsIDOMWindow',
--- a/dom/imptests/failures/html/html/browsers/the-window-object/mochitest.ini
+++ b/dom/imptests/failures/html/html/browsers/the-window-object/mochitest.ini
@@ -2,9 +2,8 @@
 [DEFAULT]
 support-files =
 
 
 [test_window-indexed-properties-strict.html.json]
 [test_window-named-properties.html.json]
 skip-if = true # bug 859075
 [test_window-properties.html.json]
-[test_window-prototype-chain.html.json]
--- a/dom/imptests/failures/html/html/browsers/the-window-object/test_window-properties.html.json
+++ b/dom/imptests/failures/html/html/browsers/the-window-object/test_window-properties.html.json
@@ -1,35 +1,12 @@
 {
   "EventTarget method: addEventListener": true,
   "EventTarget method: removeEventListener": true,
   "EventTarget method: dispatchEvent": true,
-  "Window method: close": true,
-  "Window method: stop": true,
-  "Window method: focus": true,
-  "Window method: blur": true,
-  "Window method: open": true,
-  "Window method: alert": true,
-  "Window method: confirm": true,
-  "Window method: prompt": true,
-  "Window method: print": true,
-  "Window method: showModalDialog": true,
-  "Window method: postMessage": true,
-  "Window method: btoa": true,
-  "Window method: atob": true,
-  "Window method: setTimeout": true,
-  "Window method: clearTimeout": true,
-  "Window method: setInterval": true,
-  "Window method: clearInterval": true,
-  "Window method: getSelection": true,
-  "Window method: getComputedStyle": true,
-  "Window method: matchMedia": true,
-  "Window method: scroll": true,
-  "Window method: scrollTo": true,
-  "Window method: scrollBy": true,
   "Window readonly attribute: history": true,
   "Window readonly attribute: parent": true,
   "Window readonly attribute: frameElement": true,
   "Window readonly attribute: navigator": true,
   "Window readonly attribute: external": true,
   "Window readonly attribute: applicationCache": true,
   "Window readonly attribute: sessionStorage": true,
   "Window readonly attribute: localStorage": true,
@@ -39,98 +16,17 @@
   "Window readonly attribute: scrollX": true,
   "Window readonly attribute: pageXOffset": true,
   "Window readonly attribute: scrollY": true,
   "Window readonly attribute: pageYOffset": true,
   "Window readonly attribute: screenX": true,
   "Window readonly attribute: screenY": true,
   "Window readonly attribute: outerWidth": true,
   "Window readonly attribute: outerHeight": true,
-  "Window attribute: name": true,
-  "Window attribute: status": true,
-  "Window attribute: opener": true,
-  "Window attribute: onabort": true,
-  "Window attribute: onafterprint": true,
-  "Window attribute: onbeforeprint": true,
-  "Window attribute: onbeforeunload": true,
-  "Window attribute: onblur": true,
-  "Window attribute: oncancel": true,
-  "Window attribute: oncanplay": true,
-  "Window attribute: oncanplaythrough": true,
-  "Window attribute: onchange": true,
-  "Window attribute: onclick": true,
-  "Window attribute: onclose": true,
-  "Window attribute: oncontextmenu": true,
-  "Window attribute: oncuechange": true,
-  "Window attribute: ondblclick": true,
-  "Window attribute: ondrag": true,
-  "Window attribute: ondragend": true,
-  "Window attribute: ondragenter": true,
-  "Window attribute: ondragleave": true,
-  "Window attribute: ondragover": true,
-  "Window attribute: ondragstart": true,
-  "Window attribute: ondrop": true,
-  "Window attribute: ondurationchange": true,
-  "Window attribute: onemptied": true,
-  "Window attribute: onended": true,
-  "Window attribute: onerror": true,
-  "Window attribute: onfocus": true,
-  "Window attribute: onhashchange": true,
-  "Window attribute: oninput": true,
-  "Window attribute: oninvalid": true,
-  "Window attribute: onkeydown": true,
-  "Window attribute: onkeypress": true,
-  "Window attribute: onkeyup": true,
   "Window attribute: oncancel": true,
   "Window attribute: onclose": true,
   "Window attribute: oncuechange": true,
   "Window attribute: onmousewheel": true,
-  "Window attribute: onload": true,
-  "Window attribute: onloadeddata": true,
-  "Window attribute: onloadedmetadata": true,
-  "Window attribute: onloadstart": true,
-  "Window attribute: onmessage": true,
-  "Window attribute: onmousedown": true,
-  "Window attribute: onmousemove": true,
-  "Window attribute: onmouseout": true,
-  "Window attribute: onmouseover": true,
-  "Window attribute: onmouseup": true,
-  "Window attribute: onmousewheel": true,
-  "Window attribute: onoffline": true,
-  "Window attribute: ononline": true,
-  "Window attribute: onpause": true,
-  "Window attribute: onplay": true,
-  "Window attribute: onplaying": true,
-  "Window attribute: onpagehide": true,
-  "Window attribute: onpageshow": true,
-  "Window attribute: onpopstate": true,
-  "Window attribute: onprogress": true,
-  "Window attribute: onratechange": true,
-  "Window attribute: onreset": true,
-  "Window attribute: onresize": true,
-  "Window attribute: onscroll": true,
-  "Window attribute: onseeked": true,
-  "Window attribute: onseeking": true,
-  "Window attribute: onselect": true,
-  "Window attribute: onshow": true,
-  "Window attribute: onstalled": true,
   "Window attribute: onstorage": true,
-  "Window attribute: onsubmit": true,
-  "Window attribute: onsuspend": true,
-  "Window attribute: ontimeupdate": true,
-  "Window attribute: onunload": true,
-  "Window attribute: onvolumechange": true,
-  "Window attribute: onwaiting": true,
   "Window unforgeable attribute: window": true,
   "Window unforgeable attribute: document": true,
-  "Window unforgeable attribute: location": true,
-  "Window unforgeable attribute: top": true,
-  "Window replaceable attribute: self": true,
-  "Window replaceable attribute: locationbar": true,
-  "Window replaceable attribute: menubar": true,
-  "Window replaceable attribute: personalbar": true,
-  "Window replaceable attribute: scrollbars": true,
-  "Window replaceable attribute: statusbar": true,
-  "Window replaceable attribute: toolbar": true,
-  "Window replaceable attribute: frames": true,
-  "Window replaceable attribute: length": true,
-  "constructor": true
+  "Window unforgeable attribute: top": true
 }
deleted file mode 100644
--- a/dom/imptests/failures/html/html/browsers/the-window-object/test_window-prototype-chain.html.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "Window.prototype": true,
-  "EventTarget.prototype": true,
-  "Object.prototype": true
-}
--- a/js/xpconnect/tests/mochitest/test_bug870423.html
+++ b/js/xpconnect/tests/mochitest/test_bug870423.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     var sowin = $('soifr').contentWindow;
     var xowin = $('xoifr').contentWindow;
 
     check(window, sowin, 'HTMLBodyElement', function(win) { return win.document.body; });
     check(window, sowin, 'HTMLDocument', function(win) { return win.document; });
     check(window, sowin, 'Window', function(win) { return win; });
     check(window, sowin, 'Location', function(win) { return win.location; });
 
-    todo(xowin instanceof Window, "Cross-origin instanceof should work");
+    ok(xowin instanceof Window, "Cross-origin instanceof should work");
     todo(xowin.location instanceof Location, "Cross-origin instanceof should work");
 
     SimpleTest.finish();
   }
 
   function check(win1, win2, constructorName, getInstance) {
     ok(getInstance(win1) instanceof win2[constructorName],
        "Cross-Scope instanceof works: " + constructorName + ", " + win1.location + ", " + win2.location);
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -749,17 +749,17 @@ pref("dom.forms.color", true);
 // Enables system messages and activities
 pref("dom.sysmsg.enabled", false);
 
 // Enable pre-installed applications.
 pref("dom.webapps.useCurrentProfile", false);
 
 pref("dom.cycle_collector.incremental", true);
 
-pref("dom.window_experimental_bindings", false);
+pref("dom.window_experimental_bindings", true);
 
 // Parsing perf prefs. For now just mimic what the old code did.
 #ifndef XP_WIN
 pref("content.sink.pending_event_mode", 0);
 #endif
 
 // Disable popups from plugins by default
 //   0 = openAllowed