Backed out changeset d5fb33c4194e (bug 976920) for suspicion of causing mochitest-bc leaks.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 20 May 2014 13:18:30 -0400
changeset 192333 8b801635d8ce
parent 192328 26ba0b7f24ef
child 192334 7d980d9af355
child 192335 6737035e7d77
child 192337 19397c8f7c6e
push id3571
push userryanvm@gmail.com
push date2014-05-20 17:18 +0000
Treeherderresults
bugs976920
milestone30.0
backs outd5fb33c4194e
Backed out changeset d5fb33c4194e (bug 976920) for suspicion of causing mochitest-bc leaks.
CLOSED TREE
dom/base/test/test_window_cross_origin_props.html
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/bindings/test/test_treat_non_object_as_null.html
dom/imptests/failures/html/html/browsers/the-window-object/test_window-properties.html.json
dom/imptests/html/html/browsers/the-window-object/test_window-properties.html
--- a/dom/base/test/test_window_cross_origin_props.html
+++ b/dom/base/test/test_window_cross_origin_props.html
@@ -9,23 +9,21 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
 
   /** Test for Bug 946067 **/
   SimpleTest.waitForExplicitFinish();
 
   function doGet(prop, thisObj) {
-    return (Object.getOwnPropertyDescriptor(window, prop) ||
-            Object.getOwnPropertyDescriptor(Window.prototype, prop)).get.call(thisObj);
+    return Object.getOwnPropertyDescriptor(window, prop).get.call(thisObj);
   }
 
   function doSet(prop, thisObj, value) {
-    return (Object.getOwnPropertyDescriptor(window, prop) ||
-            Object.getOwnPropertyDescriptor(Window.prototype, prop)).set.call(thisObj, value);
+    return Object.getOwnPropertyDescriptor(window, prop).set.call(thisObj, value);
   }
 
   window.onload = function() {
     frames[0].focus();
     is(document.activeElement.id, "x", "Should have focused first subframe");
     frames[0].blur();
     window.focus.call(frames[1]);
     is(document.activeElement.id, "y", "Should have focused second subframe");
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -540,31 +540,29 @@ CreateInterfaceObject(JSContext* cx, JS:
 
   return constructor;
 }
 
 bool
 DefineWebIDLBindingPropertiesOnXPCObject(JSContext* cx,
                                          JS::Handle<JSObject*> obj,
                                          const NativeProperties* properties,
-                                         bool defineOnlyUnforgeableAttributes)
+                                         bool defineUnforgeableAttributes)
 {
-  if (!defineOnlyUnforgeableAttributes &&
-      properties->methods &&
+  if (properties->methods &&
       !DefinePrefable(cx, obj, properties->methods)) {
     return false;
   }
 
-  if (!defineOnlyUnforgeableAttributes &&
-      properties->attributes &&
+  if (properties->attributes &&
       !DefinePrefable(cx, obj, properties->attributes)) {
     return false;
   }
 
-  if (defineOnlyUnforgeableAttributes && properties->unforgeableAttributes &&
+  if (defineUnforgeableAttributes && properties->unforgeableAttributes &&
       !DefinePrefable(cx, obj, properties->unforgeableAttributes)) {
     return false;
   }
 
   return true;
 }
 
 static JSObject*
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -429,17 +429,17 @@ CreateInterfaceObjects(JSContext* cx, JS
 bool
 DefineUnforgeableAttributes(JSContext* cx, JS::Handle<JSObject*> obj,
                             const Prefable<const JSPropertySpec>* props);
 
 bool
 DefineWebIDLBindingPropertiesOnXPCObject(JSContext* cx,
                                          JS::Handle<JSObject*> obj,
                                          const NativeProperties* properties,
-                                         bool defineOnlyUnforgeableAttributes);
+                                         bool defineUnforgeableAttributes);
 
 #ifdef _MSC_VER
 #define HAS_MEMBER_CHECK(_name)                                           \
   template<typename V> static yes& Check(char (*)[(&V::_name == 0) + 1])
 #else
 #define HAS_MEMBER_CHECK(_name)                                           \
   template<typename V> static yes& Check(char (*)[sizeof(&V::_name) + 1])
 #endif
--- a/dom/bindings/test/test_treat_non_object_as_null.html
+++ b/dom/bindings/test/test_treat_non_object_as_null.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     
     (function() {
        onvolumechange = x;
        ise(onvolumechange, x,
            "Should preserve an object value when assigning to event handler");
        // Test that we don't try to actually call the non-callable object
        window.dispatchEvent(new Event("volumechange"));
        onvolumechange = 5;
-       ise(onvolumechange, 5,
+       ise(onvolumechange, null,
            "Non-object values should become null when assigning to event handler");
     })();
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=952365">Mozilla Bug 952365</a>
 <p id="display"></p>
 <div id="content" style="display: none">
--- 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,12 +1,35 @@
 {
   "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,
@@ -16,19 +39,98 @@
   "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
 }
--- a/dom/imptests/html/html/browsers/the-window-object/test_window-properties.html
+++ b/dom/imptests/html/html/browsers/the-window-object/test_window-properties.html
@@ -259,56 +259,55 @@ test(function() {
   });
 }, "EventTarget interface");
 test(function() {
   // Window interface
   methods.forEach(function(id) {
     test(function() {
       var WindowProto = Window.prototype;
       assert_true(id in window, id + " in window");
-      assert_true(id in WindowProto, id + " in Window.prototype");
-      assert_equals(window[id], WindowProto[id]);
-      assert_data_propdesc(Object.getOwnPropertyDescriptor(WindowProto, id),
+      assert_false(id in WindowProto, id + " in Window.prototype");
+      assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
                            true, true, true);
     }, "Window method: " + id);
   });
   readonlyAttributes.forEach(function(id) {
     test(function() {
       var WindowProto = Window.prototype;
       assert_true(id in window, id + " in window");
-      assert_true(id in WindowProto, id + " in Window.prototype");
-      assert_accessor_propdesc(Object.getOwnPropertyDescriptor(WindowProto, id),
+      assert_false(id in WindowProto, id + " in Window.prototype");
+      assert_accessor_propdesc(Object.getOwnPropertyDescriptor(window, id),
                                false, true, true);
     }, "Window readonly attribute: " + id);
   });
   writableAttributes.forEach(function(id) {
     test(function() {
       var WindowProto = Window.prototype;
       assert_true(id in window, id + " in window");
-      assert_true(id in WindowProto, id + " in Window.prototype");
-      assert_accessor_propdesc(Object.getOwnPropertyDescriptor(WindowProto, id),
+      assert_false(id in WindowProto, id + " in Window.prototype");
+      assert_accessor_propdesc(Object.getOwnPropertyDescriptor(window, id),
                                true, true, true);
     }, "Window attribute: " + id);
   });
   unforgeableAttributes.forEach(function(id) {
     test(function() {
       var WindowProto = Window.prototype;
       assert_true(id in window, id + " in window");
+      assert_false(id in WindowProto, id + " in Window.prototype");
       // location has a [PutForwards] extended attribute.
       assert_accessor_propdesc(Object.getOwnPropertyDescriptor(window, id),
                                id === "location", true, false);
-      assert_false(id in WindowProto, id + " in Window.prototype");
     }, "Window unforgeable attribute: " + id);
   });
   replacableAttributes.forEach(function(id) {
     test(function() {
       var WindowProto = Window.prototype;
       assert_true(id in window, id + " in window");
-      assert_true(id in WindowProto, id + " in Window.prototype");
-      assert_accessor_propdesc(Object.getOwnPropertyDescriptor(WindowProto, id),
+      assert_false(id in WindowProto, id + " in Window.prototype");
+      assert_accessor_propdesc(Object.getOwnPropertyDescriptor(window, id),
                                true, true, true);
     }, "Window replaceable attribute: " + id);
   });
 }, "Window interface");
 test(function() {
   assert_equals(window.constructor, Window);
   assert_false(window.hasOwnProperty("constructor"), "window.constructor should not be an own property.");
   assert_data_propdesc(Object.getOwnPropertyDescriptor(Window.prototype, "constructor"),