Bug 1568298. Stop implementing JS-exposed QueryInterface on XMLHttpRequest. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 24 Jul 2019 08:50:41 +0000
changeset 483983 bc5db885345c3c661f4f949b4048660e4623fbf7
parent 483982 6823165abe1ca5241d9a0a26a5f46fc369bdc6dc
child 483984 b75aa012c84805187149f0ded5e70d575eed7c8f
push id36337
push usermalexandru@mozilla.com
push dateWed, 24 Jul 2019 16:07:15 +0000
treeherdermozilla-central@6598e37c88d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1568298
milestone70.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 1568298. Stop implementing JS-exposed QueryInterface on XMLHttpRequest. r=peterv Differential Revision: https://phabricator.services.mozilla.com/D39082
dom/webidl/LegacyQueryInterface.webidl
js/xpconnect/tests/chrome/test_wrappers.xul
js/xpconnect/tests/mochitest/chrome_wrappers_helper.html
--- a/dom/webidl/LegacyQueryInterface.webidl
+++ b/dom/webidl/LegacyQueryInterface.webidl
@@ -19,9 +19,8 @@ interface LegacyQueryInterface {
 Document implements LegacyQueryInterface;
 DocumentFragment implements LegacyQueryInterface;
 Element implements LegacyQueryInterface;
 Event implements LegacyQueryInterface;
 Selection implements LegacyQueryInterface;
 TreeColumns implements LegacyQueryInterface;
 TreeContentView implements LegacyQueryInterface;
 Window implements LegacyQueryInterface;
-XMLHttpRequest implements LegacyQueryInterface;
--- a/js/xpconnect/tests/chrome/test_wrappers.xul
+++ b/js/xpconnect/tests/chrome/test_wrappers.xul
@@ -69,22 +69,21 @@ https://bugzilla.mozilla.org/show_bug.cg
    is(win.XPathResult.NUMBER_TYPE, 1, "can access constants on constructors");
    is(typeof win.IDBKeyRange.bound, "function", "can access crazy IDBKeyRange static functions");
 
    // Test getter/setter lookup on Xray wrappers.
    ok(Object.prototype.__lookupGetter__.call(win.document, 'title'), 'found getter on document');
    ok(Object.prototype.__lookupGetter__.call(win.document, 'title'), 'found getter on document');
 
    // Test QI on new dom bindings.
-   var contentXHR = XPCNativeWrapper(win.wrappedJSObject.xhr);
    try {
-     var QIed = contentXHR.QueryInterface(Ci.nsIClassInfo);
+     var QIed = win.QueryInterface(Ci.nsIClassInfo);
      ok(false, "Should throw for new binding objects not having classinfo");
    } catch(e) {
-     ok(true, "Threw while QI-ing on wrapper");
+     is(e.name, "NS_NOINTERFACE", "Threw while QI-ing on wrapper");
    }
   }
 
   SimpleTest.waitForExplicitFinish();
 
   ]]></script>
   <iframe type="content"
           src="http://example.org/tests/js/xpconnect/tests/mochitest/chrome_wrappers_helper.html"
--- a/js/xpconnect/tests/mochitest/chrome_wrappers_helper.html
+++ b/js/xpconnect/tests/mochitest/chrome_wrappers_helper.html
@@ -16,15 +16,13 @@
                               "Content needs a same-compartment security wrappers around location");
 
                 ok(defprop1 === 1, "defprop1 exists");
                 window.defprop1 = 2;
                 ok(defprop1 === 2, "defprop1 is properly writable");
 
                 // defprop2 = {}; disabled because the test doesn't work
             }
-
-            window.xhr = new XMLHttpRequest();
         </script>
     </head>
     <body>
     </body>
 </html>