Bug 1577746 - Automatically enable more ESLint rules for dom/. r=baku
authorMark Banner <standard8@mozilla.com>
Mon, 02 Sep 2019 11:23:26 +0000
changeset 491159 8459bff03c9544c8ad7dbe396fa66909635fec50
parent 491158 0c1543381629aae163598a82d706b3426e73928b
child 491160 3894056d2410f4820d1749d46d84d0a884741e82
push id94247
push usermbanner@mozilla.com
push dateMon, 02 Sep 2019 12:27:35 +0000
treeherderautoland@8459bff03c95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1577746
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 1577746 - Automatically enable more ESLint rules for dom/. r=baku This enables: - mozilla/no-useless-parameters - mozilla/no-useless-run-test - no-extra-boolean-cast - no-unneeded-ternary Depends on D44150 Differential Revision: https://phabricator.services.mozilla.com/D44151
.eslintrc.js
dom/base/test/test_bug1222633.html
dom/base/test/test_bug28293.xhtml
dom/base/test/test_bug339494.xhtml
dom/base/test/test_bug435425.html
dom/base/test/test_bug560780.html
dom/base/test/test_reentrant_flush.html
dom/events/test/pointerevents/mochitest_support_external.js
dom/events/test/pointerevents/test_bug1420589_1.html
dom/events/test/pointerevents/test_bug1420589_2.html
dom/events/test/pointerevents/test_bug1420589_3.html
dom/events/test/test_bug574663.html
dom/events/test/test_bug822898.html
dom/html/test/forms/test_input_date_bad_input.html
dom/html/test/test_bug458037.xhtml
dom/html/test/test_bug500885.html
dom/quota/test/unit/test_storagePressure.js
dom/security/test/csp/test_bug1452037.html
dom/security/test/csp/test_iframe_srcdoc.html
dom/security/test/csp/test_upgrade_insecure_navigation.html
dom/smil/test/file_smilWithTransition.html
dom/tests/mochitest/bugs/test_DOMWindowCreated_chromeonly.html
dom/tests/mochitest/dom-level0/child_ip_address.html
dom/tests/mochitest/dom-level0/idn_child.html
dom/tests/mochitest/dom-level0/test_setting_document.domain_idn.html
dom/tests/mochitest/dom-level0/test_setting_document.domain_to_shortened_ipaddr.html
dom/tests/mochitest/general/test_interfaces.js
dom/tests/mochitest/webcomponents/test_detached_style.html
dom/tests/mochitest/webcomponents/test_shadowroot_style.html
dom/tests/mochitest/webcomponents/test_style_fallback_content.html
dom/tests/mochitest/whatwg/test_postMessage_idn.xhtml
dom/workers/test/test_worker_interfaces.js
dom/workers/test/xpcshell/test_fileReader.js
dom/workers/test/xpcshell/test_workers.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -258,34 +258,31 @@ module.exports = {
     ],
     "rules": {
       "consistent-return": "off",
       "mozilla/avoid-removeChild": "off",
       "mozilla/consistent-if-bracing": "off",
       "mozilla/no-arbitrary-setTimeout": "off",
       "mozilla/no-compare-against-boolean-literals": "off",
       "mozilla/no-define-cc-etc": "off",
-      "mozilla/no-useless-parameters": "off",
-      "mozilla/no-useless-run-test": "off",
       "mozilla/reject-importGlobalProperties": "off",
       "mozilla/use-cc-etc": "off",
       "mozilla/use-chromeutils-generateqi": "off",
       "mozilla/use-chromeutils-import": "off",
       "mozilla/use-includes-instead-of-indexOf": "off",
       "mozilla/use-ownerGlobal": "off",
       "mozilla/use-services": "off",
       "no-array-constructor": "off",
       "no-caller": "off",
       "no-cond-assign": "off",
       "no-control-regex": "off",
       "no-debugger": "off",
       "no-else-return": "off",
       "no-empty": "off",
       "no-eval": "off",
-      "no-extra-boolean-cast": "off",
       "no-func-assign": "off",
       "no-global-assign": "off",
       "no-implied-eval": "off",
       "no-lone-blocks": "off",
       "no-lonely-if": "off",
       "no-nested-ternary": "off",
       "no-new-object": "off",
       "no-new-wrappers": "off",
@@ -295,17 +292,16 @@ module.exports = {
       "no-restricted-globals": "off",
       "no-self-assign": "off",
       "no-self-compare": "off",
       "no-sequences": "off",
       "no-shadow": "off",
       "no-shadow-restricted-names": "off",
       "no-sparse-arrays": "off",
       "no-throw-literal": "off",
-      "no-unneeded-ternary": "off",
       "no-unreachable": "off",
       "no-unsanitized/method": "off",
       "no-unsanitized/property": "off",
       "no-undef": "off",
       "no-unused-vars": "off",
       "no-useless-call": "off",
       "no-useless-concat": "off",
       "no-useless-return": "off",
--- a/dom/base/test/test_bug1222633.html
+++ b/dom/base/test/test_bug1222633.html
@@ -49,17 +49,17 @@ function testCancelPreloadNotCrash(url) 
   var link = document.createElement("LINK");
   link.setAttribute("rel", "preload");
   link.setAttribute("href", url);
   link.setAttribute("as", "fetch");
   document.head.appendChild(link);
 
   // Not actually verifying any value, just to ensure cancelPrefetchPreload
   // won't cause crash.
-  prefetch.cancelPrefetchPreloadURI(ios.newURI(url, null, null), link);
+  prefetch.cancelPrefetchPreloadURI(ios.newURI(url), link);
 }
 
 function testChangePrefetchToPreload(url) {
   return new Promise((resolve) => {
     var preloaded = false;
     var link = document.createElement("LINK");
     link.setAttribute("rel", "prefetch");
     link.setAttribute("href", url);
--- a/dom/base/test/test_bug28293.xhtml
+++ b/dom/base/test/test_bug28293.xhtml
@@ -61,17 +61,17 @@ res += 'E';
 </script>
 <script>
 res += 'F';
 document.addEventListener("DOMContentLoaded", function() {
   res += '1'
   s = document.createElement('script');
   s.src="file_bug28293.sjs?res+='M';";
   document.body.appendChild(s);
-}, false);
+});
 res += 'G';
 </script>
 <script defer="defer">
 res += 'e';
 </script>
 <script src="file_bug28293.sjs?res+='H';"></script>
 <script>
 <![CDATA[
--- a/dom/base/test/test_bug339494.xhtml
+++ b/dom/base/test/test_bug339494.xhtml
@@ -18,36 +18,36 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 339494 **/
 
   var d = document.getElementById("d");
 
   d.setAttribute("hhh", "testvalue");
 
-  document.addEventListener("DOMAttrModified", removeItAgain, false);
+  document.addEventListener("DOMAttrModified", removeItAgain);
   d.removeAttribute("hhh");
-  document.removeEventListener("DOMAttrModified", removeItAgain, false);
+  document.removeEventListener("DOMAttrModified", removeItAgain);
 
   function removeItAgain()
   {
     ok(!d.hasAttribute("hhh"), "Value check 1, there should be no value");
     isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
-    document.removeEventListener("DOMAttrModified", removeItAgain, false);
+    document.removeEventListener("DOMAttrModified", removeItAgain);
     d.removeAttribute("hhh");
     ok(true, "Reachability, We shouldn't have crashed");
   }
 
   var s = document.getElementById("s");
 
   s.setAttribute("ggg", "testvalue");
 
-  document.addEventListener("DOMAttrModified", compareVal, false);
+  document.addEventListener("DOMAttrModified", compareVal);
   s.setAttribute("ggg", "othervalue");
-  document.removeEventListener("DOMAttrModified", compareVal, false);
+  document.removeEventListener("DOMAttrModified", compareVal);
 
   function compareVal()
   {
     ok(s.hasAttribute("ggg"), "Value check 3, there should be a value");
     isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
     is(s.getAttribute("ggg"), "othervalue", "Value check 5");
   }
 
--- a/dom/base/test/test_bug435425.html
+++ b/dom/base/test/test_bug435425.html
@@ -34,17 +34,17 @@ function logEvent(evt) {
     ++i;
   }
 
   if (evt.target instanceof XMLHttpRequestUpload) {
     if (evt.type == "loadstart") {
       uploadTotal = evt.total
     } else {
       if (evt.type == "progress") {
-        is(evt.lengthComputable, evt.total != 0, "event(" + evt.type +  ").lengthComputable should be " + (evt.total != 0 ? true : false) + ".");
+        is(evt.lengthComputable, evt.total != 0, "event(" + evt.type +  ").lengthComputable should be " + (evt.total != 0) + ".");
       }
       if (evt.total != uploadTotal && evt.total != 0) {
         ok(false, "event(" + evt.type +  ").total should not change during upload except to become 0 on error/abort/timeout.");
       }
     }
   }
 
   // There can be any number of repeated progress events, so special-case this.
--- a/dom/base/test/test_bug560780.html
+++ b/dom/base/test/test_bug560780.html
@@ -45,17 +45,17 @@ function mousedown(event) {
   5.Repeat STEP 2 to 4 till browser crashes. (at least 5 times)
 
 <script type="application/javascript">
 
 /** Test for Bug 560780 **/
 
 function selectByMouseThenClick(elm,startx,starty) {
   // select some text
-  var ctrl = navigator.platform.indexOf("Linux") ? true : false;
+  var ctrl = !!navigator.platform.indexOf("Linux");
   var alt  = true;
   var x = startx;
   synthesizeMouse(elm, x,        starty, { type:"mousedown", ctrlKey:ctrl, altKey:alt }); 
   synthesizeMouse(elm, x += 100, starty, { type:"mousemove", ctrlKey:ctrl, altKey:alt });
   synthesizeMouse(elm, x += 100, starty, { type:"mousemove", ctrlKey:ctrl, altKey:alt });
   synthesizeMouse(elm, x += 100, starty, { type:"mousemove", ctrlKey:ctrl, altKey:alt });
   synthesizeMouse(elm, x += 100, starty, { type:"mousemove", ctrlKey:ctrl, altKey:alt });
   synthesizeMouse(elm, x += 100, starty, { type:"mousemove", ctrlKey:ctrl, altKey:alt });
--- a/dom/base/test/test_reentrant_flush.html
+++ b/dom/base/test/test_reentrant_flush.html
@@ -45,16 +45,16 @@ addLoadEvent(function() {
 
   is(resizeHandlerRan, false,
      "Resize handler should not have run yet for this test to be valid");
 
   // Now flush out layout on the subdocument, to trigger the resize handler
   is(bod.getBoundingClientRect().width, 50, "Width of body should still be 50px");
   window.requestAnimationFrame(function() {
     is(resizeHandlerRan, true, "Resize handler should have run");
-    win.removeEventListener("resize", handleResize, false);
+    win.removeEventListener("resize", handleResize);
     SimpleTest.finish();
   });
 });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/events/test/pointerevents/mochitest_support_external.js
+++ b/dom/events/test/pointerevents/mochitest_support_external.js
@@ -184,17 +184,17 @@ var TouchEventHelper = {
   },
 };
 
 // Helper function to send TouchEvent with different parameters
 // TODO: Support multiple touch points to test more features such as
 // PointerEvent.isPrimary and pinch-zoom.
 function sendTouchEvent(int_win, elemId, touchEventType, params) {
   var elem = int_win.document.getElementById(elemId);
-  if (!!elem) {
+  if (elem) {
     var rect = elem.getBoundingClientRect();
     var eventObj = {
       type: touchEventType,
       id: TouchEventHelper.TOUCH_ID,
     };
 
     // Update touch state
     switch (touchEventType) {
--- a/dom/events/test/pointerevents/test_bug1420589_1.html
+++ b/dom/events/test/pointerevents/test_bug1420589_1.html
@@ -61,17 +61,17 @@ function withoutImplicitlyPointerCapture
 
   window.addEventListener('message',function(e) {
     ok(expectedEvents.includes(e.data), " don't expect " + e.data);
     expectedEvents = expectedEvents.filter(item => item !== e.data);
     if (e.data == "iframe2 touchend") {
       ok(expectedEvents.length == 0, " expect " + expectedEvents);
       SimpleTest.finish();
     }
-  }, false)
+  })
 
   let iframe1 = document.getElementById('iframe1');
   let iframe2 = document.getElementById('iframe2');
 
   let rect1 = iframe1.getBoundingClientRect();
   let rect2 = iframe2.getBoundingClientRect();
 
   let left1 = rect1.left + 5;
--- a/dom/events/test/pointerevents/test_bug1420589_2.html
+++ b/dom/events/test/pointerevents/test_bug1420589_2.html
@@ -64,17 +64,17 @@ function withoutImplicitlyPointerCapture
 
   window.addEventListener('message',function(e) {
     ok(expectedEvents.includes(e.data), " don't expect " + e.data);
     expectedEvents = expectedEvents.filter(item => item !== e.data);
     if (e.data == "div1 touchend") {
       ok(expectedEvents.length == 0, " expect " + expectedEvents);
       SimpleTest.finish();
     }
-  }, false)
+  })
 
   let iframe1 = document.getElementById('iframe1');
   let div1 = document.getElementById('div1');
 
   let events = ["touchstart", "touchmove", "touchend", "pointerdown", "pointermove", "pointerup"];
   events.forEach((event) => {
     div1.addEventListener(event, (e) => {
       postMessage("div1 " + e.type, "*");
--- a/dom/events/test/pointerevents/test_bug1420589_3.html
+++ b/dom/events/test/pointerevents/test_bug1420589_3.html
@@ -57,17 +57,17 @@ function withoutImplicitlyPointerCapture
 
   window.addEventListener('message',function(e) {
     ok(expectedEvents.includes(e.data), " don't expect " + e.data);
     expectedEvents = expectedEvents.filter(item => item !== e.data);
     if (e.data == "iframe1 touchend") {
       ok(expectedEvents.length == 0, " expect " + expectedEvents);
       SimpleTest.finish();
     }
-  }, false)
+  })
 
   let iframe1 = document.getElementById('iframe1');
   let div1 = document.getElementById('div1');
 
   let events = ["touchstart", "touchmove", "touchend", "pointerdown", "pointermove", "pointerup"];
   events.forEach((event) => {
     div1.addEventListener(event, (e) => {
       postMessage("div1 " + e.type, "*");
--- a/dom/events/test/test_bug574663.html
+++ b/dom/events/test/test_bug574663.html
@@ -49,17 +49,17 @@ function waitForPaint(win, utils, callba
 
 function forceScrollAndWait(scrollbox, callback) {
   let win = scrollbox.ownerDocument.defaultView;
   let utils = SpecialPowers.getDOMWindowUtils(win);
 
   utils.advanceTimeAndRefresh(1000);
 
   let postApzFlush = function() {
-    SpecialPowers.Services.obs.removeObserver(postApzFlush, "apz-repaints-flushed", false);
+    SpecialPowers.Services.obs.removeObserver(postApzFlush, "apz-repaints-flushed");
     waitForPaint(win, utils, callback);
   }
   SpecialPowers.Services.obs.addObserver(postApzFlush, "apz-repaints-flushed");
   if (!utils.flushApzRepaints()) {
     postApzFlush();
   }
 }
 
--- a/dom/events/test/test_bug822898.html
+++ b/dom/events/test/test_bug822898.html
@@ -32,20 +32,20 @@ function random() {
 
 function createTestEventValue(name) {
 
   let detail = random();
   let screenX = random();
   let screenY = random();
   let clientX = random();
   let clientY = random();
-  let ctrlKey = random() % 2 ? true : false;
-  let altKey = random() % 2 ? true : false;
-  let shiftKey = random() % 2 ? true : false;
-  let metaKey = random() % 2 ? true : false;
+  let ctrlKey = !!(random() % 2);
+  let altKey = !!(random() % 2);
+  let shiftKey = !!(random() % 2);
+  let metaKey = !!(random() % 2);
   let button = random();
   let pointerId = random();
 
   return function() {
     let event = new PointerEvent("pointerdown", {
       bubbles: true, cancelable: true, view: window,
       detail, screenX, screenY, clientX, clientY,
       ctrlKey, altKey, shiftKey, metaKey,
--- a/dom/html/test/forms/test_input_date_bad_input.html
+++ b/dom/html/test/forms/test_input_date_bad_input.html
@@ -35,19 +35,19 @@ SimpleTest.waitForFocus(function() {
     SimpleTest.finish();
   });
 });
 
 const DATE_BAD_INPUT_MSG = "Please enter a valid date.";
 const isDesktop = !/Mobile|Tablet/.test(navigator.userAgent);
 
 function checkValidity(aElement, aIsBadInput) {
-  is(aElement.validity.valid, aIsBadInput ? false : true,
+  is(aElement.validity.valid, !aIsBadInput,
      "validity.valid should be " + (aIsBadInput ? "false" : "true"));
-  is(aElement.validity.badInput, aIsBadInput ? true : false,
+  is(aElement.validity.badInput, !!aIsBadInput,
      "validity.badInput should be " + (aIsBadInput ? "true" : "false"));
   is(aElement.validationMessage, aIsBadInput ? DATE_BAD_INPUT_MSG : "",
      "validationMessage should be: " + (aIsBadInput ? DATE_BAD_INPUT_MSG : ""));
 
   is(window.getComputedStyle(aElement).getPropertyValue('background-color'),
      aIsBadInput ? "rgb(255, 0, 0)" : "rgb(0, 255, 0)",
      (aIsBadInput ? ":invalid" : "valid") + " pseudo-classs should apply");
 }
--- a/dom/html/test/test_bug458037.xhtml
+++ b/dom/html/test/test_bug458037.xhtml
@@ -98,15 +98,15 @@ document.addEventListener("DOMContentLoa
   test("x", false);
   d.contentEditable = "inherit";
   test("x", false);
 
   // Make sure that isContentEditable is read-only
   var origValue = d.isContentEditable;
   d.isContentEditable = !origValue;
   is(d.isContentEditable, origValue, "isContentEditable should be read only");
-}, false);
+});
 
 </script>
 </pre>
 </body>
 </html>
 
--- a/dom/html/test/test_bug500885.html
+++ b/dom/html/test/test_bug500885.html
@@ -29,17 +29,17 @@ function test() {
     var domActivateEvents;
     var fileInput = document.getElementById("file");
     var rect = fileInput.getBoundingClientRect();
 
     fileInput.addEventListener ("DOMActivate", function (e) {
       ok("detail" in e, "DOMActivate should have .detail");
       is(e.detail, 1, ".detail should be 1");
       domActivateEvents++;
-    }, false);
+    });
 
     domActivateEvents = 0;
     wu.sendMouseEvent("mousedown", rect.left + 5, rect.top + 5, 0, 1, 0);
     wu.sendMouseEvent("mouseup", rect.left + 5, rect.top + 5, 0, 1, 0);
     is(domActivateEvents, 1, "click on button should fire 1 DOMActivate event");
 
     domActivateEvents = 0;
     wu.sendMouseEvent("mousedown", rect.right - 5, rect.top + 5, 0, 1, 0);
--- a/dom/quota/test/unit/test_storagePressure.js
+++ b/dom/quota/test/unit/test_storagePressure.js
@@ -14,17 +14,17 @@ function awaitStoragePressure() {
     ok(true, "Got the storage pressure event");
 
     Services.obs.removeObserver(observer, topic);
 
     let usage = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
     promise_resolve(usage);
   }
 
-  Services.obs.addObserver(observer, "QuotaManager::StoragePressure", false);
+  Services.obs.addObserver(observer, "QuotaManager::StoragePressure");
 
   return promise;
 }
 
 /**
  * This test is mainly to verify that the storage pressure event is fired when
  * the eviction process is not able to free some space when a quota client
  * attempts to write over the global limit or when the global limit is reduced
--- a/dom/security/test/csp/test_bug1452037.html
+++ b/dom/security/test/csp/test_bug1452037.html
@@ -13,17 +13,17 @@
     SimpleTest.requestCompleteLog();
     SimpleTest.waitForExplicitFinish();
 
     let frame = document.querySelector("iframe");
     
     window.addEventListener("message", (msg)=>{
         ok(false, "The CSP did not block javascript:uri");
           SimpleTest.finish();
-    }, false);
+    });
 
     document.addEventListener("securitypolicyviolation",()=>{
         ok(true, "The CSP did block javascript:uri");
         SimpleTest.finish();
     });
     
     frame.addEventListener("load",()=>{
     let link = frame.contentWindow.document.querySelector("a");
--- a/dom/security/test/csp/test_iframe_srcdoc.html
+++ b/dom/security/test/csp/test_iframe_srcdoc.html
@@ -69,22 +69,22 @@ var tests = [
   },
 
 ];
 
 // initializing to -1 so we start at index 0 when we start the test
 var counter = -1;
 
 function finishTest() {
-  window.removeEventListener("message", receiveMessage, false);
+  window.removeEventListener("message", receiveMessage);
   window.examiner.remove();
   SimpleTest.finish();
 }
 
-window.addEventListener("message", receiveMessage, false);
+window.addEventListener("message", receiveMessage);
 function receiveMessage(event) {
   var result = event.data.result;
   testComplete(result, tests[counter].result, tests[counter].desc);
 }
 
 function examiner() {
   SpecialPowers.addObserver(this, "csp-on-violate-policy");
 }
--- a/dom/security/test/csp/test_upgrade_insecure_navigation.html
+++ b/dom/security/test/csp/test_upgrade_insecure_navigation.html
@@ -49,23 +49,23 @@ var tests = [
     desc: "No upgrade-insecure-requests cross origin should not upgrade"
   },
 ];
 
 // initializing to -1 so we start at index 0 when we start the test
 var counter = -1;
 
 function finishTest() {
-  window.removeEventListener("message", receiveMessage, false);
+  window.removeEventListener("message", receiveMessage);
   SimpleTest.finish();
 }
 
 var subtests = 0;
 
-window.addEventListener("message", receiveMessage, false);
+window.addEventListener("message", receiveMessage);
 function receiveMessage(event) {
   var result = event.data.result;
   // query the scheme from the URL before comparing the result
   var scheme = result.substring(0, result.indexOf(":"));
   is(scheme, tests[counter].result, tests[counter].desc);
 
   // @hardcoded 4:
   // each test run contains of two subtests (frame and top-level)
--- a/dom/smil/test/file_smilWithTransition.html
+++ b/dom/smil/test/file_smilWithTransition.html
@@ -24,17 +24,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     var ok = opener.ok.bind(opener);
     function finish() {
       var o = opener;
       self.close();
       o.SimpleTest.finish();
     }
   }
 
-  window.addEventListener('load', runTests, false);
+  window.addEventListener('load', runTests);
 
   var rect = document.getElementById('rect');
   var svg = document.getElementsByTagName('svg')[0];
   is(getComputedStyle(rect).fill, 'rgb(255, 0, 0)',
      'The initial color should be red.');
 
   function runTests() {
     waitForFrame().then(function() {
--- a/dom/tests/mochitest/bugs/test_DOMWindowCreated_chromeonly.html
+++ b/dom/tests/mochitest/bugs/test_DOMWindowCreated_chromeonly.html
@@ -3,13 +3,13 @@
   <title>DOMWindowCreated not visible in content</title>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 <body onload="ok(true, 'Test finished'); SimpleTest.finish();">
   <p id="display"></p>
 
   <script type="application/javascript">
   SimpleTest.waitForExplicitFinish();
-  window.addEventListener("DOMWindowCreated", function() { ok(false, "DOMWindowCreated should not have fired"); }, false);
-  window.addEventListener("DOMDocElementInserted", function() { ok(false, "DOMDocElementInserted should not have fired"); }, false);
+  window.addEventListener("DOMWindowCreated", function() { ok(false, "DOMWindowCreated should not have fired"); });
+  window.addEventListener("DOMDocElementInserted", function() { ok(false, "DOMDocElementInserted should not have fired"); });
   </script>
 
   <iframe src="data:text/plain,Hi"></iframe>
--- a/dom/tests/mochitest/dom-level0/child_ip_address.html
+++ b/dom/tests/mochitest/dom-level0/child_ip_address.html
@@ -25,15 +25,15 @@ function run()
     domain = document.domain;
     if (domain !== "127.0.0.1")
       message += " ip-address-mutated-on-throw(" + domain + ")";
   }
 
   window.parent.postMessage(message, "http://mochi.test:8888");
 }
 
-window.addEventListener("load", run, false);
+window.addEventListener("load", run);
   </script>
 </head>
 <body>
 <h1 id="location">Somewhere!</h1>
 </body>
 </html>
--- a/dom/tests/mochitest/dom-level0/idn_child.html
+++ b/dom/tests/mochitest/dom-level0/idn_child.html
@@ -86,16 +86,16 @@ function punycodeTest(newDomain)
   catch (e)
   {
     errors += " error-thrown-setting-to-punycode(" + String(e).split("").join(",") + ")";
   }
 
   return errors;
 }
 
-window.addEventListener("message", receiveMessage, false);
-window.addEventListener("load", run, false);
+window.addEventListener("message", receiveMessage);
+window.addEventListener("load", run);
   </script>
 </head>
 <body>
 <h1 id="location">Somewhere!</h1>
 </body>
 </html>
--- a/dom/tests/mochitest/dom-level0/test_setting_document.domain_idn.html
+++ b/dom/tests/mochitest/dom-level0/test_setting_document.domain_idn.html
@@ -198,14 +198,14 @@ function run()
             }, 0);
           }, 0);
         }, 0);
       }, 0);
     }, 0);
   }, 0);
 }
 
-window.addEventListener("message", receiveMessage, false);
-window.addEventListener("load", run, false);
+window.addEventListener("message", receiveMessage);
+window.addEventListener("load", run);
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/dom-level0/test_setting_document.domain_to_shortened_ipaddr.html
+++ b/dom/tests/mochitest/dom-level0/test_setting_document.domain_to_shortened_ipaddr.html
@@ -22,17 +22,17 @@ function receiveMessage(evt)
 {
   is(evt.origin, "http://127.0.0.1:8888", "wrong sender");
   ok(evt.source === window.frames.child, "wrong sender");
 
   is(evt.data, "child-response", "got wrong response");
 
   SimpleTest.finish();
 }
-window.addEventListener("message", receiveMessage, false);
+window.addEventListener("message", receiveMessage);
 
 // By default, proxies don't apply to 127.0.0.1.
 // We need them to for this test (at least on android), though:
 SpecialPowers.pushPrefEnv({set: [
   ["network.proxy.allow_hijacking_localhost", true]
 ]}).then(function() {
   var iframe = document.getElementById("childframe");
   iframe.src = "http://127.0.0.1:8888/tests/dom/tests/mochitest/dom-level0/child_ip_address.html";
--- a/dom/tests/mochitest/general/test_interfaces.js
+++ b/dom/tests/mochitest/general/test_interfaces.js
@@ -1422,17 +1422,17 @@ function createInterfaceMap() {
           entry.releaseNonWindowsAndMac ===
             !(isRelease && !isWindows && !isMac) ||
           entry.releaseNonWindows === !(isRelease && !isWindows) ||
           // The insecureContext test is very purposefully converting
           // entry.insecureContext to boolean, so undefined will convert to
           // false.  That way entries without an insecureContext annotation
           // will get treated as "insecureContext: false", which means exposed
           // only in secure contexts.
-          (isInsecureContext && !Boolean(entry.insecureContext)) ||
+          (isInsecureContext && !entry.insecureContext) ||
           entry.disabled
         ) {
           interfaceMap[entry.name] = false;
         } else {
           interfaceMap[entry.name] = true;
         }
       }
     }
--- a/dom/tests/mochitest/webcomponents/test_detached_style.html
+++ b/dom/tests/mochitest/webcomponents/test_detached_style.html
@@ -21,15 +21,15 @@ createIframe(content)
     var host = aDocument.createElement("div");
     var shadow = host.attachShadow({mode: "open"});
     shadow.innerHTML = '<style> #inner { height: 200px; } </style><div id="inner">Hello</div>';
 
     var iframeWin = aDocument.defaultView;
     iframeWin.grabme.appendChild(host);
 
     var inner = shadow.getElementById("inner");
-    is(iframeWin.getComputedStyle(inner, null).getPropertyValue("height"), "200px", "Style in shadow root should take effect.");
+    is(iframeWin.getComputedStyle(inner).getPropertyValue("height"), "200px", "Style in shadow root should take effect.");
 
     SimpleTest.finish();
   });
 </script>
 </body>
 </html>
--- a/dom/tests/mochitest/webcomponents/test_shadowroot_style.html
+++ b/dom/tests/mochitest/webcomponents/test_shadowroot_style.html
@@ -46,40 +46,40 @@ createIframe(content)
     root.appendChild(dummyStyle);
     is(root.styleSheets.length, 2, "ShadowRoot should have an additional style from appending dummyStyle.");
     is(root.styleSheets[1].ownerNode, dummyStyle, "Second style in ShadowRoot should be the dummyStyle.");
     root.removeChild(dummyStyle);
     is(root.styleSheets.length, 1, "Removing dummyStyle should remove it from the ShadowRoot style sheets.");
     is(root.styleSheets[0].ownerNode, shadowStyle, "The style sheet remaining in the ShadowRoot should be shadowStyle.");
 
     // Make sure that elements outside of the ShadowRoot are not affected by the ShadowRoot style.
-    isnot(iframeWin.getComputedStyle(aDocument.getElementById("bodydiv"), null).getPropertyValue("height"), "100px", "Style sheets in ShadowRoot should not apply to elements no in the ShadowRoot.");
+    isnot(iframeWin.getComputedStyle(aDocument.getElementById("bodydiv")).getPropertyValue("height"), "100px", "Style sheets in ShadowRoot should not apply to elements no in the ShadowRoot.");
 
     // Make sure that elements in the ShadowRoot are styled according to the ShadowRoot style.
-    is(iframeWin.getComputedStyle(divToStyle, null).getPropertyValue("height"), "100px", "ShadowRoot style sheets should apply to elements in ShadowRoot.");
+    is(iframeWin.getComputedStyle(divToStyle).getPropertyValue("height"), "100px", "ShadowRoot style sheets should apply to elements in ShadowRoot.");
 
     // Tests for author styles not applying in a ShadowRoot.
     var authorStyle = aDocument.createElement("style");
     authorStyle.innerHTML = ".fat { padding-right: 20px; padding-left: 30px; }";
     aDocument.body.appendChild(authorStyle);
-    isnot(iframeWin.getComputedStyle(divToStyle, null).getPropertyValue("padding-right"), "20px", "Author styles should not apply to ShadowRoot.");
+    isnot(iframeWin.getComputedStyle(divToStyle).getPropertyValue("padding-right"), "20px", "Author styles should not apply to ShadowRoot.");
 
     // Test dynamic changes to style in ShadowRoot.
     root.innerHTML = '<div id="divtostyle" class="dummy"></div>';
     divToStyle = root.getElementById("divtostyle");
     var dummyShadowStyle = aDocument.createElement("style");
     dummyShadowStyle.innerHTML = ".dummy { height: 300px; }";
     root.appendChild(dummyShadowStyle);
-    is(iframeWin.getComputedStyle(divToStyle, null).getPropertyValue("height"), "300px", "Dummy element in ShadowRoot should be styled by style in ShadowRoot.");
+    is(iframeWin.getComputedStyle(divToStyle).getPropertyValue("height"), "300px", "Dummy element in ShadowRoot should be styled by style in ShadowRoot.");
     dummyShadowStyle.innerHTML = ".dummy { height: 200px; }";
-    is(iframeWin.getComputedStyle(divToStyle, null).getPropertyValue("height"), "200px", "Dynamic changes to styles in ShadowRoot should change style of affected elements.");
+    is(iframeWin.getComputedStyle(divToStyle).getPropertyValue("height"), "200px", "Dynamic changes to styles in ShadowRoot should change style of affected elements.");
 
     // Test id selector in ShadowRoot style.
     root.innerHTML = '<style>#divtostyle { padding-top: 10px; }</style><div id="divtostyle"></div>';
     divToStyle = root.getElementById("divtostyle");
-    is(iframeWin.getComputedStyle(divToStyle, null).getPropertyValue("padding-top"), "10px", "ID selector in style selector should match element.");
+    is(iframeWin.getComputedStyle(divToStyle).getPropertyValue("padding-top"), "10px", "ID selector in style selector should match element.");
 
     SimpleTest.finish();
   });
 </script>
 </body>
 </html>
 
--- a/dom/tests/mochitest/webcomponents/test_style_fallback_content.html
+++ b/dom/tests/mochitest/webcomponents/test_style_fallback_content.html
@@ -22,18 +22,18 @@ createIframe(content)
 
     var host = aDocument.getElementById("grabme");
     var shadow = host.attachShadow({mode: "open"});
     shadow.innerHTML = '<style id="innerstyle"></style><span id="container"><slot><span id="innerspan">Hello</span></slot></span>';
     var innerStyle = shadow.getElementById("innerstyle");
 
     innerStyle.innerHTML = '#innerspan { margin-top: 10px; }';
     var innerSpan = shadow.getElementById("innerspan");
-    is(iframeWin.getComputedStyle(innerSpan, null).getPropertyValue("margin-top"), "10px", "Default content should be style by id selector.");
+    is(iframeWin.getComputedStyle(innerSpan).getPropertyValue("margin-top"), "10px", "Default content should be style by id selector.");
 
     innerStyle.innerHTML = '#container > slot > #innerspan { margin-top: 30px; }';
-    is(iframeWin.getComputedStyle(innerSpan, null).getPropertyValue("margin-top"), "30px", "Default content should be style by child combinators.");
+    is(iframeWin.getComputedStyle(innerSpan).getPropertyValue("margin-top"), "30px", "Default content should be style by child combinators.");
 
     SimpleTest.finish();
   });
 </script>
 </body>
 </html>
--- a/dom/tests/mochitest/whatwg/test_postMessage_idn.xhtml
+++ b/dom/tests/mochitest/whatwg/test_postMessage_idn.xhtml
@@ -35,17 +35,17 @@ function receiveMessage(evt)
      "wrong origin -- IDN issue, perhaps?");
 
   is(evt.data, "idn-response", "unexpected test result");
   is(evt.lastEventId, "", "postMessage creates events with empty lastEventId");
   ok(evt.source === idnWindow, "wrong source");
 
   SimpleTest.finish();
 }
-window.addEventListener("message", receiveMessage, false);
+window.addEventListener("message", receiveMessage);
 
 var xhtmlns = "http://www.w3.org/1999/xhtml";
 
 function setup()
 {
   var idnFrame = document.getElementsByTagNameNS(xhtmlns, "iframe")[0];
   idnWindow = idnFrame.contentWindow;
   try
--- a/dom/workers/test/test_worker_interfaces.js
+++ b/dom/workers/test/test_worker_interfaces.js
@@ -306,17 +306,17 @@ function createInterfaceMap({
           entry.fennecOrDesktop === (isAndroid && !isFennec) ||
           entry.fennec === !isFennec ||
           entry.release === !isRelease ||
           // The insecureContext test is very purposefully converting
           // entry.insecureContext to boolean, so undefined will convert to
           // false.  That way entries without an insecureContext annotation
           // will get treated as "insecureContext: false", which means exposed
           // only in secure contexts.
-          (isInsecureContext && !Boolean(entry.insecureContext)) ||
+          (isInsecureContext && !entry.insecureContext) ||
           entry.disabled
         ) {
           interfaceMap[entry.name] = false;
         } else {
           interfaceMap[entry.name] = true;
         }
       }
     }
--- a/dom/workers/test/xpcshell/test_fileReader.js
+++ b/dom/workers/test/xpcshell/test_fileReader.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Worker must be loaded from a chrome:// uri, not a file://
 // uri, so we first need to load it.
 var WORKER_SOURCE_URI = "chrome://workers/content/worker_fileReader.js";
 do_load_manifest("data/chrome.manifest");
 
-function run_test() {
-  run_next_test();
-}
-
 function talk_with_worker(worker) {
   return new Promise((resolve, reject) => {
     worker.onmessage = function(event) {
       let success = true;
       if (event.data == "OK") {
         resolve();
       } else {
         success = false;
--- a/dom/workers/test/xpcshell/test_workers.js
+++ b/dom/workers/test/xpcshell/test_workers.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Worker must be loaded from a chrome:// uri, not a file://
 // uri, so we first need to load it.
 var WORKER_SOURCE_URI = "chrome://workers/content/worker.js";
 do_load_manifest("data/chrome.manifest");
 
-function run_test() {
-  run_next_test();
-}
-
 function talk_with_worker(worker) {
   return new Promise((resolve, reject) => {
     worker.onmessage = function(event) {
       let success = true;
       if (event.data == "OK") {
         resolve();
       } else {
         success = false;