Bug 949614 - Use === for SimpleTest.is; r=Waldo
authorMs2ger <ms2ger@gmail.com>
Tue, 14 Apr 2015 15:28:13 +0200
changeset 268842 f302ad6c981d2e91a05e5180f6401516682045df
parent 268841 763263ec2efa192dadde960507d81e513bec3494
child 268843 5b262452eb6a97a63c1bfe6fa5734829173b3aa5
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs949614
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 949614 - Use === for SimpleTest.is; r=Waldo This is more likely to be correct, and a necessary step in case we ever want to move to Object.is. This keeps ise as an alias for is, and introduces is_loosely for the old behaviour.
accessible/tests/mochitest/common.js
accessible/tests/mochitest/events/test_text_alg.html
accessible/tests/mochitest/events/test_tree.xul
accessible/tests/mochitest/states.js
accessible/tests/mochitest/table/test_sels_listbox.xul
browser/base/content/test/general/test_no_mcb_on_http_site_font.html
browser/base/content/test/general/test_no_mcb_on_http_site_font2.html
browser/base/content/test/general/test_no_mcb_on_http_site_img.html
browser/devtools/app-manager/test/test_connection_store.html
browser/devtools/webide/test/device_front_shared.js
caps/tests/mochitest/test_disableScript.xul
docshell/test/navigation/test_bug430723.html
dom/apps/tests/test_import_export.html
dom/apps/tests/test_packaged_app_install.html
dom/apps/tests/test_packaged_app_update.html
dom/base/test/csp/test_csp_report.html
dom/base/test/file_bug426646-1.html
dom/base/test/file_bug426646-2.html
dom/base/test/fileutils.js
dom/base/test/test_CrossSiteXHR.html
dom/base/test/test_XHRSendData.html
dom/base/test/test_audioWindowUtils.html
dom/base/test/test_bug346485.html
dom/base/test/test_bug461555.html
dom/base/test/test_bug622088.html
dom/base/test/test_domrequesthelper.xul
dom/base/test/test_url.html
dom/base/test/test_url_empty_port.html
dom/browser-element/mochitest/browserElement_PromptCheck.js
dom/browser-element/mochitest/browserElement_PromptConfirm.js
dom/browser-element/mochitest/browserElement_ReloadPostRequest.js
dom/browser-element/mochitest/priority/test_ForegroundLRU.html
dom/contacts/tests/test_contacts_basics.html
dom/contacts/tests/test_contacts_basics2.html
dom/events/test/test_bug689564.html
dom/events/test/test_dragstart.html
dom/events/test/test_messageEvent.html
dom/html/test/forms/test_change_event.html
dom/html/test/forms/test_input_event.html
dom/html/test/forms/test_input_number_key_events.html
dom/html/test/forms/test_input_number_l10n.html
dom/html/test/forms/test_input_number_mouse_events.html
dom/html/test/forms/test_input_range_key_events.html
dom/html/test/forms/test_input_range_mouse_and_touch_events.html
dom/html/test/forms/test_label_input_controls.html
dom/html/test/forms/test_meter_element.html
dom/html/test/forms/test_output_element.html
dom/html/test/forms/test_progress_element.html
dom/html/test/forms/test_step_attribute.html
dom/html/test/forms/test_valueasdate_attribute.html
dom/html/test/forms/test_valueasnumber_attribute.html
dom/html/test/test_bug1045270.html
dom/html/test/test_bug332893-1.html
dom/html/test/test_bug332893-3.html
dom/html/test/test_bug332893-4.html
dom/html/test/test_bug332893-5.html
dom/html/test/test_bug332893-6.html
dom/html/test/test_bug332893-7.html
dom/html/test/test_bug405242.html
dom/html/test/test_bug536891.html
dom/html/test/test_bug536895.html
dom/html/test/test_bug551846.html
dom/html/test/test_bug596350.html
dom/html/test/test_bug615595.html
dom/html/test/test_documentAll.html
dom/indexedDB/test/helpers.js
dom/indexedDB/test/test_persistenceType.html
dom/indexedDB/test/unit/test_deleteDatabase_interactions.js
dom/indexedDB/test/unit/test_keys.js
dom/indexedDB/test/unit/test_multientry.js
dom/indexedDB/test/unit/test_persistenceType.js
dom/indexedDB/test/unit/test_remove_objectStore.js
dom/indexedDB/test/unit/test_setVersion_abort.js
dom/indexedDB/test/unit/test_setVersion_events.js
dom/media/test/test_audio2.html
dom/media/test/test_preload_attribute.html
dom/media/test/test_texttrackcue.html
dom/media/tests/mochitest/dataChannel.js
dom/plugins/test/mochitest/test_npruntime_identifiers.html
dom/plugins/test/mochitest/test_propertyAndMethod.html
dom/settings/tests/test_settings_basics.html
dom/settings/tests/test_settings_onsettingchange.html
dom/svg/test/test_scientific.html
dom/tests/mochitest/bugs/test_bug346659.html
dom/tests/mochitest/bugs/test_bug437361.html
dom/tests/mochitest/bugs/test_bug504862.html
dom/tests/mochitest/bugs/test_bug531176.html
dom/tests/mochitest/bugs/test_bug581072.html
dom/tests/mochitest/bugs/test_bug593174.html
dom/tests/mochitest/bugs/test_bug862540.html
dom/tests/mochitest/bugs/test_onerror_message.html
dom/tests/mochitest/chrome/test_sandbox_bindings.xul
dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html
dom/tests/mochitest/localstorage/test_lowDeviceStorage.html
dom/tests/mochitest/webapps/test_install_app.xul
dom/tests/mochitest/webapps/test_launch_paths.xul
dom/workers/test/test_suspend.html
dom/xul/templates/tests/chrome/test_sortservice.xul
editor/libeditor/tests/spellcheck.js
editor/libeditor/tests/test_bug1100966.html
js/xpconnect/tests/chrome/test_bug571849.xul
js/xpconnect/tests/chrome/test_localstorage_with_nsEp.xul
js/xpconnect/tests/mochitest/test_bug691059.html
layout/base/tests/chrome/test_bug533845.xul
layout/base/tests/test_bug435293-skew.html
layout/style/test/chrome/test_moz_document_rules.html
layout/style/test/test_animations_omta_start.html
layout/style/test/test_cascade.html
layout/style/test/test_flexbox_flex_grow_and_shrink.html
layout/style/test/test_namespace_rule.html
layout/style/test/test_of_type_selectors.xhtml
layout/style/test/test_selectors.html
layout/style/test/test_selectors_on_anonymous_content.html
layout/style/test/test_transitions_events.html
layout/style/test/test_unclosed_parentheses.html
layout/xul/test/test_bug703150.xul
layout/xul/test/test_stack.xul
testing/mochitest/chrome/test_sample.xul
testing/mochitest/tests/Harness_sanity/test_sanity.html
testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Async.html
testing/mochitest/tests/SimpleTest/SimpleTest.js
toolkit/components/microformats/tests/test_Microformats.html
toolkit/components/microformats/tests/test_Microformats_geo.html
toolkit/components/microformats/tests/test_Microformats_hCalendar.html
toolkit/components/microformats/tests/test_Microformats_hCard.html
toolkit/components/microformats/tests/test_Microformats_negative.html
toolkit/components/passwordmgr/test/test_prompt_async.html
toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
toolkit/content/tests/chrome/findbar_events_window.xul
toolkit/content/tests/chrome/findbar_window.xul
toolkit/content/tests/chrome/test_datepicker.xul
toolkit/content/tests/chrome/test_deck.xul
toolkit/content/tests/chrome/test_progressmeter.xul
toolkit/content/tests/chrome/test_textbox_number.xul
toolkit/content/tests/chrome/xul_selectcontrol.js
toolkit/content/tests/widgets/test_audiocontrols_dimensions.html
toolkit/devtools/webconsole/test/test_network_get.html
toolkit/devtools/webconsole/test/test_network_longstring.html
toolkit/devtools/webconsole/test/test_network_post.html
toolkit/devtools/webconsole/test/test_object_actor_native_getters.html
widget/tests/test_keycodes.xul
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -420,19 +420,19 @@ function testAccessibleTree(aAccOrElmOrI
       is(accTree[prop], acc.DOMNode.tagName, msg);
       break;
 
     case "textAttrs": {
       var prevOffset = -1;
       for (var offset in accTree[prop]) {
         if (prevOffset !=- 1) {
           var attrs = accTree[prop][prevOffset];
-          testTextAttrs(acc, prevOffset, attrs, { }, prevOffset, offset, true);
+          testTextAttrs(acc, prevOffset, attrs, { }, prevOffset, +offset, true);
         }
-        prevOffset = offset;
+        prevOffset = +offset;
       }
 
       if (prevOffset != -1) {
         var charCount = getAccessible(acc, [nsIAccessibleText]).characterCount;
         var attrs = accTree[prop][prevOffset];
         testTextAttrs(acc, prevOffset, attrs, { }, prevOffset, charCount, true);
       }
 
--- a/accessible/tests/mochitest/events/test_text_alg.html
+++ b/accessible/tests/mochitest/events/test_text_alg.html
@@ -15,18 +15,18 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    const kRemoval = 0;
-    const kInsertion = 1;
+    const kRemoval = false;
+    const kInsertion = true;
     const kUnexpected = true;
 
     function changeText(aContainerID, aValue, aEventList)
     {
       this.containerNode = getNode(aContainerID);
       this.textNode = this.containerNode.firstChild;
       this.textData = this.textNode.data;
 
--- a/accessible/tests/mochitest/events/test_tree.xul
+++ b/accessible/tests/mochitest/events/test_tree.xul
@@ -77,17 +77,17 @@
           startCol = null;
         }
         is(startCol, aStartCol,
            "Wrong 'startcolumn' of 'treeInvalidated' event on " + aMsg);
 
         try {
           var endCol = propBag.getPropertyAsInt32("endcolumn");
         } catch (e if e.name == 'NS_ERROR_NOT_AVAILABLE') {
-          startCol = null;
+          endCol = null;
         }
         is(endCol, aEndCol,
            "Wrong 'endcolumn' of 'treeInvalidated' event on " + aMsg);
       }
       this.getID = function getID()
       {
         return "TreeInvalidated on " + aMsg;
       }
--- a/accessible/tests/mochitest/states.js
+++ b/accessible/tests/mochitest/states.js
@@ -47,17 +47,17 @@ const EXT_STATE_MULTI_LINE = nsIAccessib
 const EXT_STATE_PINNED = nsIAccessibleStates.EXT_STATE_PINNED;
 const EXT_STATE_SENSITIVE = nsIAccessibleStates.EXT_STATE_SENSITIVE;
 const EXT_STATE_SINGLE_LINE = nsIAccessibleStates.EXT_STATE_SINGLE_LINE;
 const EXT_STATE_STALE = nsIAccessibleStates.EXT_STATE_STALE;
 const EXT_STATE_SUPPORTS_AUTOCOMPLETION =
   nsIAccessibleStates.EXT_STATE_SUPPORTS_AUTOCOMPLETION;
 const EXT_STATE_VERTICAL = nsIAccessibleStates.EXT_STATE_VERTICAL;
 
-const kOrdinalState = 0;
+const kOrdinalState = false;
 const kExtraState = 1;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Test functions
 
 /**
  * Tests the states and extra states of the given accessible.
  * Also tests for unwanted states and extra states.
--- a/accessible/tests/mochitest/table/test_sels_listbox.xul
+++ b/accessible/tests/mochitest/table/test_sels_listbox.xul
@@ -72,17 +72,17 @@
       // getSelectedColumns
       var selColsCount = {}, selCols = {};
       aAcc.getSelectedColumnIndices(selColsCount, selCols);
 
       is(selColsCount.value, aSelCount,
          aId + ": wrong number of selected columns");
 
       if (!aSelIndexesArray) {
-        is(selCols.value, null,
+        is(selCols.value, undefined,
            aId + ": no columns should be selected");
       } else {
         for (var i = 0; i < selCols.length; i++) {
           is(selCols[i], aSelIndexesArray[i],
              aId + ": wrong selected column index " + i);
         }
       }
     }
@@ -111,17 +111,17 @@
       // getSelectedRows
       var selColsCount = {}, selCols = {};
       aAcc.getSelectedRowIndices(selColsCount, selCols);
 
       is(selColsCount.value, aSelCount,
          aId + ": wrong number of selected rows");
 
       if (!aSelIndexesArray) {
-        is(selCols.value, null,
+        is(selCols.value, undefined,
            aId + ": no row should be selected");
       } else {
         for (var i = 0; i < selCols.length; i++) {
           is(selCols[i], aSelIndexesArray[i],
              aId + ": wrong selected row index " + i);
         }
       }
     }
@@ -154,17 +154,17 @@
       // getSelectedCells
       var selColsCount = {}, selCols = {};
       aAcc.getSelectedCellIndices(selColsCount, selCols);
 
       is(selColsCount.value, aSelCount,
          aId + ": wrong number of selected cells");
 
       if (!aSelIndexesArray) {
-        is(selCols.value, null,
+        is(selCols.value, undefined,
            aId + ": no cells should be selected");
       } else {
         for (var i = 0; i < selCols.length; i++) {
           is(selCols[i], aSelIndexesArray[i],
              aId + ": wrong selected cell index " + i);
         }
       }
     }
--- a/browser/base/content/test/general/test_no_mcb_on_http_site_font.html
+++ b/browser/base/content/test/general/test_no_mcb_on_http_site_font.html
@@ -14,29 +14,29 @@
   function checkLoadStates() {
    var ui = SpecialPowers.wrap(window)
             .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
              .getInterface(SpecialPowers.Ci.nsIWebNavigation)
              .QueryInterface(SpecialPowers.Ci.nsIDocShell)
              .securityUI;
 
    var loadedMixedActive = ui &&
-     (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT);
    is(loadedMixedActive, false, "OK: Should not load mixed active content!");
 
    var blockedMixedActive = ui &&
-       (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT);
    is(blockedMixedActive, false, "OK: Should not block mixed active content!");
 
    var loadedMixedDisplay = ui &&
-     (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT);
    is(loadedMixedDisplay, false, "OK: Should not load mixed display content!");
 
    var blockedMixedDisplay = ui &&
-     (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_DISPLAY_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_DISPLAY_CONTENT);
    is(blockedMixedDisplay, false, "OK: Should not block mixed display content!");
 
    var newValue = "Verifying MCB does not trigger warning/error for an http page with https css that includes http font";
    document.getElementById("testDiv").innerHTML = newValue;
   }
 </script>
 </head>
 <body onload="checkLoadStates()">
--- a/browser/base/content/test/general/test_no_mcb_on_http_site_font2.html
+++ b/browser/base/content/test/general/test_no_mcb_on_http_site_font2.html
@@ -14,29 +14,29 @@
   function checkLoadStates() {
    var ui = SpecialPowers.wrap(window)
         .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
              .getInterface(SpecialPowers.Ci.nsIWebNavigation)
              .QueryInterface(SpecialPowers.Ci.nsIDocShell)
              .securityUI;
 
    var loadedMixedActive = ui &&
-     (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT);
    is(loadedMixedActive, false, "OK: Should not load mixed active content!");
 
    var blockedMixedActive = ui &&
-       (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT);
    is(blockedMixedActive, false, "OK: Should not block mixed active content!");
 
    var loadedMixedDisplay = ui &&
-     (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT);
    is(loadedMixedDisplay, false, "OK: Should not load mixed display content!");
 
    var blockedMixedDisplay = ui &&
-     (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_DISPLAY_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_DISPLAY_CONTENT);
    is(blockedMixedDisplay, false, "OK: Should not block mixed display content!");
 
    var newValue = "Verifying MCB does not trigger warning/error for an http page ";
     newValue += "with https css that imports another http css which includes http font";
    document.getElementById("testDiv").innerHTML = newValue;
   }
 </script>
 </head>
--- a/browser/base/content/test/general/test_no_mcb_on_http_site_img.html
+++ b/browser/base/content/test/general/test_no_mcb_on_http_site_img.html
@@ -14,29 +14,29 @@
   function checkLoadStates() {
    var ui = SpecialPowers.wrap(window)
             .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
              .getInterface(SpecialPowers.Ci.nsIWebNavigation)
              .QueryInterface(SpecialPowers.Ci.nsIDocShell)
              .securityUI;
 
    var loadedMixedActive = ui &&
-     (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT);
    is(loadedMixedActive, false, "OK: Should not load mixed active content!");
 
    var blockedMixedActive = ui &&
-       (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT);
    is(blockedMixedActive, false, "OK: Should not block mixed active content!");
 
    var loadedMixedDisplay = ui &&
-     (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT);
    is(loadedMixedDisplay, false, "OK: Should not load mixed display content!");
 
    var blockedMixedDisplay = ui &&
-     (ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_DISPLAY_CONTENT);
+     !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_DISPLAY_CONTENT);
    is(blockedMixedDisplay, false, "OK: Should not block mixed display content!");
 
    var newValue = "Verifying MCB does not trigger warning/error for an http page with https css that includes http image";
    document.getElementById("testDiv").innerHTML = newValue;
   }
 </script>
 </head>
 <body onload="checkLoadStates()">
--- a/browser/devtools/app-manager/test/test_connection_store.html
+++ b/browser/devtools/app-manager/test/test_connection_store.html
@@ -53,17 +53,17 @@ Bug 901519 - [app manager] data store fo
         let port = root.querySelector("#port");
         let template = new Template(root, store, () => {});
         template.start();
 
         connection.host = "foobar";
         connection.port = 42;
 
         is(host.textContent, "foobar", "host updated");
-        is(port.textContent, 42, "port updated");
+        is(port.textContent, "42", "port updated");
 
         let been_through_connecting = false;
         let been_through_connected = false;
         let been_through_disconnected = false;
 
         is(status.textContent, "disconnected", "status updated (diconnected)");
 
         connection.once("connecting", (e) => {
--- a/browser/devtools/webide/test/device_front_shared.js
+++ b/browser/devtools/webide/test/device_front_shared.js
@@ -97,28 +97,28 @@ function addNewFieldInteger() {
   customValue.value = 1;
   found = false;
 
   customBtn.click();
   newField = doc.querySelector("#new-integer-field");
   if (newField) {
     found = true;
     is(newField.type, "number", "Custom type is a number");
-    is(newField.value, 1, "Custom integer value is correct");
+    is(newField.value, "1", "Custom integer value is correct");
   }
   ok(found, "Found new integer field line");
   is(customName.value, "", "Custom integer name reset");
-  is(customValue.value, 0, "Custom integer value reset");
+  is(customValue.value, "", "Custom integer value reset");
 }
 
 let editFieldInteger = Task.async(function*() {
   // Edit existing custom integer preference
   newField.value = 3;
   newField.click();
-  is(newField.value, 3, "Custom integer existing value is correct");
+  is(newField.value, "3", "Custom integer existing value is correct");
 
   // Reset a custom field
   let resetBtn = doc.querySelector("#btn-new-integer-field");
   resetBtn.click();
 
   try {
     yield iframe.contentWindow.configView._defaultField;
   } catch(err) {
--- a/caps/tests/mochitest/test_disableScript.xul
+++ b/caps/tests/mochitest/test_disableScript.xul
@@ -72,17 +72,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   function addFrame(parentWin, name, expectOnload) {
     let ifr = parentWin.document.createElement('iframe');
     parentWin.document.body.appendChild(ifr);
     ifr.setAttribute('name', name);
     let deferred = Promise.defer();
     // We need to append 'name' to avoid running afoul of recursive frame detection.
     let frameURI = uri + "?name=" + name;
     navigateFrame(ifr, frameURI).then(function() {
-      is(ifr.contentWindow.location, frameURI, "Successful load");
+      is(String(ifr.contentWindow.location), frameURI, "Successful load");
       is(!!ifr.contentWindow.wrappedJSObject.gFiredOnload, expectOnload,
          "onload should only fire when scripts are enabled");
       deferred.resolve();
     });
     return deferred.promise;
   }
 
   function checkScriptEnabled(win, expectEnabled) {
--- a/docshell/test/navigation/test_bug430723.html
+++ b/docshell/test/navigation/test_bug430723.html
@@ -54,17 +54,17 @@ var nextTest =function() {
   switch (testNum) {
     case 1: setTimeout(step1, 0); break;
     case 2: setTimeout(step2, 0); break;
     case 3: setTimeout(step3, 0); break;
   };
 }
 
 var step1 =function() {
-  window.is(testWindow.location, gTallRedBoxURI, "Ensure red page loaded.");
+  window.is(String(testWindow.location), gTallRedBoxURI, "Ensure red page loaded.");
   
   // Navigate down and up.
   is(testWindow.document.body.scrollTop, 0,
      "Page1: Ensure the scrollpane is at the top before we start scrolling.");
   testWindow.addEventListener("scroll", function () {
     testWindow.removeEventListener("scroll", arguments.callee, true);
     isnot(testWindow.document.body.scrollTop, 0,
           "Page1: Ensure we can scroll down.");
@@ -82,17 +82,17 @@ var step1 =function() {
       testWindow.location = gTallBlueBoxURI;
     }, true);
     sendKey('UP', testWindow);
   }
 }
 
 
 var step2 =function() {    
-  window.is(testWindow.location, gTallBlueBoxURI, "Ensure blue page loaded.");
+  window.is(String(testWindow.location), gTallBlueBoxURI, "Ensure blue page loaded.");
 
   // Scroll around a bit.
   is(testWindow.document.body.scrollTop, 0,
      "Page2: Ensure the scrollpane is at the top before we start scrolling.");
 
   var count = 0;
   testWindow.addEventListener("scroll", function () {
     if (++count < 2) {
@@ -106,17 +106,17 @@ var step2 =function() {
       // Navigate backwards. This should fire step3.
       testWindow.history.back();
     }
   }, true);
   sendKey('DOWN', testWindow);
 }
 
 var step3 =function() {
-  window.is(testWindow.location, gTallRedBoxURI,
+  window.is(String(testWindow.location), gTallRedBoxURI,
             "Ensure red page restored from history.");
 
   // Check we can still scroll with the keys.
   is(testWindow.document.body.scrollTop, 0,
      "Page1Again: Ensure scroll pane at top before we scroll.");  
   testWindow.addEventListener("scroll", function () {
     testWindow.removeEventListener("scroll", arguments.callee, true);
 
--- a/dom/apps/tests/test_import_export.html
+++ b/dom/apps/tests/test_import_export.html
@@ -224,17 +224,17 @@ function runTest() {
         progress: 0,
         installState: "installed",
         downloadAvailable: false,
         downloading: false,
         downloadSize: 0,
         size: 0,
         readyToApplyDownload: false
       };
-      PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, 2, expected,
+      PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, "2", expected,
                                        true, false, continueTest);
     };
   };
 
   var request = navigator.mozApps.installPackage(miniManifestURL);
   request.onerror = PackagedTestHelper.mozAppsError;
   request.onsuccess = function() {
     info("Packaged Application installed");
--- a/dom/apps/tests/test_packaged_app_install.html
+++ b/dom/apps/tests/test_packaged_app_install.html
@@ -53,34 +53,16 @@ function checkUninstallApp(aApp) {
     PackagedTestHelper.next();
   };
   req.onerror = function(evt) {
     ok(false, "Got unexpected " + evt.target.error.name);
     PackagedTestHelper.finish();
   };
 }
 
-function checkInstalledApp(aMiniManifestURL,
-                           aVersion,
-                           aExpectedApp,
-                           aLaunchable,
-                           aCb) {
-  var req = navigator.mozApps.checkInstalled(aMiniManifestURL);
-  req.onsuccess = function(evt) {
-    ok(req.result, "The app is installed");
-
-    if (!req.result) {
-      PackagedTestHelper.finish();
-    }
-
-    PackagedTestHelper.checkAppState(evt.application, aVersion, aExpectedApp,
-                                     aLaunchable, false, aCb);
-  };
-}
-
 var gIconData =
 "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A\x00\x00\x00\x0D\x49\x48\x44\x52" +
 "\x00\x00\x00\x0F\x00\x00\x00\x0F\x08\x03\x00\x00\x00\x0C\x08\x65" +
 "\x78\x00\x00\x00\x04\x67\x41\x4D\x41\x00\x00\xD6\xD8\xD4\x4F\x58" +
 "\x32\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6F\x66\x74\x77\x61\x72" +
 "\x65\x00\x41\x64\x6F\x62\x65\x20\x49\x6D\x61\x67\x65\x52\x65\x61" +
 "\x64\x79\x71\xC9\x65\x3C\x00\x00\x00\x39\x50\x4C\x54\x45\xB5\x42" + 
 "\x42\xCE\x94\x94\xCE\x84\x84\x9C\x21\x21\xAD\x21\x21\xCE\x73\x73" +
@@ -235,17 +217,17 @@ var steps = [
           progress: 0,
           installState: "installed",
           downloadAvailable: false,
           downloading: false,
           downloadSize: 0,
           size: 0,
           readyToApplyDownload: false
         };
-        PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, 2, expected,
+        PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, "2", expected,
                                          true, false, PackagedTestHelper.next);
       };
     };
 
     var request = navigator.mozApps.installPackage(miniManifestURL);
     request.onerror = PackagedTestHelper.mozAppsError;
     request.onsuccess = function() {
       info("Application installed");
@@ -322,17 +304,17 @@ var steps = [
           progress: 0,
           installState: alreadyCanceled?"pending":"installed",
           downloadAvailable: false,
           downloading: false,
           downloadSize: 0,
           size: 0,
           readyToApplyDownload: alreadyCanceled
         };
-        PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, 3, expected,
+        PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, "3", expected,
                                          true, false, function() {});
       };
 
       PackagedTestHelper.gApp.ondownloadapplied = function() {
         info("App download applied.");
         var expected = {
           name: PackagedTestHelper.gAppName,
           manifestURL: miniManifestURL,
@@ -340,17 +322,17 @@ var steps = [
           progress: 0,
           installState: "installed",
           downloadAvailable: false,
           downloading: false,
           downloadSize: 0,
           size: 0,
           readyToApplyDownload: false
         };
-        PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, 3, expected,
+        PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, "3", expected,
                                          true, false, PackagedTestHelper.next);
       }
 
     };
 
     var request = navigator.mozApps.installPackage(miniManifestURL);
     request.onerror = PackagedTestHelper.mozAppsError;
     request.onsuccess = function() {
--- a/dom/apps/tests/test_packaged_app_update.html
+++ b/dom/apps/tests/test_packaged_app_update.html
@@ -168,17 +168,17 @@ var steps = [
       info("Got oninstall event");
       PackagedTestHelper.gApp = evt.application;
       PackagedTestHelper.gApp.ondownloaderror = function() {
         ok(false, "Download error " + PackagedTestHelper.gApp.downloadError.name);
         PackagedTestHelper.finish();
       };
       PackagedTestHelper.gApp.ondownloadsuccess =
         checkLastAppState.bind(undefined, miniManifestURL, false, false,
-                               2, PackagedTestHelper.next);
+                               "2", PackagedTestHelper.next);
     };
 
     var request = navigator.mozApps.installPackage(miniManifestURL);
     request.onerror = PackagedTestHelper.mozAppsError;
     request.onsuccess = function() {
       info("Application installed");
     };
   },
@@ -227,17 +227,17 @@ var steps = [
     validatePermissions(permissionsToCheck, true /*dontFail*/);
     PackagedTestHelper.next();
   },
   function() {
     PackagedTestHelper.setAppVersion(3, PackagedTestHelper.next);
   },
   function() {
     info("== TEST == Update packaged app");
-    updateApp(true, 2, 3);
+    updateApp(true, "2", "3");
   },
   function() {
     info("== TEST == Check that saved permissions were kept");
     validatePermissions(permissionsToCheck);
     PackagedTestHelper.next();
   },
   function() {
     info("== TEST == Check for Update after getting a new package");
@@ -246,24 +246,24 @@ var steps = [
   function() {
     PackagedTestHelper.setAppVersion(4, PackagedTestHelper.next);
   },
   function() {
     PackagedTestHelper.setAppNameSuffix("NEWVERSION", PackagedTestHelper.next);
   },
   function() {
     info("== TEST == Check that name changes in an update are ignored");
-    updateApp(true, 3, 4);
+    updateApp(true, "3", "4");
   },
   function() {
     PackagedTestHelper.setAppVersion(5, PackagedTestHelper.next, true);
   },
   function() {
     info("== TEST == Update packaged app - same package");
-    updateApp(false, 4, 4, true);
+    updateApp(false, "4", "4", true);
   },
   function() {
     info("== TEST == Check for Update after getting the same package");
     checkForUpdate(false);
   },
 
   function() {
     PackagedTestHelper.setAppVersion(6, PackagedTestHelper.next,
--- a/dom/base/test/csp/test_csp_report.html
+++ b/dom/base/test/csp/test_csp_report.html
@@ -55,17 +55,17 @@ window.checkResults = function(reportObj
   is(cspReport["original-policy"], "default-src 'none'; report-uri http://mochi.test:8888/foo.sjs",
      "Incorrect original-policy");
 
   is(cspReport["source-file"], docUri, "Incorrect source-file");
 
   is(cspReport["script-sample"], "\n    var foo = \"propEscFoo\";\n    var bar...",
      "Incorrect script-sample");
 
-  is(cspReport["line-number"], "7", "Incorrect line-number");
+  is(cspReport["line-number"], 7, "Incorrect line-number");
 }
 
 // This is used to watch requests go out so we can see if the report is
 // sent correctly
 function examiner() {
   SpecialPowers.addObserver(this, "http-on-opening-request", false);
 }
 examiner.prototype  = {
--- a/dom/base/test/file_bug426646-1.html
+++ b/dom/base/test/file_bug426646-1.html
@@ -20,17 +20,17 @@ function doe2() {
 }
 
 function doe3() {
   window.frames[0].frameElement.onload = soon(doe4);
   history.go(-1);
 }
 
 function doe4() {
-  opener.is(window.frames[0].location, url1, "History.go(-1) didn't work?");
-  opener.is(window.frames[1].location, "about:blank",
+  opener.is(String(window.frames[0].location), url1, "History.go(-1) didn't work?");
+  opener.is(String(window.frames[1].location), "about:blank",
             "History.go(-1) didn't work?");
   close();
 }
 </script>
 </head>
 <body onload="doe();" onunload="opener.nextTest();">
 </body></html>
--- a/dom/base/test/file_bug426646-2.html
+++ b/dom/base/test/file_bug426646-2.html
@@ -50,15 +50,15 @@ function doe3() {
 }
 
 function doe4() {
   win0.frameElement.onload = soon(doe5);
   history.go(-1);
 }
 
 function doe5() {
-  opener.is(win0.location, url1, "History.go(-1) didn't work?");
+  opener.is(String(win0.location), url1, "History.go(-1) didn't work?");
   close();
 }
 </script>
 </head>
 <body onload="setTimeout(doe, 0);" onunload="opener.nextTest();">
 </body></html>
--- a/dom/base/test/fileutils.js
+++ b/dom/base/test/fileutils.js
@@ -50,17 +50,17 @@ function testFile(file, contents, test) 
   // Send file to server using plain XMLHttpRequest
   var xhr = new XMLHttpRequest;
   xhr.open("POST", "file_XHRSendData.sjs");
   xhr.onload = function (event) {
     is(event.target.getResponseHeader("Result-Content-Type"),
        file.type ? file.type : null,
        "request content-type in XMLHttpRequest send of " + test);
     is(event.target.getResponseHeader("Result-Content-Length"),
-       file.size,
+       String(file.size),
        "request content-length in XMLHttpRequest send of " + test);
   };
   xhr.addEventListener("load",
                        getXHRLoadHandler(contents, contents.length,
                                          "XMLHttpRequest send of " + test),
                        false);
   xhr.overrideMimeType('text/plain; charset=x-user-defined');
   xhr.send(file);
--- a/dom/base/test/test_CrossSiteXHR.html
+++ b/dom/base/test/test_CrossSiteXHR.html
@@ -689,17 +689,17 @@ function runTest() {
            "wrong responseText in test for " + test.toSource());
       }
       if (test.responseHeaders) {
         for (header in test.responseHeaders) {
           if (test.expectedResponseHeaders.indexOf(header) == -1) {
             is(res.responseHeaders[header], null,
                "|xhr.getResponseHeader()|wrong response header (" + header + ") in test for " +
                test.toSource());
-	    is(res.allResponseHeaders[header], null,
+            is(res.allResponseHeaders[header], undefined,
               "|xhr.getAllResponseHeaderss()|wrong response header (" + header + ") in test for " +
               test.toSource());
           }
           else {
             is(res.responseHeaders[header], test.responseHeaders[header],
                "|xhr.getResponseHeader()|wrong response header (" + header + ") in test for " +
                test.toSource());
             is(res.allResponseHeaders[header], test.responseHeaders[header],
--- a/dom/base/test/test_XHRSendData.html
+++ b/dom/base/test/test_XHRSendData.html
@@ -227,17 +227,19 @@ try {
       is(xhr.getResponseHeader("Result-Content-Type"), test.resContentType,
          "Wrong Content-Type sent");
     }
     else {
       is(xhr.getResponseHeader("Result-Content-Type"), null);
     }
 
     if (test.resContentLength) {
-      is(xhr.getResponseHeader("Result-Content-Length"), test.resContentLength, "Wrong Content-Length sent");
+      is(xhr.getResponseHeader("Result-Content-Length"),
+         String(test.resContentLength),
+         "Wrong Content-Length sent");
     }
 
     if (test.resType == "arraybuffer") {
       is_identical_arraybuffer(xhr.response, test.resBody);
     }
     else if (test.body instanceof Document) {
       is(xhr.responseText.replace("\r\n", "\n"), test.resBody, "Wrong body");
     }
--- a/dom/base/test/test_audioWindowUtils.html
+++ b/dom/base/test/test_audioWindowUtils.html
@@ -18,20 +18,20 @@ function runTest() {
   is(utils.audioMuted, false, "By default utils.audioMuted is false");
   utils.audioMuted = true;
   is(utils.audioMuted, true, "utils.audioMuted is true");
   utils.audioMuted = false;
   is(utils.audioMuted, false, "utils.audioMuted is true");
 
   is(utils.audioVolume, 1.0, "By default utils.audioVolume is 1.0");
   utils.audioVolume = 0.4;
-  is(utils.audioVolume.toFixed(2), 0.4, "utils.audioVolume is ok");
+  is(utils.audioVolume.toFixed(2), "0.40", "utils.audioVolume is ok");
   utils.audioMuted = true;
   is(utils.audioMuted, true, "utils.audioMuted is true");
-  is(utils.audioVolume.toFixed(2), 0.4, "utils.audioVolume is ok");
+  is(utils.audioVolume.toFixed(2), "0.40", "utils.audioVolume is ok");
   utils.audioMuted = false;
 
   utils.audioVolume = 2.0;
   is(utils.audioVolume, 2.0, "utils.audioVolume is ok");
 
   try {
     utils.audioVolume = -42;
     ok(false, "This should throw");
@@ -55,20 +55,20 @@ function runTest() {
   is(utils.audioMuted, false, "By default utils.audioMuted is false");
   utils.audioMuted = true;
   is(utils.audioMuted, true, "utils.audioMuted is true");
   utils.audioMuted = false;
   is(utils.audioMuted, false, "utils.audioMuted is true");
 
   is(utils.audioVolume, 1.0, "By default utils.audioVolume is 1.0");
   utils.audioVolume = 0.4;
-  is(utils.audioVolume.toFixed(2), 0.4, "utils.audioVolume is ok");
+  is(utils.audioVolume.toFixed(2), "0.40", "utils.audioVolume is ok");
   utils.audioMuted = true;
   is(utils.audioMuted, true, "utils.audioMuted is true");
-  is(utils.audioVolume.toFixed(2), 0.4, "utils.audioVolume is ok");
+  is(utils.audioVolume.toFixed(2), "0.40", "utils.audioVolume is ok");
   utils.audioMuted = false;
 
   utils.audioVolume = 2.0;
   is(utils.audioVolume, 2.0, "utils.audioVolume is ok");
 
   try {
     utils.audioVolume = -42;
     ok(false, "This should throw");
--- a/dom/base/test/test_bug346485.html
+++ b/dom/base/test/test_bug346485.html
@@ -20,57 +20,58 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript">
 
 /** Test for Bug 346485 **/
 
 /**
  * This test is testing DOMSettableTokenList used by the output element.
  */
 
+function checkHtmlFor(htmlFor, list, msg) {
+  var length = htmlFor.length;
+  is(length, list.length, htmlFor + ": incorrect htmlFor length (" + msg + ")");
+  for (var i = 0; i < length; ++i) {
+    is(htmlFor[i], list[i], htmlFor + ": wrong element at " + i + " (" + msg + ")");
+  }
+}
+
 var o = document.getElementById('o');
 
-is(o.htmlFor, 'a b',
+is(String(o.htmlFor), 'a b',
   "htmlFor IDL attribute should reflect for content attribute");
 
 is(o.htmlFor.value, 'a b',
   "value should return the underlying string");
 
 is(o.htmlFor.length, 2, "Size should be '2'");
 
 ok(o.htmlFor.contains('a'), "It should contain 'a' token'");
 ok(!o.htmlFor.contains('c'), "It should not contain 'c' token");
 
 is(o.htmlFor.item(0), 'a', "First item is 'a' token'");
 is(o.htmlFor.item(42), null, "Out-of-range should return null");
 
 o.htmlFor.add('c');
-is(o.htmlFor, 'a b c', "'c' token should have been added");
-is(o.htmlFor.length, 3, "Size should be '3'");
+checkHtmlFor(o.htmlFor, ['a', 'b', 'c'], "'c' token should have been added");
 
 o.htmlFor.add('a');
-is(o.htmlFor, 'a b c', "Nothing should have changed");
-is(o.htmlFor.length, 3, "Size should be '3'");
+checkHtmlFor(o.htmlFor, ['a', 'b', 'c'], "Nothing should have changed");
 
 o.htmlFor.remove('a');
-is(o.htmlFor, 'b c', "'a' token should have been removed");
-is(o.htmlFor.length, 2, "Size should be '2'");
+checkHtmlFor(o.htmlFor, ['b', 'c'], "'a' token should have been removed");
 
 o.htmlFor.remove('d');
-is(o.htmlFor, 'b c', "Nothing should have been removed");
-is(o.htmlFor.length, 2, "Size should be '2'");
+checkHtmlFor(o.htmlFor, ['b', 'c'], "Nothing should have been removed");
 
 o.htmlFor.toggle('a');
-is(o.htmlFor, 'b c a', "'a' token should have been added");
-is(o.htmlFor.length, 3, "Size should be '3'");
+checkHtmlFor(o.htmlFor, ['b', 'c', 'a'], "'a' token should have been added");
 
 o.htmlFor.toggle('b');
-is(o.htmlFor, 'c a', "Nothing should have changed");
-is(o.htmlFor.length, 2, "Size should be '2'");
+checkHtmlFor(o.htmlFor, ['c', 'a'], "Nothing should have changed");
 
 o.htmlFor.value = "foo bar";
-is(o.htmlFor, 'foo bar', "The underlying string should have changed");
-is(o.htmlFor.length, 2, "Size should be '2'");
+checkHtmlFor(o.htmlFor, ['foo', 'bar'], "The underlying string should have changed");
 ok(o.htmlFor.contains('foo'), "It should contain 'foo'");
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/base/test/test_bug461555.html
+++ b/dom/base/test/test_bug461555.html
@@ -21,17 +21,17 @@ SimpleTest.waitForExplicitFinish();
 function writeIt(n) {
   document.write("<span>" + n + "</span>");
 }
 
 function done() {
   nodes = document.getElementsByTagName('span');
   is(nodes.length, 3, "wrong length");
   for (i = 0; i < nodes.length; ++i) {
-    is(nodes[i].textContent, i+1, "wrong order");
+    is(nodes[i].textContent, String(i + 1), "wrong order");
   }
   SimpleTest.finish();
 }
 
 document.addEventListener("DOMContentLoaded", function() {
   done();
 }, false);
 
--- a/dom/base/test/test_bug622088.html
+++ b/dom/base/test/test_bug622088.html
@@ -25,58 +25,58 @@ const kOriginalLocation = location.href;
 
 SimpleTest.waitForExplicitFinish();
 
 var innerFinishedLoading = false;
 function innerLoaded(inner) {
   // Here, we're being called through inner's onload handler, so our referrer
   // should be inner's URL.
   var referrer = inner.doXHR();
-  is (referrer, inner.document.location, 'Expected inner frame location');
+  is (referrer, String(inner.document.location), 'Expected inner frame location');
 
   // Now change the location of the inner frame.  This should be reflected in
   // the XHR's referrer.
   inner.history.pushState('', '', Math.random());
   referrer = inner.doXHR();
-  is (referrer, inner.document.location, 'Expected inner frame location after pushstate');
+  is (referrer, String(inner.document.location), 'Expected inner frame location after pushstate');
 
   innerFinishedLoading = true;
 }
 
 var dataWindowFinishedLoading = false;
 function dataWindowLoaded() {
   dataWindowFinishedLoading = true;
 }
 
 function callXHR() {
   if (innerFinishedLoading && dataWindowFinishedLoading) {
     var inner = document.getElementById('iframe').contentWindow;
     var referrer = inner.doXHR();
-    is (referrer, inner.document.location,
+    is (referrer, String(inner.document.location),
         'Expected inner frame location when called from outer frame.');
 
     var referrer = inner.doXHR(new XMLHttpRequest());
-    is (referrer, document.location,
+    is (referrer, String(document.location),
         "Expected outer frame location when called with outer's XHR object.");
 
     // Now do a request within the inner window using an XMLHttpRequest
     // retrieved from a data: URI.  The referrer should be this window, not the
     // data: URI.
     var dataWindow = document.getElementById('dataWindow').contentWindow;
     var referrer = inner.doXHR(dataWindow.getXHRObject());
-    is (referrer, document.location,
+    is (referrer, String(document.location),
         "Expected outer frame location when called with data's XHR object.");
 
     // Now do that test again, but after having changed the outer window's URI.
     // This currently fails, due to basically bug 631949.  It's not even clear
     // what the right behavior is.  So marking as a todo for now.
     history.replaceState('', '', Math.random());
 
     var referrer = inner.doXHR(dataWindow.getXHRObject());
-    todo_is (referrer, document.location,
+    todo_is (referrer, String(document.location),
              "Expected outer frame location when called with data's XHR object " +
              "after replaceState.");
 
     // In case you're temped, you probably don't want to do history.pushState
     // here and test again with the outer frame.  Calling pushState on the
     // outer frame messes up Mochitest in subtle ways.
 
     history.replaceState('', '', kOriginalLocation);
--- a/dom/base/test/test_domrequesthelper.xul
+++ b/dom/base/test/test_domrequesthelper.xul
@@ -38,35 +38,35 @@
     };
 
     var dummy = new DummyHelperSubclass();
 
     /**
      * Init & destroy.
      */
     function initDOMRequestHelperTest(aMessages) {
-      is(dummy._requests, undefined, "Request is undefined");
+      is_loosely(dummy._requests, undefined, "Request is undefined");
       is(dummy._messages, undefined, "Messages is undefined");
-      is(dummy._window, undefined, "Window is undefined");
+      is_loosely(dummy._window, undefined, "Window is undefined");
 
       dummy.initDOMRequestHelper(window, aMessages);
 
       ok(dummy._window, "Window exists");
       is(dummy._window, window, "Correct window");
       if (aMessages) {
         is(typeof dummy._listeners, "object", "Listeners is an object");
       }
     }
 
     function destroyDOMRequestHelperTest() {
       dummy.destroyDOMRequestHelper();
 
-      is(dummy._requests, undefined, "Request is undefined");
+      is_loosely(dummy._requests, undefined, "Request is undefined");
       is(dummy._messages, undefined, "Messages is undefined");
-      is(dummy._window, undefined, "Window is undefined");
+      is_loosely(dummy._window, undefined, "Window is undefined");
     }
 
     /**
      * Message listeners.
      */
     function checkMessageListeners(aExpectedListeners, aCount) {
       info("Checking message listeners\n" + "Expected listeners " +
            JSON.stringify(aExpectedListeners) + " \nExpected count " + aCount);
@@ -383,17 +383,17 @@
         info("== Test getRequestId(), removeRequest() and getRequest()");
         var req = dummy.createRequest();
         var id = dummy.getRequestId(req);
         is(typeof id, "string", "id is a string");
         var req_ = dummy.getRequest(id);
         is(req, req_, "Got correct request");
         dummy.removeRequest(id);
         req = dummy.getRequest(id);
-        is(req, null, "No request");
+        is(req, undefined, "No request");
         next();
       },
       function() {
         info("== Test createPromise()");
         ok(Promise, "Promise object exists");
         var promise = dummy.createPromise(function(resolve, reject) {
           resolve(true);
         });
--- a/dom/base/test/test_url.html
+++ b/dom/base/test/test_url.html
@@ -306,17 +306,17 @@
 
     url = new URL("http://localhost/");
     url.hostname = "[::]";
     is(url.hostname, "[::]", "IPv6 hostname");
 
     url = new URL("http://localhost/");
     url.host = "[2001::1]:30";
     is(url.hostname, "[2001::1]", "IPv6 hostname");
-    is(url.port, 30, "Port");
+    is(url.port, "30", "Port");
     is(url.host, "[2001::1]:30", "IPv6 host");
 
     url = new URL("http://localhost/");
     // This should silently fail since it's missing the brackets
     url.hostname = "2001::1";
     is(url.hostname, "localhost", "Setting bad hostname fails");
   </script>
 
--- a/dom/base/test/test_url_empty_port.html
+++ b/dom/base/test/test_url_empty_port.html
@@ -19,33 +19,33 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 </pre>
   <a id="link" href="http://www.example.com:8080">foobar</a>
   <area id="area" href="http://www.example.com:8080" />
   <script type="application/javascript">
 
   var url = new URL('http://www.example.com:8080');
-  is(url.port, 8080, 'URL.port is 8080');
+  is(url.port, '8080', 'URL.port is 8080');
   url.port = '';
   ise(url.port, '', 'URL.port is \'\'');
   url.port = 0;
   ise(url.port, '0', 'URL.port is 0');
 
   var link = document.getElementById("link");
-  is(link.port, 8080, 'URL.port is 8080');
+  is(link.port, '8080', 'URL.port is 8080');
   link.port = '';
   is(link.href, 'http://www.example.com/', "link.href matches");
   ise(link.port, '', 'URL.port is \'\'');
   link.port = 0;
   is(link.href, 'http://www.example.com:0/', "link.href matches");
   ise(link.port, '0', 'URL.port is 0');
 
   var area = document.getElementById("area");
-  is(area.port, 8080, 'URL.port is 8080');
+  is(area.port, '8080', 'URL.port is 8080');
   area.port = '';
   is(area.href, 'http://www.example.com/', "area.href matches");
   ise(area.port, '', 'URL.port is \'\'');
   area.port = 0;
   is(area.href, 'http://www.example.com:0/', "area.href matches");
   ise(area.port, '0', 'URL.port is 0');
 
   </script>
--- a/dom/browser-element/mochitest/browserElement_PromptCheck.js
+++ b/dom/browser-element/mochitest/browserElement_PromptCheck.js
@@ -17,17 +17,17 @@ browserElementTestHelpers.addPermission(
 function runTest()
 {
   var iframe = document.createElement('iframe');
   iframe.setAttribute('mozbrowser', 'true');
   document.body.appendChild(iframe);
 
   var numPrompts = 0;
   iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    is(e.detail.message, numPrompts, "prompt message");
+    is(e.detail.message, String(numPrompts), "prompt message");
     if (numPrompts / 10 < 1) {
       is(e.detail.promptType, 'alert');
     }
     else if (numPrompts / 10 < 2) {
       is(e.detail.promptType, 'confirm');
     }
     else {
       is(e.detail.promptType, 'prompt');
--- a/dom/browser-element/mochitest/browserElement_PromptConfirm.js
+++ b/dom/browser-element/mochitest/browserElement_PromptConfirm.js
@@ -13,25 +13,25 @@ browserElementTestHelpers.setEnabledPref
 browserElementTestHelpers.addPermission();
 
 function runTest() {
   var iframe = document.createElement('iframe');
   iframe.setAttribute('mozbrowser', 'true');
   document.body.appendChild(iframe);
 
   var prompts = [
-    {msg: 1, type: 'alert', rv: 42, expected: 'undefined'},
-    {msg: 2, type: 'confirm', rv: true, expected: 'true'},
-    {msg: 3, type: 'confirm', rv: false, expected: 'false'},
+    {msg: '1', type: 'alert', rv: 42, expected: 'undefined'},
+    {msg: '2', type: 'confirm', rv: true, expected: 'true'},
+    {msg: '3', type: 'confirm', rv: false, expected: 'false'},
 
     // rv == 42 should be coerced to 'true' for confirm.
-    {msg: 4, type: 'confirm', rv: 42, expected: 'true'},
-    {msg: 5, type: 'prompt', rv: 'worked', expected: 'worked'},
-    {msg: 6, type: 'prompt', rv: null, expected: 'null'},
-    {msg: 7, type: 'prompt', rv: '', expected: ''}
+    {msg: '4', type: 'confirm', rv: 42, expected: 'true'},
+    {msg: '5', type: 'prompt', rv: 'worked', expected: 'worked'},
+    {msg: '6', type: 'prompt', rv: null, expected: 'null'},
+    {msg: '7', type: 'prompt', rv: '', expected: ''}
   ];
 
   iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     var curPrompt = prompts[0];
     if (!curPrompt.waitingForResponse) {
       curPrompt.waitingForResponse = true;
 
       is(e.detail.message, curPrompt.msg, "prompt message");
--- a/dom/browser-element/mochitest/browserElement_ReloadPostRequest.js
+++ b/dom/browser-element/mochitest/browserElement_ReloadPostRequest.js
@@ -95,17 +95,17 @@ function runTest() {
       is(e.detail.returnValue.checked, undefined);
       is(e.detail.buttons[0].messageType, 'custom');
       is(e.detail.buttons[0].message, expectedMessage.resend);
       is(e.detail.buttons[1].messageType, 'builtin');
       is(e.detail.buttons[1].message, 'cancel');
       is(e.detail.message, expectedMessage.message);
       is(e.detail.buttons.length, 2);
       is(e.detail.showCheckbox, false);
-      is(e.detail.checkMessage, null);
+      is(e.detail.checkboxMessage, null);
       e.detail.unblock();
 
       if (!doRepost) {
         // To make sure the page doesn't reload in 1 sec.
         timer = window.setTimeout(function() {
           iframe.removeEventListener('mozbrowserloadend', failBecauseReloaded);
           SimpleTest.finish();
         }, 1000);
--- a/dom/browser-element/mochitest/priority/test_ForegroundLRU.html
+++ b/dom/browser-element/mochitest/priority/test_ForegroundLRU.html
@@ -47,26 +47,26 @@ function runTest() {
     document.body.appendChild(iframe2);
 
     return p;
   }).then(function() {
     // Then wait for the third one and for the first one's LRU value to be
     // increased by one.
     var p = Promise.all([
       expectProcessCreated('FOREGROUND'),
-      expectPriorityWithLRUSet(childID, 'FOREGROUND', 1)
+      expectPriorityWithLRUSet(childID, 'FOREGROUND', '1')
     ]);
 
     document.body.appendChild(iframe2);
 
     return p;
   }).then(function() {
     // Now hide the second and third processes, this will send them into the
     // background and make the first process LRU value to be decreased.
-    var p = expectPriorityWithLRUSet(childID, 'FOREGROUND', 0)
+    var p = expectPriorityWithLRUSet(childID, 'FOREGROUND', '0')
 
     iframe2.setVisible(false);
 
     return p;
   }).then(function() {
     SimpleTest.finish();
   });
 
--- a/dom/contacts/tests/test_contacts_basics.html
+++ b/dom/contacts/tests/test_contacts_basics.html
@@ -145,25 +145,25 @@ var steps = [
     req.onsuccess = function () {
       is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(createResult1, properties1);
       // Some manual testing. Testint the testfunctions
       // tel: [{type: ["work"], value: "123456", carrier: "testCarrier"} , {type: ["home", "fax"], value: "+55 (31) 9876-3456"}],
       is(findResult1.tel[0].carrier, "testCarrier", "Same Carrier");
-      is(findResult1.tel[0].type, "work", "Same type");
+      is(String(findResult1.tel[0].type), "work", "Same type");
       is(findResult1.tel[0].value, "123456", "Same Value");
       is(findResult1.tel[1].type[1], "fax", "Same type");
       is(findResult1.tel[1].value, "+55 (31) 9876-3456", "Same Value");
 
       is(findResult1.adr[0].countryName, "country 1", "Same country");
 
       // email: [{type: ["work"], value: "x@y.com"}]
-      is(findResult1.email[0].type, "work", "Same Type");
+      is(String(findResult1.email[0].type), "work", "Same Type");
       is(findResult1.email[0].value, "x@y.com", "Same Value");
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Searching for exact email");
     var options = {filterBy: ["email"],
--- a/dom/contacts/tests/test_contacts_basics2.html
+++ b/dom/contacts/tests/test_contacts_basics2.html
@@ -225,17 +225,17 @@ var steps = [
     ok(cloned.id != createResult1.id, "Cloned contact has new ID");
     cloned.email = [{value: "new email!"}];
     cloned.givenName = ["Tom"];
     req = mozContacts.save(cloned);
     req.onsuccess = function () {
       ok(cloned.id, "The contact now has an ID.");
       is(cloned.email[0].value, "new email!", "Same Email");
       isnot(createResult1.email[0].value, cloned.email[0].value, "Clone has different email");
-      is(cloned.givenName, "Tom", "New Name");
+      is(String(cloned.givenName), "Tom", "New Name");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts");
     var options = {filterBy: ["givenName"],
                    filterOp: "startsWith",
--- a/dom/events/test/test_bug689564.html
+++ b/dom/events/test/test_bug689564.html
@@ -26,17 +26,17 @@ is(div.onclick.toString(), "function onc
 
 div.setAttribute("onscroll", "div");
 is(window.onscroll, null, "div should not forward onscroll");
 is(div.onscroll.toString(), "function onscroll(event) {\ndiv\n}",
    "div should have an onscroll handler");
 
 div.setAttribute("onpopstate", "div");
 is(window.onpopstate, null, "div should not forward onpopstate");
-is(div.onpopstate, null, "div should not have onpopstate handler");
+is("onpopstate" in div, false, "div should not have onpopstate handler");
 
 var body = document.createElement("body");
 body.setAttribute("onclick", "body");
 is(window.onclick, null, "body should not forward onclick");
 is(body.onclick.toString(), "function onclick(event) {\nbody\n}",
    "body should have an onclick handler");
 body.setAttribute("onscroll", "body");
 is(window.onscroll.toString(), "function onscroll(event) {\nbody\n}",
--- a/dom/events/test/test_dragstart.html
+++ b/dom/events/test/test_dragstart.html
@@ -163,17 +163,17 @@ function test_DataTransfer(dt)
   dt.getData("text/plain", "", "empty setDataAt index too high getData");
 
   // if the type is '', do nothing, or return ''
   dt.setData("", "Invalid Type");
   is(dt.types.length, 0, "invalid type setData");
   is(dt.getData(""), "", "invalid type getData"),
   dt.mozSetDataAt("", "Invalid Type", 0);
   is(dt.types.length, 0, "invalid type setDataAt");
-  is(dt.mozGetDataAt("", 0), null, "invalid type getDataAt"),
+  is(dt.mozGetDataAt("", 0), undefined, "invalid type getDataAt"),
 
   // similar with clearDataAt and getDataAt
   expectError(function() dt.mozGetDataAt("text/plain", 1),
               "IndexSizeError", "getDataAt index too high");
   expectError(function() dt.mozClearDataAt("text/plain", 1),
               "IndexSizeError", "clearDataAt index too high");
 
   dt.setData("text/plain", "Sample Text");
@@ -496,18 +496,18 @@ function onDragStartDraggable(event)
   gExtraDragTests++;
 }
 
 function checkOneDataItem(dt, expectedtypes, expecteddata, index, testid)
 {
   checkTypes(dt, expectedtypes, index, testid);
   for (var f = 0; f < expectedtypes.length; f++) {
     if (index == 0)
-      is(dt.getData(expectedtypes[f]), expecteddata[f], testid + " getData " + expectedtypes[f]);
-    is(dt.mozGetDataAt(expectedtypes[f], index), expecteddata[f] ? expecteddata[f] : null,
+      is_loosely(dt.getData(expectedtypes[f]), expecteddata[f], testid + " getData " + expectedtypes[f]);
+    is_loosely(dt.mozGetDataAt(expectedtypes[f], index), expecteddata[f] ? expecteddata[f] : null,
        testid + " getDataAt " + expectedtypes[f]);
   }
 }
 
 function checkTypes(dt, expectedtypes, index, testid)
 {
   if (index == 0) {
     var types = dt.types;
--- a/dom/events/test/test_messageEvent.html
+++ b/dom/events/test/test_messageEvent.html
@@ -34,17 +34,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
       var e = new MessageEvent('message', test);
       ok(e, "MessageEvent created");
       is(e.type, 'message', 'MessageEvent.type is right');
 
       is(e.data, 'data' in test ? test.data : undefined, 'MessageEvent.data is ok');
       is(e.origin, 'origin' in test ? test.origin : '', 'MessageEvent.origin is ok');
       is(e.lastEventId, 'lastEventId' in test ? test.lastEventId : '', 'MessageEvent.lastEventId is ok');
-      is(e.source, 'source' in test ? test.source : undefined, 'MessageEvent.source is ok');
+      is(e.source, 'source' in test ? test.source : null, 'MessageEvent.source is ok');
 
       if (test.ports != undefined) {
         is(e.ports.length, test.ports.length, 'MessageEvent.ports is ok');
         is(e.ports, e.ports, 'MessageEvent.ports is ok');
       } else {
         ok(!('ports' in test) || test.ports == null, 'MessageEvent.ports is ok');
       }
     }
--- a/dom/html/test/forms/test_change_event.html
+++ b/dom/html/test/forms/test_change_event.html
@@ -177,25 +177,25 @@ https://bugzilla.mozilla.org/show_bug.cg
     is(numberChange, 0, "Change event shouldn't be dispatched on number input element for key changes that don't change its value");
     number.value = "";
     number.focus();
     synthesizeKey("1", {});
     synthesizeKey("2", {});
     is(numberChange, 0, "Change event shouldn't be dispatched on number input element for keyboard input until it loses focus");
     number.blur();
     is(numberChange, 1, "Change event should be dispatched on number input element on blur");
-    is(number.value, 12, "Sanity check that number keys were actually handled");
+    is(number.value, "12", "Sanity check that number keys were actually handled");
     if (isDesktop) { // up/down arrow keys not supported on android/b2g
       number.value = "";
       number.focus();
       synthesizeKey("VK_UP", {});
       synthesizeKey("VK_UP", {});
       synthesizeKey("VK_DOWN", {});
       is(numberChange, 4, "Change event should be dispatched on number input element for up/down arrow keys (a special case)");
-      is(number.value, 1, "Sanity check that number and arrow keys were actually handled");
+      is(number.value, "1", "Sanity check that number and arrow keys were actually handled");
     }
 
     // Special case type=range
     var range = document.getElementById("input_range");
     range.focus();
     synthesizeKey("a", {});
     range.blur();
     is(rangeChange, 0, "Change event shouldn't be dispatched on range input element for key changes that don't change its value");
--- a/dom/html/test/forms/test_input_event.html
+++ b/dom/html/test/forms/test_input_event.html
@@ -186,21 +186,21 @@ https://bugzilla.mozilla.org/show_bug.cg
     // are tested in test_input_number_mouse_events.html
     var number = document.getElementById("input_number");
 
     if (isDesktop) { // up/down arrow keys not supported on android/b2g
       number.value = "";
       number.focus();
       synthesizeKey("KEY_ArrowUp", { code: "ArrowUp" });
       is(numberInput, 1, "input event should be dispatched for up/down arrow key keypress");
-      is(number.value, 1, "sanity check value of number control after keypress");
+      is(number.value, "1", "sanity check value of number control after keypress");
 
       synthesizeKey("KEY_ArrowDown", { code: "ArrowDown", repeat: 3 });
       is(numberInput, 4, "input event should be dispatched for each up/down arrow key keypress event, even when rapidly repeated");
-      is(number.value, -2, "sanity check value of number control after multiple keydown events");
+      is(number.value, "-2", "sanity check value of number control after multiple keydown events");
 
       number.blur();
       is(numberInput, 4, "input event shouldn't be dispatched on blur");
     }
 
     MockFilePicker.cleanup();
     SimpleTest.finish();
   }
--- a/dom/html/test/forms/test_input_number_key_events.html
+++ b/dom/html/test/forms/test_input_number_key_events.html
@@ -154,83 +154,83 @@ function test() {
   var defaultValue = 0;
   var oldVal, expectedVal;
 
   for (key of ["VK_UP", "VK_DOWN"]) {
     // Start at middle:
     oldVal = elem.value = -1;
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for number control with value set between min/max (" + oldVal + ")");
+    is(elem.value, String(expectedVal), "Test " + key + " for number control with value set between min/max (" + oldVal + ")");
 
     // Same again:
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test repeat of " + key + " for number control");
+    is(elem.value, String(expectedVal), "Test repeat of " + key + " for number control");
 
     // Start at maximum:
     oldVal = elem.value = elem.max;
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for number control with value set to the maximum (" + oldVal + ")");
+    is(elem.value, String(expectedVal), "Test " + key + " for number control with value set to the maximum (" + oldVal + ")");
 
     // Same again:
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test repeat of " + key + " for number control");
+    is(elem.value, String(expectedVal), "Test repeat of " + key + " for number control");
 
     // Start at minimum:
     oldVal = elem.value = elem.min;
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for number control with value set to the minimum (" + oldVal + ")");
+    is(elem.value, String(expectedVal), "Test " + key + " for number control with value set to the minimum (" + oldVal + ")");
 
     // Same again:
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test repeat of " + key + " for number control");
+    is(elem.value, String(expectedVal), "Test repeat of " + key + " for number control");
 
     // Test preventDefault():
     elem.addEventListener("keypress", function(evt) {
       evt.preventDefault();
       elem.removeEventListener("keypress", arguments.callee, false);
     }, false);
     oldVal = elem.value = 0;
     expectedVal = 0;
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for number control where scripted preventDefault() should prevent the value changing");
+    is(elem.value, String(expectedVal), "Test " + key + " for number control where scripted preventDefault() should prevent the value changing");
 
     // Test step="any" behavior:
     var oldStep = elem.step;
     elem.step = "any";
     oldVal = elem.value = 0;
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for number control with value set to the midpoint and step='any' (" + oldVal + ")");
+    is(elem.value, String(expectedVal), "Test " + key + " for number control with value set to the midpoint and step='any' (" + oldVal + ")");
     elem.step = oldStep; // restore
 
     // Test that invalid input blocks UI initiated stepping:
     oldVal = elem.value = "";
     elem.select();
     sendString("abc");
     synthesizeKey(key, {});
     is(elem.value, "", "Test " + key + " does nothing when the input is invalid");
 
     // Test that no value does not block UI initiated stepping:
     oldVal = elem.value = "";
     elem.setAttribute("required", "required");
     elem.select();
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for number control with value set to the empty string and with the 'required' attribute set");
+    is(elem.value, String(expectedVal), "Test " + key + " for number control with value set to the empty string and with the 'required' attribute set");
 
     // Same again:
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test repeat of " + key + " for number control");
+    is(elem.value, String(expectedVal), "Test repeat of " + key + " for number control");
 
     // Reset 'required' attribute:
     elem.removeAttribute("required");
   }
 
   // Test that key events are correctly dispatched
   elem.max = "";
   elem.value = "";
--- a/dom/html/test/forms/test_input_number_l10n.html
+++ b/dom/html/test/forms/test_input_number_l10n.html
@@ -35,23 +35,23 @@ SimpleTest.waitForFocus(function() {
 var elem;
 
 function runTest(test) {
   elem.lang = test.langTag;
   elem.value = 0;
   elem.focus();
   elem.select();
   sendString(test.inputWithGrouping);
-  is(elem.value, test.value, "Test " + test.desc + " ('" + test.langTag +
-                             "') localization with grouping separator");
+  is(elem.value, String(test.value), "Test " + test.desc + " ('" + test.langTag +
+                                     "') localization with grouping separator");
   elem.value = 0;
   elem.select();
   sendString(test.inputWithoutGrouping);
-  is(elem.value, test.value, "Test " + test.desc + " ('" + test.langTag +
-                             "') localization without grouping separator");
+  is(elem.value, String(test.value), "Test " + test.desc + " ('" + test.langTag +
+                                     "') localization without grouping separator");
 }
 
 function startTests() {
   elem = document.getElementById("input");
   for (var test of tests) {
     runTest(test, elem);
   }
 }
--- a/dom/html/test/forms/test_input_number_mouse_events.html
+++ b/dom/html/test/forms/test_input_number_mouse_events.html
@@ -48,50 +48,50 @@ const SPIN_UP_Y = 3;
 const SPIN_DOWN_X = inputRect.width - 3;
 const SPIN_DOWN_Y = inputRect.height - 3;
 
 function test() {
   input.value = 0;
 
   // Test click on spin-up button:
   synthesizeMouse(input, SPIN_UP_X, SPIN_UP_Y, { type: "mousedown" });
-  is(input.value, 1, "Test step-up on mousedown on spin-up button");
+  is(input.value, "1", "Test step-up on mousedown on spin-up button");
   synthesizeMouse(input, SPIN_UP_X, SPIN_UP_Y, { type: "mouseup" });
-  is(input.value, 1, "Test mouseup on spin-up button");
+  is(input.value, "1", "Test mouseup on spin-up button");
 
   // Test click on spin-down button:
   synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, { type: "mousedown" });
-  is(input.value, 0, "Test step-down on mousedown on spin-down button");
+  is(input.value, "0", "Test step-down on mousedown on spin-down button");
   synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, { type: "mouseup" });
-  is(input.value, 0, "Test mouseup on spin-down button");
+  is(input.value, "0", "Test mouseup on spin-down button");
 
   // Test step="any" behavior:
   input.value = 0;
   var oldStep = input.step;
   input.step = "any";
   synthesizeMouse(input, SPIN_UP_X, SPIN_UP_Y, { type: "mousedown" });
-  is(input.value, 1, "Test step-up on mousedown on spin-up button with step='any'");
+  is(input.value, "1", "Test step-up on mousedown on spin-up button with step='any'");
   synthesizeMouse(input, SPIN_UP_X, SPIN_UP_Y, { type: "mouseup" });
-  is(input.value, 1, "Test mouseup on spin-up button with step='any'");
+  is(input.value, "1", "Test mouseup on spin-up button with step='any'");
   synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, { type: "mousedown" });
-  is(input.value, 0, "Test step-down on mousedown on spin-down button with step='any'");
+  is(input.value, "0", "Test step-down on mousedown on spin-down button with step='any'");
   synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, { type: "mouseup" });
-  is(input.value, 0, "Test mouseup on spin-down button with step='any'");
+  is(input.value, "0", "Test mouseup on spin-down button with step='any'");
   input.step = oldStep; // restore
 
   // Test that preventDefault() works:
   function preventDefault(e) {
     e.preventDefault();
   }
   input.value = 1;
   input.addEventListener("mousedown", preventDefault, false);
   synthesizeMouse(input, SPIN_UP_X, SPIN_UP_Y, {});
-  is(input.value, 1, "Test that preventDefault() works for click on spin-up button");
+  is(input.value, "1", "Test that preventDefault() works for click on spin-up button");
   synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, {});
-  is(input.value, 1, "Test that preventDefault() works for click on spin-down button");
+  is(input.value, "1", "Test that preventDefault() works for click on spin-down button");
   input.removeEventListener("mousedown", preventDefault, false);
 
   // Run the spin tests:
   runNextSpinTest();
 }
 
 function runNextSpinTest() {
   var test = spinTests.shift();
@@ -108,40 +108,40 @@ var spinTests = [
   // Test spining when the mouse button is kept depressed on the spin-up
   // button, then moved over the spin-down button:
   function() {
     var inputEventCount = 0;
     input.value = 0;
     input.addEventListener("input", function(evt) {
       ++inputEventCount;
       if (inputEventCount == 3) {
-        ok(input.value, 3, "Testing spin-up button");
+        is(input.value, "3", "Testing spin-up button");
         synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, { type: "mousemove" });
       } else if (inputEventCount == 6) {
-        ok(input.value, 0, "Testing spin direction is reversed after mouse moves from spin-up button to spin-down button");
+        is(input.value, "0", "Testing spin direction is reversed after mouse moves from spin-up button to spin-down button");
         input.removeEventListener("input", arguments.callee, false);
         synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, { type: "mouseup" });
         runNextSpinTest();
       }
     }, false);
     synthesizeMouse(input, SPIN_UP_X, SPIN_UP_Y, { type: "mousedown" });
   },
 
   // Test spining when the mouse button is kept depressed on the spin-down
   // button, then moved over the spin-up button:
   function() {
     var inputEventCount = 0;
     input.value = 0;
     input.addEventListener("input", function(evt) {
       ++inputEventCount;
       if (inputEventCount == 3) {
-        ok(input.value, -3, "Testing spin-down button");
+        is(input.value, "-3", "Testing spin-down button");
         synthesizeMouse(input, SPIN_UP_X, SPIN_UP_Y, { type: "mousemove" });
       } else if (inputEventCount == 6) {
-        ok(input.value, 0, "Testing spin direction is reversed after mouse moves from spin-down button to spin-up button");
+        is(input.value, "0", "Testing spin direction is reversed after mouse moves from spin-down button to spin-up button");
         input.removeEventListener("input", arguments.callee, false);
         synthesizeMouse(input, SPIN_UP_X, SPIN_UP_Y, { type: "mouseup" });
         runNextSpinTest();
       }
     }, false);
     synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, { type: "mousedown" });
   },
 
@@ -151,18 +151,18 @@ var spinTests = [
     var inputEventCount = 0;
     input.value = 0;
     input.addEventListener("input", function(evt) {
       ++inputEventCount;
       if (inputEventCount == 3) {
         synthesizeMouse(input, -1, -1, { type: "mousemove" });
         var eventHandler = arguments.callee;
         setTimeout(function() {
-          ok(input.value, 3, "Testing moving the mouse outside the spin buttons stops the spin");
-          ok(inputEventCount, 3, "Testing moving the mouse outside the spin buttons stops the spin input events");
+          is(input.value, "3", "Testing moving the mouse outside the spin buttons stops the spin");
+          is(inputEventCount, 3, "Testing moving the mouse outside the spin buttons stops the spin input events");
           input.removeEventListener("input", eventHandler, false);
           synthesizeMouse(input, -1, -1, { type: "mouseup" });
           runNextSpinTest();
         }, SETTIMEOUT_DELAY);
       }
     }, false);
     synthesizeMouse(input, SPIN_UP_X, SPIN_UP_Y, { type: "mousedown" });
   },
@@ -172,18 +172,18 @@ var spinTests = [
     var inputEventCount = 0;
     input.value = 0;
     input.addEventListener("input", function(evt) {
       ++inputEventCount;
       if (inputEventCount == 3) {
         input.type = "text"
         var eventHandler = arguments.callee;
         setTimeout(function() {
-          ok(input.value, 3, "Testing changing input type during a spin stops the spin");
-          ok(inputEventCount, 3, "Testing changing input type during a spin stops the spin input events");
+          is(input.value, "-3", "Testing changing input type during a spin stops the spin");
+          is(inputEventCount, 3, "Testing changing input type during a spin stops the spin input events");
           input.removeEventListener("input", eventHandler, false);
           synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, { type: "mouseup" });
           input.type = "number"; // restore
           runNextSpinTest();
         }, SETTIMEOUT_DELAY);
       }
     }, false);
     synthesizeMouse(input, SPIN_DOWN_X, SPIN_DOWN_Y, { type: "mousedown" });
--- a/dom/html/test/forms/test_input_range_key_events.html
+++ b/dom/html/test/forms/test_input_range_key_events.html
@@ -153,56 +153,56 @@ function test() {
     elem.step = "2";
     elem.style.direction = dir;
     var flush = document.body.clientWidth;
 
     // Start at middle:
     elem.value = oldVal = defaultValue(elem);
     expectedVal = expectedFunc(elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for " + dir + " range with value set to the midpoint (" + oldVal + ")");
+    is(elem.value, String(expectedVal), "Test " + key + " for " + dir + " range with value set to the midpoint (" + oldVal + ")");
 
     // Same again:
     expectedVal = expectedFunc(elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test repeat of " + key + " for " + dir + " range");
+    is(elem.value, String(expectedVal), "Test repeat of " + key + " for " + dir + " range");
 
     // Start at maximum:
     elem.value = oldVal = maximum(elem);
     expectedVal = expectedFunc(elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for " + dir + " range with value set to the maximum (" + oldVal + ")");
+    is(elem.value, String(expectedVal), "Test " + key + " for " + dir + " range with value set to the maximum (" + oldVal + ")");
 
     // Same again:
     expectedVal = expectedFunc(elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test repeat of " + key + " for " + dir + " range");
+    is(elem.value, String(expectedVal), "Test repeat of " + key + " for " + dir + " range");
 
     // Start at minimum:
     elem.value = oldVal = minimum(elem);
     expectedVal = expectedFunc(elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for " + dir + " range with value set to the minimum (" + oldVal + ")");
+    is(elem.value, String(expectedVal), "Test " + key + " for " + dir + " range with value set to the minimum (" + oldVal + ")");
 
     // Same again:
     expectedVal = expectedFunc(elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test repeat of " + key + " for " + dir + " range");
+    is(elem.value, String(expectedVal), "Test repeat of " + key + " for " + dir + " range");
 
     // Test for a step value that is greater than 10% of the range:
     elem.step = 20;
     elem.value = 60;
     expectedVal = expectedFunc(elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for " + dir + " range with a step that is greater than 10% of the range (step=" + elem.step + ")");
+    is(elem.value, String(expectedVal), "Test " + key + " for " + dir + " range with a step that is greater than 10% of the range (step=" + elem.step + ")");
 
     // Same again:
     expectedVal = expectedFunc(elem);
     synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test repeat of " + key + " for " + dir + " range");
+    is(elem.value, String(expectedVal), "Test repeat of " + key + " for " + dir + " range");
 
     // reset step:
     elem.step = 2;
   }
 }
 
 </script>
 </pre>
--- a/dom/html/test/forms/test_input_range_mouse_and_touch_events.html
+++ b/dom/html/test/forms/test_input_range_mouse_and_touch_events.html
@@ -38,21 +38,21 @@ https://bugzilla.mozilla.org/show_bug.cg
  **/
 SimpleTest.waitForExplicitFinish();
 SimpleTest.waitForFocus(function() {
   test(synthesizeMouse, "click", "mousedown", "mousemove", "mouseup");
   test(synthesizeTouch, "tap", "touchstart", "touchmove", "touchend");
   SimpleTest.finish();
 });
 
-const MIDDLE_OF_RANGE = 50;
-const MINIMUM_OF_RANGE = 0;
-const MAXIMUM_OF_RANGE = 100;
-const QUARTER_OF_RANGE = 25;
-const THREE_QUARTERS_OF_RANGE = 75;
+const MIDDLE_OF_RANGE = "50";
+const MINIMUM_OF_RANGE = "0";
+const MAXIMUM_OF_RANGE = "100";
+const QUARTER_OF_RANGE = "25";
+const THREE_QUARTERS_OF_RANGE = "75";
 
 function flush() {
   // Flush style, specifically to flush the 'direction' property so that the
   // browser uses the new value for thumb positioning.
   var flush = document.body.clientWidth;
 }
 
 function test(synthesizeFunc, clickOrTap, startName, moveName, endName) {
--- a/dom/html/test/forms/test_label_input_controls.html
+++ b/dom/html/test/forms/test_label_input_controls.html
@@ -42,26 +42,26 @@ https://bugzilla.mozilla.org/show_bug.cg
       }
 
       function test(type, isLabelable) {
         inputH.type = type;
         if (isLabelable) {
           testControl(label,     inputH, type, true);
           testControl(labelForH, inputH, type, true);
         } else {
-          testControl(label,     inputI,    type, false);
-          testControl(labelForH, undefined, type, false);
+          testControl(label,     inputI, type, false);
+          testControl(labelForH, null,   type, false);
 
           inputH.type = "text";
           testControl(label,     inputH, "text", true);
           testControl(labelForH, inputH, "text", true);
 
           inputH.type = type;
-          testControl(label,     inputI,    type, false);
-          testControl(labelForH, undefined, type, false);
+          testControl(label,     inputI, type, false);
+          testControl(labelForH, null,   type, false);
 
           label.removeChild(inputH);
           testControl(label, inputI, "text", true);
 
           var element = document.createElement('input');
           element.type = type;
           label.insertBefore(element, inputI);
           testControl(label, inputI, "text", true);
--- a/dom/html/test/forms/test_meter_element.html
+++ b/dom/html/test/forms/test_meter_element.html
@@ -26,17 +26,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 function checkFormIDLAttribute(aElement)
 {
   is('form' in aElement, false, "<meter> shouldn't have a form attribute");
 }
 
 function checkAttribute(aElement, aAttribute, aNewValue, aExpectedValueForIDL)
 {
   var expectedValueForIDL = aNewValue;
-  var expectedValueForContent = aNewValue;
+  var expectedValueForContent = String(aNewValue);
 
   if (aExpectedValueForIDL !== undefined) {
     expectedValueForIDL = aExpectedValueForIDL;
   }
 
   if (aNewValue != null) {
     aElement.setAttribute(aAttribute, aNewValue);
     is(aElement.getAttribute(aAttribute), expectedValueForContent,
@@ -48,18 +48,18 @@ function checkAttribute(aElement, aAttri
       aElement[aAttribute] = aNewValue;
       is(aElement.getAttribute(aAttribute), expectedValueForContent,
          aAttribute + " content attribute should be " + expectedValueForContent);
       is(aElement[aAttribute], parseFloat(expectedValueForIDL),
          aAttribute + " IDL attribute should be " + parseFloat(expectedValueForIDL));
     }
   } else {
     aElement.removeAttribute(aAttribute);
-    is(aElement.getAttribute(aAttribute), expectedValueForContent,
-       aAttribute + " content attribute should be " + expectedValueForContent);
+    is(aElement.getAttribute(aAttribute), null,
+       aAttribute + " content attribute should be null");
     is(aElement[aAttribute], expectedValueForIDL,
        aAttribute + " IDL attribute should be " + expectedValueForIDL);
   }
 }
 
 function checkValueAttribute()
 {
   var tests = [
--- a/dom/html/test/forms/test_output_element.html
+++ b/dom/html/test/forms/test_output_element.html
@@ -101,22 +101,22 @@ function checkDescendantChanged(element)
 function checkFormIDLAttribute(element)
 {
   is(element.form, document.getElementById('f'),
     "form IDL attribute is invalid");
 }
 
 function checkHtmlForIDLAttribute(element)
 {
-  is(element.htmlFor, 'a b',
+  is(String(element.htmlFor), 'a b',
     "htmlFor IDL attribute should reflect the for content attribute");
 
   // DOMSettableTokenList is tested in another bug so we just test assignation
   element.htmlFor.value = 'a b c';
-  is(element.htmlFor, 'a b c', "htmlFor should have changed");
+  is(String(element.htmlFor), 'a b c', "htmlFor should have changed");
 }
 
 function submitForm()
 {
   // Setting the values for the submit.
   document.getElementById('o').value = 'foo';
   document.getElementById('a').value = 'afield';
   document.getElementById('b').value = 'bfield';
--- a/dom/html/test/forms/test_progress_element.html
+++ b/dom/html/test/forms/test_progress_element.html
@@ -30,17 +30,17 @@ SimpleTest.expectAssertions(0, 1);
 function checkFormIDLAttribute(aElement)
 {
   is("form" in aElement, false, "<progress> shouldn't have a form attribute");
 }
 
 function checkAttribute(aElement, aAttribute, aNewValue, aExpectedValueForIDL)
 {
   var expectedValueForIDL = aNewValue;
-  var expectedValueForContent = aNewValue;
+  var expectedValueForContent = String(aNewValue);
 
   if (aExpectedValueForIDL !== undefined) {
     expectedValueForIDL = aExpectedValueForIDL;
   }
 
   if (aNewValue != null) {
     aElement.setAttribute(aAttribute, aNewValue);
     is(aElement.getAttribute(aAttribute), expectedValueForContent,
@@ -52,18 +52,18 @@ function checkAttribute(aElement, aAttri
       aElement[aAttribute] = aNewValue;
       is(aElement.getAttribute(aAttribute), expectedValueForContent,
          aAttribute + " content attribute should be " + expectedValueForContent);
       is(aElement[aAttribute], parseFloat(expectedValueForIDL),
          aAttribute + " IDL attribute should be " + parseFloat(expectedValueForIDL));
     }
   } else {
     aElement.removeAttribute(aAttribute);
-    is(aElement.getAttribute(aAttribute), expectedValueForContent,
-       aAttribute + " content attribute should be " + expectedValueForContent);
+    is(aElement.getAttribute(aAttribute), null,
+       aAttribute + " content attribute should be null");
     is(aElement[aAttribute], expectedValueForIDL,
        aAttribute + " IDL attribute should be " + expectedValueForIDL);
   }
 }
 
 function checkValueAttribute()
 {
   var tests = [
--- a/dom/html/test/forms/test_step_attribute.html
+++ b/dom/html/test/forms/test_step_attribute.html
@@ -418,208 +418,208 @@ for (var test of data) {
       break;
     case 'range':
       // Range is special in that it clamps to valid values, so it is much
       // rarer for it to be invalid.
 
       // When step=0, the allowed value step is 1.
       input.step = '0';
       input.value = '1.2';
-      is(input.value, 1, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '1', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.value = '1';
-      is(input.value, 1, "check that the value coincides with a step");
+      is(input.value, '1', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = '0';
-      is(input.value, 0, "check that the value coincides with a step");
+      is(input.value, '0', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       // When step is NaN, the allowed step value is 1.
       input.step = 'foo';
       input.value = '1';
-      is(input.value, 1, "check that the value coincides with a step");
+      is(input.value, '1', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = '1.5';
-      is(input.value, 2, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '2', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       // When step is negative, the allowed step value is 1.
       input.step = '-0.1';
-      is(input.value, 2, "check that the value still coincides with a step");
+      is(input.value, '2', "check that the value still coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = '1';
-      is(input.value, 1, "check that the value coincides with a step");
+      is(input.value, '1', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       // When step is missing, the allowed step value is 1.
       input.removeAttribute('step');
       input.value = '1.5';
-      is(input.value, 2, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '2', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.value = '1';
-      is(input.value, 1, "check that the value coincides with a step");
+      is(input.value, '1', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       // When step is 'any', all values are fine wrt to step.
       input.step = 'any';
       checkValidity(input, true, apply);
 
       input.step = 'aNy';
       input.value = '97';
-      is(input.value, 97, "check that the value for step=aNy is unchanged");
+      is(input.value, '97', "check that the value for step=aNy is unchanged");
       checkValidity(input, true, apply);
 
       input.step = 'AnY';
       input.value = '0.1';
-      is(input.value, 0.1, "check that a positive fractional value with step=AnY is unchanged");
+      is(input.value, '0.1', "check that a positive fractional value with step=AnY is unchanged");
       checkValidity(input, true, apply);
 
       input.step = 'ANY';
       input.min = -100;
       input.value = '-13.37';
-      is(input.value, -13.37, "check that a negative fractional value with step=ANY is unchanged");
+      is(input.value, '-13.37', "check that a negative fractional value with step=ANY is unchanged");
       checkValidity(input, true, apply);
 
       // When min is set to a valid float, there is a step base.
       input.min = '1'; // the step base
       input.step = '2';
       input.value = '3';
-      is(input.value, 3, "check that the value coincides with a step");
+      is(input.value, '3', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = '2';
-      is(input.value, 3, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '3', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.value = '1.99';
-      is(input.value, 1, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '1', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.removeAttribute('step'); // step = 1
       input.min = '0.5'; // step base
       input.value = '5.5';
-      is(input.value, 5.5, "check that the value coincides with a step");
+      is(input.value, '5.5', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = '1';
-      is(input.value, 1.5, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '1.5', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.min = '-0.1'; // step base
       input.step = '1';
       input.value = '0.9';
-      is(input.value, 0.9, "the value should be a valid step");
+      is(input.value, '0.9', "the value should be a valid step");
       checkValidity(input, true, apply);
 
       input.value = '0.1';
-      is(input.value, -0.1, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '-0.1', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       // When min is set to NaN, the step base is the value.
       input.min = 'foo';
       input.step = '1';
       input.value = '1';
-      is(input.value, 1, "check that the value coincides with a step");
+      is(input.value, '1', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = '0.5';
-      is(input.value, 1, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '1', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.min = '';
       input.value = '1';
-      is(input.value, 1, "check that the value coincides with a step");
+      is(input.value, '1', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = '0.5';
-      is(input.value, 1, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '1', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.removeAttribute('min');
 
       // Test when the value isn't a number
       input.value = '';
-      is(input.value, 50, "value be should default to the value midway between the minimum (0) and the maximum (100)");
+      is(input.value, '50', "value be should default to the value midway between the minimum (0) and the maximum (100)");
       checkValidity(input, true, apply);
 
       // Regular situations.
       input.step = '2';
       input.value = '1.5';
-      is(input.value, 2, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '2', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.value = '42.0';
-      is(input.value, 42, "check that the value coincides with a step");
+      is(input.value, '42.0', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.step = '0.1';
       input.value = '-0.1';
-      is(input.value, 0, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '0', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.step = '2';
       input.removeAttribute('min');
       input.max = '10';
       input.value = '-9';
-      is(input.value, 0, "check the value is clamped to the minimum's default of zero");
+      is(input.value, '0', "check the value is clamped to the minimum's default of zero");
       checkValidity(input, true, apply);
 
       // If @value is defined but not @min, the step base is @value.
       input = getFreshElement(test.type);
       input.setAttribute('value', '1');
       input.step = 2;
-      is(input.value, 1, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '1', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       input.value = 3;
-      is(input.value, 3, "check that the value coincides with a step");
+      is(input.value, '3', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = 2;
-      is(input.value, 3, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '3', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       // Should also work with defaultValue.
       input = getFreshElement(test.type);
       input.defaultValue = 1;
       input.step = 2;
-      is(input.value, 1, "check that the value coincides with a step");
+      is(input.value, '1', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = 3;
-      is(input.value, 3, "check that the value coincides with a step");
+      is(input.value, '3', "check that the value coincides with a step");
       checkValidity(input, true, apply);
 
       input.value = 2;
-      is(input.value, 3, "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
+      is(input.value, '3', "check that the value changes to the nearest valid step, choosing the higher step if both are equally close");
       checkValidity(input, true, apply);
 
       // Check contrived error case where there are no valid steps in range:
       // No @min, so the step base is the default minimum, zero, the valid
       // range is 0-1, -1 gets clamped to zero.
       input = getFreshElement(test.type);
       input.step = '3';
       input.max = '1';
       input.defaultValue = '-1';
-      is(input.value, 0, "the value should have been clamped to the default minimum, zero");
+      is(input.value, '0', "the value should have been clamped to the default minimum, zero");
       checkValidity(input, false, apply, {low: -1, high: -1});
 
       // Check that when the closest of the two steps that the value is between
       // is greater than the maximum we sanitize to the lower step.
       input = getFreshElement(test.type);
       input.step = '2';
       input.min = '1';
       input.max = '10.9';
       input.value = '10.8'; // closest step in 11, but 11 > maximum
-      is(input.value, 9, "check that the value coincides with a step");
+      is(input.value, '9', "check that the value coincides with a step");
 
       // The way that step base is defined, the converse (the value not being
       // on a step, and the nearest step being a value that would be underflow)
       // is not possible, so nothing to test there.
 
       is(input.validationMessage, "",
          "The validation message should be empty.");
       break;
--- a/dom/html/test/forms/test_valueasdate_attribute.html
+++ b/dom/html/test/forms/test_valueasdate_attribute.html
@@ -180,19 +180,25 @@ function checkDateGet()
     element.value = data[0];
     is(element.valueAsDate.valueOf(), data[1],
        "valueAsDate should return the " +
        "valid date object representing this date");
   }
 
   for (data of invalidData) {
     element.value = data[0];
-    is(element.valueAsDate, data[1] ? "Invalid Date" : null,
-       "valueAsDate should return null "  +
-       "when the element value is not a valid date");
+    if (data[1]) {
+      is(String(element.valueAsDate), "Invalid Date",
+         "valueAsDate should return an invalid Date object "  +
+         "when the element value is not a valid date");
+    } else {
+      is(element.valueAsDate, null,
+         "valueAsDate should return null "  +
+         "when the element value is not a valid date");
+    }
   }
 
 }
 
 function checkDateSet()
 {
   var testData =
   [
--- a/dom/html/test/forms/test_valueasnumber_attribute.html
+++ b/dom/html/test/forms/test_valueasnumber_attribute.html
@@ -145,21 +145,21 @@ function checkNumberSet()
     [123.123456789123, "123.123456789123"], // double precision
     [1e2, "100"], // e should be usable
     [2e1, "20"],
     [1e-1, "0.1"], // value after e can be negative
     [1E2, "100"], // E can be used instead of e
     // Setting a string will set NaN.
     ["foo", ""],
     // "" is converted to 0.
-    ["", 0],
+    ["", "0"],
     [42, "42"], // Keep this here, it is used by the next test.
     // Setting Infinity should throw and not change the current value.
-    [Infinity, 42, true],
-    [-Infinity, 42, true],
+    [Infinity, "42", true],
+    [-Infinity, "42", true],
     // Setting NaN should change the value to the empty string.
     [NaN, ""],
   ];
 
   var element = document.createElement('input');
   element.type = "number";
   for (data of testData) {
     var caught = false;
@@ -220,17 +220,17 @@ function checkRangeGet()
        "floating point representation of the value");
   }
 }
 
 function checkRangeSet()
 {
   var min = -200;
   var max = 200;
-  var defaultValue = min + (max - min)/2;
+  var defaultValue = String(min + (max - min)/2);
 
   var testData =
   [
     [42, "42"],
     [-42, "-42"], // should work for negative values
     [42.1234, "42.1234"],
     [123.123456789123, "123.123456789123"], // double precision
     [1e2, "100"], // e should be usable
--- a/dom/html/test/test_bug1045270.html
+++ b/dom/html/test/test_bug1045270.html
@@ -29,17 +29,17 @@ https://bugzilla.mozilla.org/show_bug.cg
         document.body.style.display = "none";
         document.body.style.display = "";
         document.body.offsetLeft; // flush
       }, false);
       synthesizeKey("1", {});
       SimpleTest.executeSoon(function() {
         synthesizeKey("2", {});
         SimpleTest.executeSoon(function() {
-          is(input.value, 12, "Reframe should restore focus and selection properly");
+          is(input.value, "12", "Reframe should restore focus and selection properly");
           SimpleTest.finish();
         });
       });
     });
 
     </script>
     </pre>
   </body>
--- a/dom/html/test/test_bug332893-1.html
+++ b/dom/html/test/test_bug332893-1.html
@@ -20,19 +20,19 @@
       var form2 = document.getElementById("form2");
 	var newInput = document.createElement("input");
 	newInput.value = "13";
       form1.insertBefore(newInput, form1.firstChild);     
 	var F2I2 = document.getElementById("F2I2");
      	form2.insertBefore(newInput, F2I2);
 	form1.insertBefore(newInput, form1.firstChild);
 
-	is(form1.elements.length, "3", "Form 1 has the correct length");
+	is(form1.elements.length, 3, "Form 1 has the correct length");
 	is(form1.elements[0].value, "13", "Form 1 element 1 is correct");
 	is(form1.elements[1].value, "11", "Form 1 element 2 is correct");
 	is(form1.elements[2].value, "12", "Form 1 element 3 is correct");
 
-	is(form2.elements.length, "2", "Form 2 has the correct length");
+	is(form2.elements.length, 2, "Form 2 has the correct length");
 	is(form2.elements[0].value, "21", "Form 2 element 1 is correct");
 	is(form2.elements[1].value, "22", "Form 2 element 2 is correct");
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug332893-3.html
+++ b/dom/html/test/test_bug332893-3.html
@@ -40,19 +40,19 @@
 			  
 	var table2 = document.getElementById("table2");
 	table2.insertBefore(F1I0, table2.firstChild);
 	table2.insertBefore(F1I1, table2.firstChild);
               
 	var form1 = document.getElementById("form1");
 	var form2 = document.getElementById("form2");
 
-	is(form1.elements.length, "2", "Form 1 has the correct length");
+	is(form1.elements.length, 2, "Form 1 has the correct length");
 	is(form1.elements[0].value, "12", "Form 1 element 1 is correct");
 	is(form1.elements[1].value, "10", "Form 1 element 2 is correct");
 
-	is(form2.elements.length, "3", "Form 2 has the correct length");
+	is(form2.elements.length, 3, "Form 2 has the correct length");
 	is(form2.elements[0].value, "11", "Form 2 element 1 is correct");
 	is(form2.elements[1].value, "21", "Form 2 element 2 is correct");
 	is(form2.elements[2].value, "22", "Form 2 element 2 is correct");
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug332893-4.html
+++ b/dom/html/test/test_bug332893-4.html
@@ -11,17 +11,17 @@
    <input id="input3" type="input" name="input" value="3"/>
 </form>
 <script>
 	var input1 = document.getElementById("input1");
       var input2 = document.getElementById("input2");
       var form1 = document.getElementById("form1");
       form1.insertBefore(input2, input1);
 
-	is(form1.elements["input"].length, "3", "Form 1 'input' has the correct length");
+	is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length");
 	is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct");
 	is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct");
 	is(form1.elements["input"][2].value, "3", "Form 1 element 3 is correct");
 
 	is(form1.elements["input"][0].id, "input2", "Form 1 element 1 id is correct");
 	is(form1.elements["input"][1].id, "input1", "Form 1 element 2 id is correct");
 	is(form1.elements["input"][2].id, "input3", "Form 1 element 3 id is correct");
 </script>
--- a/dom/html/test/test_bug332893-5.html
+++ b/dom/html/test/test_bug332893-5.html
@@ -11,17 +11,17 @@
    <input id="input3" type="input" name="input" value="3"/>
 </form>
 <script>
 	var input1 = document.getElementById("input1");
       var input2 = document.getElementById("input");
       var form1 = document.getElementById("form1");
       form1.insertBefore(input2, input1);
 
-	is(form1.elements["input"].length, "3", "Form 1 'input' has the correct length");
+	is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length");
 	is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct");
 	is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct");
 	is(form1.elements["input"][2].value, "3", "Form 1 element 3 is correct");
 
 	is(form1.elements["input"][0].id, "input", "Form 1 element 1 id is correct");
 	is(form1.elements["input"][1].id, "input1", "Form 1 element 2 id is correct");
 	is(form1.elements["input"][2].id, "input3", "Form 1 element 3 id is correct");
 </script>
--- a/dom/html/test/test_bug332893-6.html
+++ b/dom/html/test/test_bug332893-6.html
@@ -11,17 +11,17 @@
    <input id="input3" type="input" name="input" value="3"/>
 </form>
 <script>
 	var input1 = document.getElementById("input1");
       var input2 = document.getElementById("input");
       var form1 = document.getElementById("form1");
       form1.insertBefore(input2, input1);
 
-	is(form1.elements["input"].length, "3", "Form 1 'input' has the correct length");
+	is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length");
 	is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct");
 	is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct");
 
 	is(form1.elements["input"][0].id, "input", "Form 1 element 1 id is correct");
 	is(form1.elements["input"][1].id, "input1", "Form 1 element 2 id is correct");
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug332893-7.html
+++ b/dom/html/test/test_bug332893-7.html
@@ -36,17 +36,17 @@
 
 	var form1 = document.getElementById("form1");
 
 	form1.insertBefore(input2, input1);
 	form1.insertBefore(input10, input6);
 	form1.insertBefore(input8, input4);
 	form1.insertBefore(input9, input2);
 
-	is(form1.elements["input"].length, "10", "Form 1 'input' has the correct length");
+	is(form1.elements["input"].length, 10, "Form 1 'input' has the correct length");
 	is(form1.elements["input"][0].value, "9", "Form 1 element 1 is correct");
 	is(form1.elements["input"][1].value, "2", "Form 1 element 2 is correct");
 	is(form1.elements["input"][2].value, "1", "Form 1 element 3 is correct");
 	is(form1.elements["input"][3].value, "3", "Form 1 element 4 is correct");
 	is(form1.elements["input"][4].value, "8", "Form 1 element 5 is correct");
 	is(form1.elements["input"][5].value, "4", "Form 1 element 6 is correct");
 	is(form1.elements["input"][6].value, "5", "Form 1 element 7 is correct");
 	is(form1.elements["input"][7].value, "10", "Form 1 element 8 is correct");
--- a/dom/html/test/test_bug405242.html
+++ b/dom/html/test/test_bug405242.html
@@ -23,13 +23,13 @@ sel.appendChild(new Option());
 sel.appendChild(new Option());
 opt = new Option();
 opt.value = 10;
 sel.appendChild(opt);
 sel.options.remove(0);
 sel.options.remove(1000);
 sel.options.remove(-1);
 is(sel.length, 1, "Unexpected option collection length");
-is(sel[0].value, 10, "Unexpected remained option");
+is(sel[0].value, "10", "Unexpected remained option");
 </script>
 </pre>
 </body>
 </html>
--- a/dom/html/test/test_bug536891.html
+++ b/dom/html/test/test_bug536891.html
@@ -23,17 +23,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 function checkNegativeMaxLength(element)
 {
   /* maxLength is set to -2 initially in the document, see above */
   is(element.maxLength, -1, "negative maxLength should be considered invalid and represented as -1");
 
   element.setAttribute('maxLength', -15);
   is(element.maxLength, -1, "negative maxLength is not processed correctly when set dynamically");
-  is(element.getAttribute('maxLength'), -15, "maxLength attribute doesn't return the correct value");
+  is(element.getAttribute('maxLength'), "-15", "maxLength attribute doesn't return the correct value");
 
   element.setAttribute('maxLength', 0);
   is(element.maxLength, 0, "negative maxLength is not processed correctly");
   element.setAttribute('maxLength', 2147483647); /* PR_INT32_MAX */
   is(element.maxLength, 2147483647, "negative maxLength is not processed correctly");
   element.setAttribute('maxLength', -2147483648); /* PR_INT32_MIN */
   is(element.maxLength, -1, "negative maxLength is not processed correctly");
   element.setAttribute('maxLength', 'non-numerical-value');
--- a/dom/html/test/test_bug536895.html
+++ b/dom/html/test/test_bug536895.html
@@ -35,17 +35,17 @@ function checkNegativeMaxLengthException
   try {
     element.maxLength = -20;
   } catch(e) {
     is(e.name, "IndexSizeError", "Should be an IndexSizeError exception");
     caught = true;
   }
   ok(caught, "Setting negative maxLength from the DOM should throw an exception");
 
-  is(element.getAttribute('maxLength'), -10, "When the exception is raised, the maxLength attribute shouldn't change");
+  is(element.getAttribute('maxLength'), "-10", "When the exception is raised, the maxLength attribute shouldn't change");
 }
 
 /* TODO: correct behavior may be checked for email, telephone, url and search input types */
 checkNegativeMaxLengthException(document.getElementById('t'));
 checkNegativeMaxLengthException(document.getElementById('i'));
 checkNegativeMaxLengthException(document.getElementById('p'));
 
 </script>
--- a/dom/html/test/test_bug551846.html
+++ b/dom/html/test/test_bug551846.html
@@ -27,53 +27,53 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 function checkSizeReflection(element, defaultValue)
 {
   is(element.size, defaultValue, "Default size should be " + defaultValue);
 
   element.setAttribute('size', -15);
   is(element.size, defaultValue,
     "The reflecting IDL attribute should return the default value when content attribute value is invalid");
-  is(element.getAttribute('size'), -15,
+  is(element.getAttribute('size'), "-15",
     "The content attribute should containt the previously set value");
 
   element.setAttribute('size', 0);
   is(element.size, 0,
     "0 should be considered as a valid value");
-  is(element.getAttribute('size'), 0,
+  is(element.getAttribute('size'), "0",
     "The content attribute should containt the previously set value");
 
   element.setAttribute('size', 2147483647); /* PR_INT32_MAX */
   is(element.size, 2147483647,
     "PR_INT32_MAX should be considered as a valid value");
-  is(element.getAttribute('size'), 2147483647,
+  is(element.getAttribute('size'), "2147483647",
     "The content attribute should containt the previously set value");
 
   element.setAttribute('size', -2147483648); /* PR_INT32_MIN */
   is(element.size, defaultValue,
     "The reflecting IDL attribute should return the default value when content attribute value is invalid");
-  is(element.getAttribute('size'), -2147483648,
+  is(element.getAttribute('size'), "-2147483648",
     "The content attribute should containt the previously set value");
 
   element.setAttribute('size', 'non-numerical-value');
   is(element.size, defaultValue,
     "The reflecting IDL attribute should return the default value when content attribute value is invalid");
   is(element.getAttribute('size'), 'non-numerical-value',
     "The content attribute should containt the previously set value");
 
   element.setAttribute('size', 4294967294); /* PR_INT32_MAX * 2 */
   is(element.size, defaultValue,
     "Value greater than PR_INT32_MAX should be considered as invalid");
-  is(element.getAttribute('size'), 4294967294,
+  is(element.getAttribute('size'), "4294967294",
     "The content attribute should containt the previously set value");
 
   element.setAttribute('size', -4294967296); /* PR_INT32_MIN * 2 */
   is(element.size, defaultValue,
     "The reflecting IDL attribute should return the default value when content attribute value is invalid");
-  is(element.getAttribute('size'), -4294967296,
+  is(element.getAttribute('size'), "-4294967296",
     "The content attribute should containt the previously set value");
 
   element.size = defaultValue + 1;
   element.removeAttribute('size');
   is(element.size, defaultValue,
     "When the attribute is removed, the size should be the default size");
 
   element.setAttribute('size', 'foobar');
@@ -130,25 +130,25 @@ function checkSetSizeException(element)
 function checkSizeWhenChangeMultiple(element, aDefaultNonMultiple, aDefaultMultiple)
 {
   s.setAttribute('size', -1)
   is(s.size, aDefaultNonMultiple, "Size IDL attribute should be 1");
 
   s.multiple = true;
   is(s.size, aDefaultMultiple, "Size IDL attribute should be 4");
 
-  is(s.getAttribute('size'), -1, "Size content attribute should be -1");
+  is(s.getAttribute('size'), "-1", "Size content attribute should be -1");
 
   s.setAttribute('size', -2);
   is(s.size, aDefaultMultiple, "Size IDL attribute should be 4");
 
   s.multiple = false;
   is(s.size, aDefaultNonMultiple, "Size IDL attribute should be 1");
 
-  is(s.getAttribute('size'), -2, "Size content attribute should be -2");
+  is(s.getAttribute('size'), "-2", "Size content attribute should be -2");
 }
 
 var s = document.getElementById('s');
 
 checkSizeReflection(s, 0);
 checkSetSizeException(s);
 
 s.setAttribute('multiple', 'true');
--- a/dom/html/test/test_bug596350.html
+++ b/dom/html/test/test_bug596350.html
@@ -21,28 +21,28 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 596350 **/
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(runTests);
 
 var testData = [
 // Object 0
-  [ 0, null, "-1" ],
-  [ 0, "1", "1" ],
-  [ 0, "-1", "-1" ],
-  [ 0, "0", "0" ],
-  [ 0, "foo", "-1" ],
+  [ 0, null, -1 ],
+  [ 0, "1", 1 ],
+  [ 0, "-1", -1 ],
+  [ 0, "0", 0 ],
+  [ 0, "foo", -1 ],
 // Object 1
-  [ 1, null, "-1" ],
-  [ 1, "1", "1" ],
+  [ 1, null, -1 ],
+  [ 1, "1", 1 ],
 // Object 2
-  [ 2, null, "0" ],
-  [ 2, "1", "1" ],
-  [ 2, "-1", "-1" ],
+  [ 2, null, 0 ],
+  [ 2, "1", 1 ],
+  [ 2, "-1", -1 ],
 ];
 
 var objects = document.getElementsByTagName("object");
 
 function runTests()
 {
   for (var data of testData) {
     var obj = objects[data[0]];
index 076507c998f2cd35b91651d80bb34a5938553590..b662103cdb249ebed87efc908c12efd4b8259159
GIT binary patch
literal 2704
zc$~dfVQ<qg5WUa+6<!3aLnG0IK(Mt;jCJC}CMInN@oDmslm^-~YSN8?_M7<&ygS>8
z(`MR02t`THj_=*``Q4>7pba{t5A=@C=`)?uh!nkteL~0dhI%xh2~{+ssU2<5Gh98H
zt*D@qb}7PjNlW@dKPbb>DQODfGjEOOw7`l89uwHtbYXo$it)^7A9q4SdPzI<0@rKY
zJ&ERcq`*mJq;L%oAq58wJH}fL{8DCy6acxRF??UaZagZ)sK6)1+&P{lMhfego1z2Z
zqgo6GVC;K2q!KX~m@fpOq8nJLMAonhtj@4Pi|?FrpnS#X3b*eWz_-LG7Eg|3IF+!^
zux2JmY0b5JHUxGFf5UC{TF=c#cplZc8OWJ5oSHrI9&-A2FNVUK6svi@lw3@O8J}2c
zcj;${cllj*6Ju33^NC=NADow}&V|E_tZt%~at2V{9QKVJY2l_tn{IEcOx7&#Jy_xL
ze{|31a?--NTb<hOq`*6a6yTX5ULl@0UImzQHF}@HHWf6Hj0|bh=3uiUC;m9_B8_FF
zu@|Rwp3PyMfiLUk6mQuttUF1YkKx2hE2L_Dt!&m>VNN-aW_CW2+R`%5RW*gLd86qU
zES``4AkIW~lwg#v#kyG0|3wEnpM=Y6dp^Vb!lL=OcjvUK>(cjiYA&qBXME*(#ghF>
zcHlaTtHpIq><Sn5NWJqg5e%|Z)k1hT+)SMX_Wi%=gN)Y0+o!nH1ADWQ)sc91_r+_(
z;of~DC?hDzF*38PhD<86Pg}GnNLqAo3=g(O;A%432bU$RM(OOM=%>vc<MiP%$BLz#
zSZ@1~(T=H+6xNxX_%?i+KDvXQ9Uxj@c`)K5;2AY+Ngv6<-LO)~u)2p&!>JN=m%_!@
z$S2u<B3&sIZ2zRfy6<hT_2=scdWQ0AG#A6_dkS)W&_7YXN32Kv`|G}rv|sm=A@0Zc
zH}o9Ow>X)Uo^;gzu=V}h>fjn68u!&D&=dKFXi<`qGgwGoVo|t@tmKQ6(CXJ#*)NAf
zy0j=$(KhQWk;<Fb@7mn<JZ{}pGVZ7YUVSU|&?s?il~{tyC2%sS3bXzezrD`?5~gP@
Nybjj>0!RKo%-^#ErUL)~
--- a/dom/html/test/test_documentAll.html
+++ b/dom/html/test/test_documentAll.html
@@ -26,17 +26,18 @@ Tests for document.all
         style="display: none"></iframe>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 p = document.getElementById("content");
 
 // Test that several elements with the same id or name behave correctly
 function testNumSame() {
-  is(document.all.id0, null, "no ids");
+  is(document.all.id0, undefined, "no ids");
+  is(document.all.namedItem("id0"), null, "no ids");
   is(document.all.id1, p.children[0], "one id");
   is(document.all.id2[0], p.children[1], "two ids");
   is(document.all.id2[1], p.children[2], "two ids");
   is(document.all.id2.length, 2, "two length");
   is(document.all.id3[0], p.children[3], "three ids");
   is(document.all.id3[1], p.children[4], "three ids");
   is(document.all.id3[2], p.children[5], "three ids");
   is(document.all.id3.length, 3, "three length");
@@ -74,17 +75,18 @@ is(document.all.id1.length, 3, "now thre
 is(document.all.id3[1], child[5], "now just two ids");
 is(document.all.id3.length, 2, "now two length");
 
 // Remove all elements from a list and check that it goes empty
 id3list = document.all.id3;
 rC(child[3]);
 is(id3list.length, 1, "now one length");
 rC(child[5]);
-is(document.all.id3, null, "now none");
+is(document.all.id3, undefined, "now none");
+is(document.all.namedItem("id3"), null, "now none (namedItem)");
 is(id3list.length, 0, "now none length");
 
 // Give an element both a name and id and check that it appears in two lists
 p.insertBefore(child[1], child[2]); // restore previously removed
 id1list = document.all.id1;
 id2list = document.all.id2;
 child[1].id = "id1";
 is(id1list[0], child[0], "now four ids");
@@ -130,17 +132,18 @@ elementNames.forEach(function (name) {
   p.appendChild(e);
   e.setAttribute('name', nameval);
 
   if (name == hasName[0]) {
     is(document.all[nameval], e, "should have name");
     hasName.shift();
   }
   else {
-    is(document.all[nameval], null, "shouldn't have name");
+    is(document.all[nameval], undefined, "shouldn't have name");
+    is(document.all.namedItem(nameval), null, "shouldn't have name (namedItem)");
   }
 });
 is(hasName.length, 0, "found all names");
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(function() {
   var subdoc = $("subframe").contentDocument;
   is(subdoc.all.x, subdoc.body.firstChild,
--- a/dom/indexedDB/test/helpers.js
+++ b/dom/indexedDB/test/helpers.js
@@ -327,17 +327,17 @@ function scheduleGC()
 function workerScript() {
   "use strict";
 
   self.repr = function(_thing_) {
     if (typeof(_thing_) == "undefined") {
       return "undefined";
     }
 
-    if (o === null) {
+    if (_thing_ === null) {
       return "null";
     }
 
     let str;
 
     try {
       str = _thing_ + "";
     } catch (e) {
--- a/dom/indexedDB/test/test_persistenceType.html
+++ b/dom/indexedDB/test/test_persistenceType.html
@@ -66,17 +66,17 @@
 
         objectStore = db.transaction([objectStoreName], "readwrite")
                         .objectStore(objectStoreName);
 
         request = objectStore.get(data.key);
         request.onsuccess = grabEventAndContinueHandler;
         event = yield undefined;
 
-        is(event.target.result, null, "Got no data");
+        is(event.target.result, undefined, "Got no data");
 
         request = objectStore.add(data.value, data.key);
         request.onsuccess = grabEventAndContinueHandler;
         event = yield undefined;
 
         is(event.target.result, data.key, "Got correct key");
       }
 
--- a/dom/indexedDB/test/unit/test_deleteDatabase_interactions.js
+++ b/dom/indexedDB/test/unit/test_deleteDatabase_interactions.js
@@ -44,17 +44,17 @@ function testSteps()
 
   let openRequest = indexedDB.open(name, 1);
   openRequest.onerror = errorHandler;
   openRequest.onsuccess = unexpectedSuccessHandler;
 
   event = yield undefined;
   is(event.type, "success", "expect a success event");
   is(event.target, request, "event has right target");
-  is(event.target.result, null, "event should have no result");
+  is(event.target.result, undefined, "event should have no result");
 
   openRequest.onsuccess = grabEventAndContinueHandler;
 
   event = yield undefined;
   is(event.target.result.version, 1, "DB has proper version");
   is(event.target.result.objectStoreNames.length, 0, "DB should have no object stores");
 
   finishTest();
--- a/dom/indexedDB/test/unit/test_keys.js
+++ b/dom/indexedDB/test/unit/test_keys.js
@@ -197,17 +197,17 @@ function testSteps()
        "Read back key should cmp as equal");
     ok(compareKeys(cursor.key, keys[i]),
        "Read back key should actually be equal");
     is(cursor.value, i, "Stored with right value");
 
     cursor.continue();
   }
   event = yield undefined;
-  is(event.target.result, undefined, "no more results expected");
+  is(event.target.result, null, "no more results expected");
 
   var nan = 0/0;
   var invalidKeys = [
     nan,
     undefined,
     null,
     /x/,
     {},
--- a/dom/indexedDB/test/unit/test_multientry.js
+++ b/dom/indexedDB/test/unit/test_multientry.js
@@ -85,29 +85,29 @@ function testSteps()
     req.onsuccess = grabEventAndContinueHandler;
     for (let j = 0; j < test.indexes.length; ++j) {
       e = yield undefined;
       is(req.result.key, test.indexes[j].v, "found expected index key at index " + j + testName);
       is(req.result.primaryKey, test.indexes[j].k, "found expected index primary key at index " + j + testName);
       req.result.continue();
     }
     e = yield undefined;
-    is(req.result, undefined, "exhausted indexes");
+    ok(req.result == null, "exhausted indexes");
 
     let tempIndex = store.createIndex("temp index", "x", { multiEntry: true });
     req = tempIndex.openKeyCursor();
     req.onsuccess = grabEventAndContinueHandler;
     for (let j = 0; j < test.indexes.length; ++j) {
       e = yield undefined;
       is(req.result.key, test.indexes[j].v, "found expected temp index key at index " + j + testName);
       is(req.result.primaryKey, test.indexes[j].k, "found expected temp index primary key at index " + j + testName);
       req.result.continue();
     }
     e = yield undefined;
-    is(req.result, undefined, "exhausted temp index");
+    ok(req.result == null, "exhausted temp index");
     store.deleteIndex("temp index");
   }
 
   // Unique indexes
   tests =
     [{ add:     { x: 1, id: 1 },
        indexes:[{ v: 1, k: 1 }] },
      { add:     { x: [2, 3], id: 2 },
@@ -181,29 +181,29 @@ function testSteps()
     req.onsuccess = grabEventAndContinueHandler;
     for (let j = 0; j < indexes.length; ++j) {
       e = yield undefined;
       is(req.result.key, indexes[j].v, "found expected index key at index " + j + testName);
       is(req.result.primaryKey, indexes[j].k, "found expected index primary key at index " + j + testName);
       req.result.continue();
     }
     e = yield undefined;
-    is(req.result, undefined, "exhausted indexes");
+    ok(req.result == null, "exhausted indexes");
 
     let tempIndex = store.createIndex("temp index", "x", { multiEntry: true, unique: true });
     req = tempIndex.openKeyCursor();
     req.onsuccess = grabEventAndContinueHandler;
     for (let j = 0; j < indexes.length; ++j) {
       e = yield undefined;
       is(req.result.key, indexes[j].v, "found expected temp index key at index " + j + testName);
       is(req.result.primaryKey, indexes[j].k, "found expected temp index primary key at index " + j + testName);
       req.result.continue();
     }
     e = yield undefined;
-    is(req.result, undefined, "exhausted temp index");
+    ok(req.result == null, "exhausted temp index");
     store.deleteIndex("temp index");
   }
 
 
   openRequest.onsuccess = grabEventAndContinueHandler;
   yield undefined;
 
   let trans = db.transaction(["mystore"], "readwrite");
--- a/dom/indexedDB/test/unit/test_persistenceType.js
+++ b/dom/indexedDB/test/unit/test_persistenceType.js
@@ -46,17 +46,17 @@ function testSteps()
 
   objectStore = db.transaction([objectStoreName], "readwrite")
                   .objectStore(objectStoreName);
 
   request = objectStore.get(data.key);
   request.onsuccess = grabEventAndContinueHandler;
   event = yield undefined;
 
-  is(event.target.result, null, "Got no data");
+  is(event.target.result, undefined, "Got no data");
 
   request = objectStore.add(data.value, data.key);
   request.onsuccess = grabEventAndContinueHandler;
   event = yield undefined;
 
   is(event.target.result, data.key, "Got correct key");
 
   request = indexedDB.open(name, { version: version,
--- a/dom/indexedDB/test/unit/test_remove_objectStore.js
+++ b/dom/indexedDB/test/unit/test_remove_objectStore.js
@@ -68,17 +68,17 @@ function testSteps()
   is(db.objectStoreNames.length, 1, "Correct objectStoreNames list");
   is(db.objectStoreNames.item(0), objectStoreName, "Correct name");
   is(trans.objectStore(objectStoreName), objectStore, "Correct new objectStore");
   isnot(oldObjectStore, objectStore, "Old objectStore is not new objectStore");
 
   request = objectStore.openCursor();
   request.onerror = errorHandler;
   request.onsuccess = function(event) {
-    is(event.target.result, undefined, "ObjectStore shouldn't have any items");
+    is(event.target.result, null, "ObjectStore shouldn't have any items");
     testGenerator.send(event);
   }
   event = yield undefined;
 
   db.deleteObjectStore(objectStore.name);
   is(db.objectStoreNames.length, 0, "Correct objectStores list");
 
   continueToNextStep();
--- a/dom/indexedDB/test/unit/test_setVersion_abort.js
+++ b/dom/indexedDB/test/unit/test_setVersion_abort.js
@@ -41,17 +41,16 @@ function testSteps()
   } catch (e) {
     ok(true, "Expect an exception");
     is(e.name, "InvalidStateError", "Expect an InvalidStateError");
   }
 
   event = yield undefined;
   is(event.type, "abort", "Got transaction abort event");
   is(event.target, transaction, "Right target");
-  is(event.target.transaction, null, "No transaction");
 
   is(db.version, 0, "Correct version");
   is(db.objectStoreNames.length, 0, "Correct objectStoreNames length");
   is(objectStore.indexNames.length, 0, "Correct indexNames length");
 
   request.onerror = grabEventAndContinueHandler;
   request.onupgradeneeded = unexpectedSuccessHandler;
 
--- a/dom/indexedDB/test/unit/test_setVersion_events.js
+++ b/dom/indexedDB/test/unit/test_setVersion_events.js
@@ -30,17 +30,17 @@ function testSteps()
 
   let versionChangeEventCount = 0;
   let db1, db2, db3;
 
   db1 = event.target.result;
   db1.addEventListener("versionchange", function(event) {
     ok(true, "Got version change event");
     ok(event instanceof IDBVersionChangeEvent, "Event is of the right type");
-    is(event.target.source, null, "Correct source");
+    is("source" in event.target, false, "Correct source");
     is(event.target, db1, "Correct target");
     is(event.target.version, 1, "Correct db version");
     is(event.oldVersion, 1, "Correct event oldVersion");
     is(event.newVersion, 2, "Correct event newVersion");
     is(versionChangeEventCount++, 0, "Correct count");
     db1.close();
   }, false);
 
@@ -65,17 +65,17 @@ function testSteps()
 
   request.onupgradeneeded = errorHandler;
   request.onsuccess = grabEventAndContinueHandler;
   event = yield undefined;
 
   db2.addEventListener("versionchange", function(event) {
     ok(true, "Got version change event");
     ok(event instanceof IDBVersionChangeEvent, "Event is of the right type");
-    is(event.target.source, null, "Correct source");
+    is("source" in event.target, false, "Correct source");
     is(event.target, db2, "Correct target");
     is(event.target.version, 2, "Correct db version");
     is(event.oldVersion, 2, "Correct event oldVersion");
     is(event.newVersion, 3, "Correct event newVersion");
     is(versionChangeEventCount++, 1, "Correct count");
   }, false);
 
   // Test opening the existing version again
--- a/dom/media/test/test_audio2.html
+++ b/dom/media/test/test_audio2.html
@@ -16,17 +16,17 @@ var tmpAudio = new Audio();
 var manager = new MediaTestManager;
 
 function startTest(test, token) {
   if (!tmpAudio.canPlayType(test.type))
     return;
   manager.started(token);
   var a1 = new Audio(test.name);
   is(a1.getAttribute("preload"), "auto", "Preload automatically set to auto");
-  is(a1.src.match("/[^/]+$"), "/" + test.name, "src OK");
+  ok(a1.src.endsWith("/" + test.name), "src OK");
   manager.finished(token);
 }
 
 manager.runTests(gAudioTests, startTest);
 
 </script>
 </pre>
 </body>
--- a/dom/media/test/test_preload_attribute.html
+++ b/dom/media/test/test_preload_attribute.html
@@ -19,20 +19,20 @@ https://bugzilla.mozilla.org/show_bug.cg
 <video id='v2' preload="auto"></video><audio id='a2' preload="auto"></audio>
 
 <pre id="test">
 <script type="application/javascript">
 var v1 = document.getElementById('v1');
 var a1 = document.getElementById('a1');
 var v2 = document.getElementById('v2');
 var a2 = document.getElementById('a2');
-is(v1.getAttribute("preload"), undefined, "video preload via getAttribute should be undefined by default");
-is(a1.getAttribute("preload"), undefined, "video preload via getAttribute should be undefined by default");
-is(v1.preload, "", "v1.preload should be undefined by default");
-is(a1.preload, "", "a1.preload should be undefined by default");
+is(v1.getAttribute("preload"), null, "video preload via getAttribute should be null by default");
+is(a1.getAttribute("preload"), null, "video preload via getAttribute should be null by default");
+is(v1.preload, "", "v1.preload should be empty by default");
+is(a1.preload, "", "a1.preload should be empty by default");
 is(v2.preload, "auto", "v2.preload should be auto");
 is(a2.preload, "auto", "a2.preload should be auto");
 
 v1.preload = "auto";
 a1.preload = "auto";
 is(v1.preload, "auto", "video.preload should be auto");
 is(a1.preload, "auto", "audio.preload should be auto");
 is(v1.getAttribute("preload"), "auto", "video preload attribute should be auto");
--- a/dom/media/test/test_texttrackcue.html
+++ b/dom/media/test/test_texttrackcue.html
@@ -182,17 +182,17 @@ SpecialPowers.pushPrefEnv({"set": [["med
       is(cue.line, "auto", "Cue's line value should initially be auto.");
       cue.line = 12410
       is(cue.line, 12410, "Cue's line value should now be 12410.");
       cue.line = "auto";
       is(cue.line, "auto", "Cue's line value should now be auto.");
 
       // Check that we can create and add new VTTCues
       var vttCue = new VTTCue(3.999, 4, "foo");
-      is(vttCue.track, undefined, "Cue's track should be undefined.");
+      is(vttCue.track, null, "Cue's track should be null.");
       trackElement.track.addCue(vttCue);
       is(cue.track, trackElement.track, "Cue's track should be defined.");
       is(cueList.length, 7, "Cue list length should now be 7.");
 
       // Check that new VTTCue was added correctly
       cue = cueList[6];
       is(cue.startTime, 3.999, "Cue's start time should be 3.999.");
       is(cue.endTime, 4, "Cue's end time should be 4.");
--- a/dom/media/tests/mochitest/dataChannel.js
+++ b/dom/media/tests/mochitest/dataChannel.js
@@ -48,18 +48,18 @@ var commandsCheckDataChannel = [
     var message = "Lorem ipsum dolor sit amet";
 
     return test.send(message).then(result => {
       is(result.data, message, "Message correctly transmitted from pcLocal to pcRemote.");
     });
   },
 
   function SEND_BLOB(test) {
-    var contents = ["At vero eos et accusam et justo duo dolores et ea rebum."];
-    var blob = new Blob(contents, { "type" : "text/plain" });
+    var contents = "At vero eos et accusam et justo duo dolores et ea rebum.";
+    var blob = new Blob([contents], { "type" : "text/plain" });
 
     return test.send(blob).then(result => {
       ok(result.data instanceof Blob, "Received data is of instance Blob");
       is(result.data.size, blob.size, "Received data has the correct size.");
 
       return getBlobContent(result.data);
     }).then(recv_contents =>
             is(recv_contents, contents, "Received data has the correct content."));
--- a/dom/plugins/test/mochitest/test_npruntime_identifiers.html
+++ b/dom/plugins/test/mochitest/test_npruntime_identifiers.html
@@ -28,17 +28,23 @@
     var i, prop, randomnumber;
 
     for (i = 0; i < 20; ++i) {
       randomnumber=Math.floor(Math.random()*1001);
       prop = "prop" + randomnumber;
       is(reflector[prop], prop, "Property " + prop);
     }
 
-    for (i = -10; i < 10; ++i) {
+    for (i = -10; i < 0; ++i) {
+      is(reflector[i], String(i), "Property " + i);
+      prop = "prop" + i;
+      is(reflector[prop], prop, "Property " + prop);
+    }
+
+    for (i = 0; i < 10; ++i) {
       is(reflector[i], i, "Property " + i);
       prop = "prop" + i;
       is(reflector[prop], prop, "Property " + prop);
     }
 
     is(reflector.a, 'a', "Property .a");
     is(reflector['a'], 'a', "Property ['a']");
     reflector = null;
--- a/dom/plugins/test/mochitest/test_propertyAndMethod.html
+++ b/dom/plugins/test/mochitest/test_propertyAndMethod.html
@@ -29,17 +29,17 @@
       function run() {
         var plugin = document.getElementById("plugin");
         var pluginProto = Object.getPrototypeOf(plugin);
 
         delete pluginProto.propertyAndMethod;
         ok(isNaN(plugin.propertyAndMethod + 0), "Shouldn't be set yet!");
 
         plugin.propertyAndMethod = 5;
-        is(plugin.propertyAndMethod, 5, "Should be set to 5!");
+        is(+plugin.propertyAndMethod, 5, "Should be set to 5!");
 
         delete pluginProto.propertyAndMethod;
         ok(isNaN(plugin.propertyAndMethod + 0), "Shouldn't be set any more!");
 
         var res = plugin.propertyAndMethod();
         is(res, 5, "Method invocation should return 5!");
 
         SimpleTest.finish();
--- a/dom/settings/tests/test_settings_basics.html
+++ b/dom/settings/tests/test_settings_basics.html
@@ -65,33 +65,33 @@ function equals(o1, o2) {
     } else {
       return o1[keyPair[0]] == o2[keyPair[1]];
     }
   }).all();
 };
 
 function observer1(setting) {
   is(setting.settingName, "screen.brightness", "Same settingName");
-  is(setting.settingValue, "0.7", "Same settingvalue");
+  is(setting.settingValue, 0.7, "Same settingvalue");
 };
 
 function observer2(setting) {
   is(setting.settingName, "screen.brightness", "Same settingName");
-  is(setting.settingValue, "0.7", "Same settingvalue");
+  is(setting.settingValue, 0.7, "Same settingvalue");
 };
 
 function observerWithNext(setting) {
   is(setting.settingName, "screen.brightness", "Same settingName");
-  is(setting.settingValue, "0.7", "Same settingvalue");
+  is(setting.settingValue, 0.7, "Same settingvalue");
   next();
 };
 
 function onsettingschangeWithNext(event) {
   is(event.settingName, "screen.brightness", "Same settingName");
-  is(event.settingValue, "0.7", "Same settingvalue");
+  is(event.settingValue, 0.7, "Same settingvalue");
   next();
 };
 
 function check(o1, o2) {
   is(JSON.stringify(o1), JSON.stringify(o2), "same");
 }
 
 var req, req2, req3, req4, req5, req6;
--- a/dom/settings/tests/test_settings_onsettingchange.html
+++ b/dom/settings/tests/test_settings_onsettingchange.html
@@ -33,42 +33,42 @@ var screenBright = {"screen.brightness":
 
 function onFailure() {
   ok(false, "in on Failure!");
 }
 
 function observer1(setting) {
   dump("observer 1 called!\n");
   is(setting.settingName, "screen.brightness", "Same settingName");
-  is(setting.settingValue, "0.7", "Same settingvalue");
+  is(setting.settingValue, 0.7, "Same settingvalue");
 };
 
 function observer2(setting) {
   dump("observer 2 called!\n");
   is(setting.settingName, "screen.brightness", "Same settingName");
-  is(setting.settingValue, "0.7", "Same settingvalue");
+  is(setting.settingValue, 0.7, "Same settingvalue");
 };
 
 var calls = 0;
 function observerOnlyCalledOnce(setting) {
   is(++calls, 1, "Observer only called once!");
 };
 
 
 function observerWithNext(setting) {
   dump("observer with next called!\n");
   is(setting.settingName, "screen.brightness", "Same settingName");
-  is(setting.settingValue, "0.7", "Same settingvalue");
+  is(setting.settingValue, 0.7, "Same settingvalue");
   next();
 };
 
 function onsettingschangeWithNext(event) {
   dump("onsettingschangewithnext called!\n");
   is(event.settingName, "screen.brightness", "Same settingName");
-  is(event.settingValue, "0.7", "Same settingvalue");
+  is(event.settingValue, 0.7, "Same settingvalue");
   next();
 };
 
 var cset = {'a':'b','c':[{'d':'e'}]};
 
 function onComplexSettingschangeWithNext(event) {
   is(event.settingName, "test.key", "Same settingName");
   is(event.settingValue['a'], "b", "Same settingvalue");
--- a/dom/svg/test/test_scientific.html
+++ b/dom/svg/test/test_scientific.html
@@ -23,40 +23,40 @@ https://bugzilla.mozilla.org/show_bug.cg
 	{
 	var doc = $("svg").contentWindow.document;
 	var rect = doc.getElementById("rect");
 	var text = doc.getElementById("text");
 
 	// ordinary
 
 	rect.setAttribute("stroke-width", "5");
-	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 5, "Ordinary");
+	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "5", "Ordinary");
 
 	// valid exponential notation
 
 	rect.setAttribute("stroke-width", "4E1");
-	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 40, "Exponent");
+	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "40", "Exponent");
 
 	rect.setAttribute("stroke-width", "6e1");
-	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 60, "Lower-case Exponent");
+	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "60", "Lower-case Exponent");
 
 	rect.setAttribute("stroke-width", "2E+1");
-	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 20, "Positive Exponent");
+	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "20", "Positive Exponent");
 
 	rect.setAttribute("stroke-width", "100E-1");
-	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 10, "Negative Exponent");
+	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "10", "Negative Exponent");
 
 	rect.setAttribute("stroke-width", "0.7E1");
-	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 7, "Floating Point with Exponent");
+	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "7", "Floating Point with Exponent");
 
 	rect.setAttribute("stroke-width", "50.0E-1");
-	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 5, "Floating Point with Negative Exponent");
+	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "5", "Floating Point with Negative Exponent");
 
 	rect.setAttribute("stroke-width", "0.8E+1");
-	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 8, "Floating Point with Positive Exponent");
+	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "8", "Floating Point with Positive Exponent");
 
 	rect.setAttribute("stroke-width", "4E1px");
 	is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "40px", "Units");
 
 	// check units that begin with the letter e
 
 	var font_size = doc.defaultView.getComputedStyle(rect, '').getPropertyValue("font-size");
 
--- a/dom/tests/mochitest/bugs/test_bug346659.html
+++ b/dom/tests/mochitest/bugs/test_bug346659.html
@@ -92,35 +92,35 @@ function messageReceiver(evt) {
     return;
   }
 
   var testNumber = parseInt(evt.data);
   var testResult = evt.data.substring(3 + Math.floor(Math.log(testNumber) * Math.LOG10E + 1));
 
   switch (testNumber) {
     case 1:
-      is(testResult, 1, "Props on new window should be preserved when loading");
+      is(testResult, "1", "Props on new window should be preserved when loading");
       break;
     case 2:
-      is(testResult, 2, "Props on new window should be preserved when writing");
+      is(testResult, "2", "Props on new window should be preserved when writing");
       break;
     case 3:
-      is(testResult, 3, "Props on window opened from new window should be preserved when loading");
+      is(testResult, "3", "Props on window opened from new window should be preserved when loading");
       break;
     case 4:
-      is(testResult, 4, "Props on window opened from new window should be preserved when writing");
+      is(testResult, "4", "Props on window opened from new window should be preserved when writing");
       break;
     case 5:
       is(testResult, "undefined", "Props on new window's child should go away when loading");
       break;
     case 6:
       is(testResult, "undefined", "Props on new window's child should go away when writing");
       break;
     case 7:
-      is(testResult, 7, "Props on different-domain window opened from different-domain new window can stay");
+      is(testResult, "7", "Props on different-domain window opened from different-domain new window can stay");
       break;
     case 9:
       is(testResult, "undefined", "Props on different-domain new window's child should go away when loading");
       break;
     case 11:
       is(testResult, "undefined", "Props on same-domain window opened from different-domain new window should go away when loading");
       break;
     case 12:
--- a/dom/tests/mochitest/bugs/test_bug437361.html
+++ b/dom/tests/mochitest/bugs/test_bug437361.html
@@ -11,17 +11,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script class="testbody" type="text/javascript">
 
   /** Test for Bug 437361 **/
 
   function testModalDialogBlockedCleanly() {
     is(true, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check");
     var rv = window.showModalDialog( // should be blocked without exception
       "data:text/html,<html><body onload='close(); returnValue = 1;' /></html>");
-    is(rv, undefined, "Modal dialog opened unexpectedly.");
+    is(rv, null, "Modal dialog opened unexpectedly.");
   }
   
   function testModalDialogAllowed() {
     is(false, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check");
     var rv = window.showModalDialog( // should not be blocked this time
       "data:text/html,<html><body onload='close(); returnValue = 1;' /></html>");
     is(rv, 1, "Problem with modal dialog returnValue.");
   }
--- a/dom/tests/mochitest/bugs/test_bug504862.html
+++ b/dom/tests/mochitest/bugs/test_bug504862.html
@@ -25,17 +25,17 @@ function runTest() {
   var result = window.showModalDialog("file_bug504862.html", "my args");
   // NB: We used to clear returnValue on each navigation, but now we do a
   // security check on access, so we can safely make returnValue live on
   // the browsing context, per spec.
   is(result, 3, "window sees previous dialog documents return value.");
 
   result = window.showModalDialog("http://test1.example.com/tests/dom/tests/mochitest/bugs/file_bug504862.html", "my args");
 
-  is(result, null, "Able to see return value from cross origin dialog.");
+  is(result, undefined, "Able to see return value from cross origin dialog.");
 
   SimpleTest.finish();
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/test_bug531176.html
+++ b/dom/tests/mochitest/bugs/test_bug531176.html
@@ -17,30 +17,30 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 531176 **/
 
 var errorCount = 0;
 function errorHandler(msg, filename, linenr) {
   is(msg, "SyntaxError: expected expression, got ';'", "Wrong error!");
-  is(filename, window.location, "Wrong filename!");
+  is(filename, String(window.location), "Wrong filename!");
   is(linenr, 1, "Wrong linenr!");
   ++errorCount;
 }
 
 window.onerror = errorHandler;
 document.body.setAttribute("onclick", "var x=;");
 // Force eager compilation
 document.body.onclick;
 is(errorCount, 1, "Error handler should have been called! (1)");
 
 function recursiveHandler(msg, filename, linenr) {
   is(msg, "SyntaxError: expected expression, got ';'", "Wrong error!");
-  is(filename, window.location, "Wrong filename!");
+  is(filename, String(window.location), "Wrong filename!");
   is(linenr, 1, "Wrong linenr!");
   ++errorCount;
   document.body.setAttribute("onclick", "var z=;");
 }
 
 window.onerror = recursiveHandler;
 document.body.setAttribute("onclick", "var y=;");
 // Force eager compilation
--- a/dom/tests/mochitest/bugs/test_bug581072.html
+++ b/dom/tests/mochitest/bugs/test_bug581072.html
@@ -16,17 +16,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("untriaged");
 
 /** Test for Bug 581072 **/
-var longTimerFired = 0;
+var longTimerFired = false;
 
 // Set up a one-hour timeout
 setTimeout(function() { longTimerFired = true; }, 3600000);
 
 // Trigger suspend and resume timeouts
 (function() {
   var utils = SpecialPowers.getDOMWindowUtils(window);
   utils.suspendTimeouts();  
--- a/dom/tests/mochitest/bugs/test_bug593174.html
+++ b/dom/tests/mochitest/bugs/test_bug593174.html
@@ -37,45 +37,45 @@ function iframeLoaded(identifier) {
     // new value, not our original location.
     history.replaceState('', '', Math.random());
 
     iframe.onload = null;
     iframeCw.location = 'file_bug593174_2.html';
   }
   else if (loadCount == 2) {
     // Test 1: Check that this page is the referer.
-    is(iframeCw.document.referrer, document.location, 'outer iframe referrer');
+    is(iframeCw.document.referrer, String(document.location), 'outer iframe referrer');
 
     // Test 2: file_bug593174_2.html itself contains an iframe, whose src is a
     // data: uri.  Call into that inner iframe and have it set its
     // document.location.  The new document's referrer should be
     // file_bug593174_2.html.
 
     // We'll get a call to iframeLoaded when this finishes.
     iframeCw.navigateInnerIframe();
   }
   else if (loadCount == 3) {
-    is(iframeCw.getInnerIframeReferrer(), iframeCw.location, 'inner iframe referrer');
+    is(iframeCw.getInnerIframeReferrer(), String(iframeCw.location), 'inner iframe referrer');
 
     // Now do the test again, this time with a popup.
     popup = window.open('file_bug593174_1.html');
     popup.onload = iframeLoaded('popup/outer');
   }
   else if (loadCount == 4) {
     history.replaceState('', '', Math.random());
 
     popup.onload = null;
     popup.location = 'file_bug593174_2.html';
   }
   else if (loadCount == 5) {
-    is(popup.document.referrer, document.location, 'popup referrer after replaceState');
+    is(popup.document.referrer, String(document.location), 'popup referrer after replaceState');
     popup.navigateInnerIframe();
   }
   else if (loadCount == 6) {
-    is(popup.getInnerIframeReferrer(), popup.location, 'popup/inner iframe referrer');
+    is(popup.getInnerIframeReferrer(), String(popup.location), 'popup/inner iframe referrer');
     popup.close();
     history.replaceState('', '', kOriginalLocation);
     SimpleTest.finish();
   }
 }
 
 </script>
 
--- a/dom/tests/mochitest/bugs/test_bug862540.html
+++ b/dom/tests/mochitest/bugs/test_bug862540.html
@@ -7,17 +7,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <meta charset="utf-8">
   <title>Test for Bug 862540</title>
   <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 862540 **/
    window.status = 5;
-   is(window.status, 5, "Should be able to get 5");
+   is(window.status, "5", "Should be able to get 5");
 
    window.status = { toString: function() { return "foo"; } };
    ok(window.status === "foo", "Should be coercing window.status to string");
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=862540">Mozilla Bug 862540</a>
--- a/dom/tests/mochitest/bugs/test_onerror_message.html
+++ b/dom/tests/mochitest/bugs/test_onerror_message.html
@@ -17,26 +17,26 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script type="application/javascript">
 "use strict";
 
 /** Test for Bug 743049 **/
 
 var expected = [
-{ name: "Error", message: "foo", filename: location, lineNumber: 45 },
+{ name: "Error", message: "foo", filename: String(location), lineNumber: 45 },
 { name: "Error", message: "foo", filename: "bar", lineNumber: 123 },
 { name: "", message: "uncaught exception: [object Object]" },
 { name: "DuckError", message: "foo", filename: "bar", lineNumber: 123 },
 { name: "", message: "uncaught exception: [object Object]" },
 { name: "", message: "foo", filename: "baz", lineNumber: 123 },
 { name: "", message: "uncaught exception: [object Object]" },
-{ name: "InvalidStateError", message: "An attempt was made to use an object that is not, or is no longer, usable", filename: location, lineNumber: 62 },
-{ name: "ReferenceError", message: "xxx is not defined", filename: location, lineNumber: 64 },
-{ name: "ReferenceError", message: "xxx is not defined", filename: location, lineNumber: 66 }
+{ name: "InvalidStateError", message: "An attempt was made to use an object that is not, or is no longer, usable", filename: String(location), lineNumber: 62 },
+{ name: "ReferenceError", message: "xxx is not defined", filename: String(location), lineNumber: 64 },
+{ name: "ReferenceError", message: "xxx is not defined", filename: String(location), lineNumber: 66 }
 ];
 
 var counter = 0;
 var origin = location.protocol + "//" + location.host;
 postMessage(counter, origin);
 window.onmessage = function(e) {
 	if (e.origin !== origin)
 		return;
--- a/dom/tests/mochitest/chrome/test_sandbox_bindings.xul
+++ b/dom/tests/mochitest/chrome/test_sandbox_bindings.xul
@@ -29,17 +29,18 @@ https://bugzilla.mozilla.org/show_bug.cg
     function doTest() {
       var win = $("t").contentWindow;
       var sandbox = Components.utils.Sandbox(win, { sandboxPrototype: win });
 
       is(sandbox._content, undefined, "_content does nothing over Xray");
 
       try {
         var css = Components.utils.evalInSandbox("CSSStyleDeclaration", sandbox);
-        is(css.prototype, "[object CSSStyleDeclarationPrototype]", "'CSSStyleDeclaration.prototype' in a sandbox should return the CSSStyleDeclaration interface prototype object");
+        is(String(css.prototype), "[object CSSStyleDeclarationPrototype]",
+           "'CSSStyleDeclaration.prototype' in a sandbox should return the CSSStyleDeclaration interface prototype object");
       } catch (e) {
         ok(false, "'CSSStyleDeclaration' shouldn't throw in a sandbox");
       }
       try {
         var et = Components.utils.evalInSandbox("EventTarget", sandbox);
         ok(et, "'EventTarget' in a sandbox should return the EventTarget interface object");
         ok(isXrayWrapper(et), "Getting an interface object on an Xray wrapper should return an Xray wrapper");
       } catch (e) {
@@ -79,17 +80,17 @@ https://bugzilla.mozilla.org/show_bug.cg
         var xhr = Components.utils.evalInSandbox("XMLHttpRequest.prototype", sandbox);
         xhr.constructor = "ok";
         is(xhr.constructor, "ok", "'XMLHttpRequest.prototype.constructor' should be writeable");
       } catch (e) {
         ok(false, "'XMLHttpRequest.prototype.constructor' should be writeable");
       }
       try {
         var xhr = Components.utils.evalInSandbox("XMLHttpRequest", sandbox);
-        is(xhr, XMLHttpRequest + "", "'XMLHttpRequest' in a sandbox should return the XMLHttpRequest interface object");
+        is(String(xhr), String(XMLHttpRequest), "'XMLHttpRequest' in a sandbox should return the XMLHttpRequest interface object");
         ok(isXrayWrapper(xhr.prototype), "Getting the prototype property on an Xray wrapper of an interface object should return an Xray wrapper");
         isnot(Object.getOwnPropertyDescriptor(xhr, "UNSENT"), undefined,
               "We should claim to have an UNSENT constant");
         isnot(Object.keys(xhr).indexOf("OPENED"), -1,
               "We should claim to have an OPENED constant");
         isnot(Object.getOwnPropertyNames(xhr).indexOf("DONE"), -1,
               "We should claim to have a DONE constant");
         isnot(Object.getOwnPropertyDescriptor(xhr, "prototype"), undefined,
--- a/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html
+++ b/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html
@@ -74,18 +74,18 @@ function doTest() {
       is(privateWin.content.localStorage["empty"], "", "Empty value (array access)");
       is(privateWin.content.localStorage.empty, "", "Empty value (property access)");
       is(typeof privateWin.content.localStorage.getItem("empty"), "string", "getItem('empty') is string");
       is(typeof privateWin.content.localStorage["empty"], "string", "['empty'] is string");
       is(typeof privateWin.content.localStorage.empty, "string", "empty is string");
       privateWin.content.localStorage.removeItem("empty");
       is(privateWin.content.localStorage.length, 0, "The storage has no keys");
       is(privateWin.content.localStorage.getItem("empty"), null, "empty item is null (getItem())");
-      is(privateWin.content.localStorage["empty"], null, "empty item is undefined (array access)");
-      is(privateWin.content.localStorage.empty, null, "empty item is undefined (property access)");
+      is(privateWin.content.localStorage["empty"], undefined, "empty item is undefined (array access)");
+      is(privateWin.content.localStorage.empty, undefined, "empty item is undefined (property access)");
       is(typeof privateWin.content.localStorage.getItem("empty"), "object", "getItem('empty') is object");
       is(typeof privateWin.content.localStorage["empty"], "undefined", "['empty'] is undefined");
       is(typeof privateWin.content.localStorage.empty, "undefined", "empty is undefined");
 
       // add one key, check it is there
       privateWin.content.localStorage.setItem("key1", "value1");
       is(privateWin.content.localStorage.length, 1, "The storage has one key-value pair");
       is(privateWin.content.localStorage.key(0), "key1");
--- a/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html
+++ b/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html
@@ -35,27 +35,27 @@ function startTest() {
   lowDeviceStorage(true);
 
   // Checks that we can still access to the stored item.
   is(localStorage.getItem("item"), "value",
      "getItem() during a device storage situation");
 
   // Removes the stored item.
   localStorage.removeItem("item");
-  is(localStorage.getItem("item"), undefined,
+  is(localStorage.getItem("item"), null,
      "getItem() after removing the item");
 
   // Fails storing a new item.
   try {
     localStorage.setItem("newItem", "value");
     ok(false, "Storing a new item is expected to fail");
   } catch(e) {
     ok(true, "Got an expected exception " + e);
   } finally {
-    is(localStorage.getItem("newItem"), undefined,
+    is(localStorage.getItem("newItem"), null,
        "setItem while device storage is low");
   }
 
   // Emulates recovering from a low device storage situation.
   lowDeviceStorage(false);
 
   // Add a test item after recovering from the low device storage situation.
   localStorage.setItem("newItem", "value");
--- a/dom/tests/mochitest/webapps/test_install_app.xul
+++ b/dom/tests/mochitest/webapps/test_install_app.xul
@@ -50,18 +50,18 @@ function install(next) {
     app = this.result;
 
     is(app.origin, "http://test", "origin");
     is(app.installOrigin, "chrome://mochitests", "install origin");
     ok(app.installTime + fuzzySpan >= beforehand, "install time is after install() call");
     ok(app.installTime <= Date.now() + fuzzySpan, "install time is before install success");
     is(app.manifestURL, url, "manifest URL");
     is(app.manifest.name, "Basic App", "manifest.name");
-    is(app.manifest.installs_allowed_from, "*",
-       "manifest.installs_allowed_from");
+    is(app.manifest.installs_allowed_from.length, 1, "allowed-from length must be 1");
+    is(app.manifest.installs_allowed_from[0], "*", "allowed from anywhere");
 
     next();
   }
 }
 
 function getInstalledReturnsApp(next) {
   navigator.mozApps.getInstalled().onsuccess = function onGetInstalled() {
     // Retrieve the app we just installed from the list of installed apps.
--- a/dom/tests/mochitest/webapps/test_launch_paths.xul
+++ b/dom/tests/mochitest/webapps/test_launch_paths.xul
@@ -50,18 +50,18 @@ function install(next) {
     app = this.result;
 
     is(app.origin, "http://test", "origin");
     is(app.installOrigin, "chrome://mochitests", "install origin");
     ok(app.installTime + fuzzySpan >= beforehand, "install time is after install() call");
     ok(app.installTime <= Date.now() + fuzzySpan, "install time is before install success");
     is(app.manifestURL, url, "manifest URL");
     is(app.manifest.name, "Basic App with Launch Paths", "manifest.name");
-    is(app.manifest.installs_allowed_from, "*",
-       "manifest.installs_allowed_from");
+    is(app.manifest.installs_allowed_from.length, 1, "allowed-from length must be 1");
+    is(app.manifest.installs_allowed_from[0], "*", "allowed from anywhere");
 
     next();
   }
 }
 
 function getInstalledReturnsApp(next) {
   navigator.mozApps.getInstalled().onsuccess = function onGetInstalled() {
     // Retrieve the app we just installed from the list of installed apps.
--- a/dom/workers/test/test_suspend.html
+++ b/dom/workers/test/test_suspend.html
@@ -53,17 +53,17 @@
     iframe.terminateWorker();
     SimpleTest.finish();
   }
 
   function waitInterval() {
     if (finished) {
       return;
     }
-    is(iframe.location, "about:blank", "Wrong url!");
+    is(String(iframe.location), "about:blank", "Wrong url!");
     is(suspended, true, "Not suspended?");
     is(resumed, false, "Already resumed?!");
     is(lastCount, oldMessageCount, "Received a message while suspended!");
     if (++waitCount == 5) {
       clearInterval(interval);
       resumed = true;
       iframe.history.back();
     }
@@ -76,17 +76,17 @@
     ok(false, "We don't want suspend_iframe.html to fire a new load event, we want it to come out of the bfcache!");
     finishTest();
   }
 
   function suspendCallback() {
     if (finished) {
       return;
     }
-    is(iframe.location, "about:blank", "Wrong url!");
+    is(String(iframe.location), "about:blank", "Wrong url!");
     is(suspended, false, "Already suspended?");
     is(resumed, false, "Already resumed?");
     setCachePref(false);
     suspended = true;
     var iframeElement = document.getElementById("workerFrame");
     iframeElement.onload = badOnloadCallback;
     oldMessageCount = lastCount;
     interval = setInterval(waitInterval, 1000);
--- a/dom/xul/templates/tests/chrome/test_sortservice.xul
+++ b/dom/xul/templates/tests/chrome/test_sortservice.xul
@@ -9,27 +9,27 @@
 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>      
 
 <script type="application/x-javascript">
 <![CDATA[
 
 var tests = [
-  [["One", "Two", "Three", "Four"], "", ["Four One Three Two"]],
-  [["One", "Two", "Three", "Four"], "integer", ["Four One Three Two"]],
-  [["One", "Two", "Three", "Four"], "descending", ["Two Three One Four"]],
-  [["One", "Two", "Three", "Four"], "descending integer", ["Two Three One Four"]],
-  [["One", "Two", "Three", "Four"], "integer cat descending", ["Two Three One Four"]],
-  [["1", "13", "2", "7", "12", "240", "2", "170", "222", "98"], "", ["1 12 13 170 2 2 222 240 7 98"]],
-  [["1", "13", "2", "7", "12", "240", "2", "170", "222", "98"], "integer", ["1 2 2 7 12 13 98 170 222 240"]],
-  [["1", "13", "2", "7", "12", "240", "2", "170", "222", "98"], "ascending integer", ["1 2 2 7 12 13 98 170 222 240"]],
-  [["1", "13", "2", "7", "12", "240", "2", "170", "222", "98"], "integer descending", ["240 222 170 98 13 12 7 2 2 1"]],
-  [["Cat", "cat", "Candy", "candy"], "comparecase", ["Candy Cat candy cat"]],
-  [["1", "102", "22", "One", "40", "Two"], "integer", ["1 22 40 102 One Two"]],
+  [["One", "Two", "Three", "Four"], "", "Four One Three Two"],
+  [["One", "Two", "Three", "Four"], "integer", "Four One Three Two"],
+  [["One", "Two", "Three", "Four"], "descending", "Two Three One Four"],
+  [["One", "Two", "Three", "Four"], "descending integer", "Two Three One Four"],
+  [["One", "Two", "Three", "Four"], "integer cat descending", "Two Three One Four"],
+  [["1", "13", "2", "7", "12", "240", "2", "170", "222", "98"], "", "1 12 13 170 2 2 222 240 7 98"],
+  [["1", "13", "2", "7", "12", "240", "2", "170", "222", "98"], "integer", "1 2 2 7 12 13 98 170 222 240"],
+  [["1", "13", "2", "7", "12", "240", "2", "170", "222", "98"], "ascending integer", "1 2 2 7 12 13 98 170 222 240"],
+  [["1", "13", "2", "7", "12", "240", "2", "170", "222", "98"], "integer descending", "240 222 170 98 13 12 7 2 2 1"],
+  [["Cat", "cat", "Candy", "candy"], "comparecase", "Candy Cat candy cat"],
+  [["1", "102", "22", "One", "40", "Two"], "integer", "1 22 40 102 One Two"],
 ];
 
 SimpleTest.waitForExplicitFinish();
 
 function doTests()
 {
   var box = document.getElementById("box");
 
--- a/editor/libeditor/tests/spellcheck.js
+++ b/editor/libeditor/tests/spellcheck.js
@@ -1,20 +1,20 @@
 function isSpellingCheckOk(aEditor, aMisspelledWords) {
   var selcon = aEditor.selectionController;
   var sel = selcon.getSelection(selcon.SELECTION_SPELLCHECK);
   var numWords = sel.rangeCount;
 
   is(numWords, aMisspelledWords.length, "Correct number of misspellings and words.");
 
-  if (numWords != aMisspelledWords.length) {
+  if (numWords !== aMisspelledWords.length) {
     return false;
   }
 
   for (var i = 0; i < numWords; ++i) {
-    var word = sel.getRangeAt(i);
+    var word = String(sel.getRangeAt(i));
     is(word, aMisspelledWords[i], "Misspelling is what we think it is.");
-    if (word != aMisspelledWords[i]) {
+    if (word !== aMisspelledWords[i]) {
       return false;
     }
   }
   return true;
 }
--- a/editor/libeditor/tests/test_bug1100966.html
+++ b/editor/libeditor/tests/test_bug1100966.html
@@ -33,18 +33,18 @@ SimpleTest.waitForFocus(function() {
   synthesizeKey(" ", {});
   setTimeout(function() {
     synthesizeKey("a", {});
     setTimeout(function() {
       synthesizeKey("VK_BACK_SPACE", {});
 
       var sel = getSpellCheckSelection();
       is(sel.rangeCount, 2, "We should have two misspelled words");
-      is(sel.getRangeAt(0), "fivee", "Correct misspelled word");
-      is(sel.getRangeAt(1), "sixx", "Correct misspelled word");
+      is(String(sel.getRangeAt(0)), "fivee", "Correct misspelled word");
+      is(String(sel.getRangeAt(1)), "sixx", "Correct misspelled word");
 
       SimpleTest.finish();
     },0);
   },0);
 
 });
 
 function getSpellCheckSelection() {
--- a/js/xpconnect/tests/chrome/test_bug571849.xul
+++ b/js/xpconnect/tests/chrome/test_bug571849.xul
@@ -18,21 +18,22 @@ https://bugzilla.mozilla.org/show_bug.cg
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
 
   /** Test for Bug 500931 **/
 
   function go() {
     var ifr = document.getElementById('ifr');
     var docnodes = ifr.contentDocument.body.childNodes;
-    var output;
-    for (let i in Iterator(docnodes))
-        output = i;
-    is(output[0], "0", "enumerated the 0th element");
-    ok(/Text/.test(output[1]), "the 0th element was a text node");
+    var index, value;
+    for (let i in Iterator(docnodes)) {
+      index = i[0], value = i[1];
+    }
+    is(index, 0, "enumerated the 0th element");
+    ok(value instanceof Text, "the 0th element was a text node");
     SimpleTest.finish();
   }
 
   SimpleTest.waitForExplicitFinish();
 
   ]]></script>
   <iframe type="content"
           src="http://example.org/tests/js/xpconnect/tests/mochitest/bug571849_helper.html"
--- a/js/xpconnect/tests/chrome/test_localstorage_with_nsEp.xul
+++ b/js/xpconnect/tests/chrome/test_localstorage_with_nsEp.xul
@@ -21,18 +21,18 @@ https://bugzilla.mozilla.org/show_bug.cg
   /** Test for localstorage access with expanded principal. **/
   SimpleTest.waitForExplicitFinish();
   const Cu = Components.utils;
 
   function go() {
     var iwin = document.getElementById('ifr').contentWindow;
     var sb = new Cu.Sandbox([iwin], {sandboxPrototype: iwin});
     Cu.evalInSandbox("window.localStorage.test_localstorage_with_nsEp = 3",sb);
-    is(Cu.evalInSandbox("window.localStorage.test_localstorage_with_nsEp",sb), 3);
-    is(iwin.localStorage.test_localstorage_with_nsEp, 3);
+    is(Cu.evalInSandbox("window.localStorage.test_localstorage_with_nsEp",sb), "3");
+    is(iwin.localStorage.test_localstorage_with_nsEp, "3");
     iwin.localStorage.removeItem("test_localstorage_with_nsEp");
     SimpleTest.finish();
   }
 
   ]]>
   </script>
   <iframe id="ifr" onload="go();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html" />
 </window>
--- a/js/xpconnect/tests/mochitest/test_bug691059.html
+++ b/js/xpconnect/tests/mochitest/test_bug691059.html
@@ -29,21 +29,23 @@ function testEventTarget(obj) {
   obj.onmouseleave = f;
   is(obj.onmouseleave, f,
      "onmouseenter should be settable");
 }
 
 function testInterface(obj) {
   try {
     obj.prototype.onmouseenter = f;
-    is(obj.onmouseenter, null,
-       "prototype.onmouseenter should be settable, but the value should stay null");
+    is("onmouseenter" in obj, false,
+       "setting <Interface>.prototype.onmouseenter has no effect on the " +
+       "non-existent <Interface>.onmouseenter");
     obj.prototype.onmouseleave = f;
-    is(obj.onmouseleave, null,
-       "prototype.onmouseleave should be settable, but the value should stay null");
+    is("onmouseleave" in obj, false,
+       "setting <Interface>.prototype.onmouseleave has no effect on the " +
+       "non-existent <Interface>.onmouseleave");
   } catch(ex) {
     ok(false, ex);
   }
 }
 
 testEventTarget(window);
 testEventTarget(document);
 testEventTarget(document.documentElement);
--- a/layout/base/tests/chrome/test_bug533845.xul
+++ b/layout/base/tests/chrome/test_bug533845.xul
@@ -31,14 +31,14 @@ function continueTest() {
   ifrwindow.focus();
   var utils = ifrwindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                        .getInterface(Components.interfaces.nsIDOMWindowUtils);
   var rect = ifrwindow.document.body.getBoundingClientRect();
   var x = rect.left + (rect.width/2);
   var y = rect.top + (rect.height/2);
   utils.sendMouseEvent("mousedown", x, y, 0, 1, 0);
   utils.sendMouseEvent("mouseup", x, y, 0, 1, 0);
-  is(ifrwindow.document.body.textContent, 1, "Should have got a click event!");
+  is(ifrwindow.document.body.textContent, "1", "Should have got a click event!");
   SimpleTest.finish();
 }
 
 ]]></script>
 </window>
--- a/layout/base/tests/test_bug435293-skew.html
+++ b/layout/base/tests/test_bug435293-skew.html
@@ -137,17 +137,17 @@ function runtests() {
      "Test7: Skew with more invalid units");
 
   // Test 8: skew with negative degrees, here again we must handle rounding.
   // The matrix should be: matrix(1, 3.73206, -1, 1, 0, 0)
   style = window.getComputedStyle(document.getElementById("test8"), "");
   tformStyle = style.getPropertyValue("-moz-transform");
   tformValues = tformStyle.substring(tformStyle.indexOf('(') + 1,
                                      tformStyle.indexOf(')')).split(',');
-  is(tformValues[0], 1, "Test8: Test skew with negative degrees-param 0 is 1");
+  is((+tformValues[0]), 1, "Test8: Test skew with negative degrees-param 0 is 1");
   ok(verifyRounded(tformValues[1], 3.73206), "Test8: Rounded param 1 is in bounds");
   is((+tformValues[2]), -1, "Test8: param 2 is -1");
   is((+tformValues[3]), 1, "Test8: param 3 is 1");
   is((+tformValues[4]), 0, "Test8: param 4 is 0");
   is((+tformValues[5]), 0, "Test8: param 5 is 0");
 
   style = window.getComputedStyle(document.getElementById("test9"), "");
   is(style.getPropertyValue("-moz-transform"), "none",
--- a/layout/style/test/chrome/test_moz_document_rules.html
+++ b/layout/style/test/chrome/test_moz_document_rules.html
@@ -43,17 +43,17 @@ function run()
     {
         var zIndex = ++zIndexCounter;
         var encodedRule = encodeURI("@-moz-document " + urltests + " { ") +
                           "%23" + // encoded hash character for "#display"
                           encodeURI("display { z-index: " + zIndex + " } }");
         var sheeturi = "data:text/css," + encodedRule;
         set_user_sheet(sheeturi);
         if (shouldapply) {
-            is(cs.zIndex, zIndex,
+            is(cs.zIndex, String(zIndex),
                "@-moz-document " + urltests +
                " should apply to this document");
         } else {
             is(cs.zIndex, "auto",
                "@-moz-document " + urltests +
                " should NOT apply to this document");
         }
         remove_user_sheet(sheeturi);
--- a/layout/style/test/test_animations_omta_start.html
+++ b/layout/style/test/test_animations_omta_start.html
@@ -70,17 +70,17 @@ function testDelay() {
   var target = newTarget();
   target.setAttribute("style", "animation: 10s 10s anim-opacity linear");
   gUtils.advanceTimeAndRefresh(0);
 
   waitForAllPaints(function() {
     gUtils.advanceTimeAndRefresh(10100);
     waitForAllPaints(function() {
       var opacity = gUtils.getOMTAStyle(target, "opacity");
-      is(opacity, 0.5,
+      is(opacity, "0.5",
          "opacity is set on compositor thread after delayed start");
       target.removeAttribute("style");
       gUtils.restoreNormalRefresh();
       testTransform();
     });
   });
 }
 
--- a/layout/style/test/test_cascade.html
+++ b/layout/style/test/test_cascade.html
@@ -37,17 +37,17 @@ var zindex = 0;
  */
 function do_test(sel1, imp1, sel2, imp2, winning) {
   var ind1 = ++zindex;
   var ind2 = ++zindex;
   style_contents.data =
     sel1 + " { z-index: " + ind1 + (imp1 ? "!important" :"") + " } " +
     sel2 + " { z-index: " + ind2 + (imp2 ? "!important" :"") + " } ";
   var result = cs.zIndex;
-  is(result, (winning == 1) ? ind1 : ind2,
+  is(result, String((winning == 1) ? ind1 : ind2),
      "cascading of " + style_contents.data);
 }
 
 // Test order, and order combined with !important
 do_test("div", false, "div", false, 2);
 do_test("div", false, "div", true, 2);
 do_test("div", true, "div", false, 1);
 do_test("div", true, "div", true, 2);
--- a/layout/style/test/test_flexbox_flex_grow_and_shrink.html
+++ b/layout/style/test/test_flexbox_flex_grow_and_shrink.html
@@ -66,89 +66,89 @@ https://bugzilla.mozilla.org/show_bug.cg
 // take over the refresh driver
 advance_clock(0);
 
 // ANIMATIONS THAT SHOULD AFFECT COMPUTED STYLE
 // --------------------------------------------
 
 // flexGrowTwoToThree: 2.0 at 0%, 2.5 at 50%, 10 after animation is over
 var [ div, cs ] = new_div("animation: flexGrowTwoToThree linear 1s");
-is_approx(cs.flexGrow, 2, 0.01, "flexGrowTwoToThree at 0.0s");
+is_approx(+cs.flexGrow, 2, 0.01, "flexGrowTwoToThree at 0.0s");
 advance_clock(500);
-is_approx(cs.flexGrow, 2.5, 0.01, "flexGrowTwoToThree at 0.5s");
+is_approx(+cs.flexGrow, 2.5, 0.01, "flexGrowTwoToThree at 0.5s");
 advance_clock(1000);
-is(cs.flexGrow, 10, "flexGrowTwoToThree at 1.5s");
+is(cs.flexGrow, "10", "flexGrowTwoToThree at 1.5s");
 done_div();
 
 // flexShrinkTwoToThree: 2.0 at 0%, 2.5 at 50%, 20 after animation is over
 [ div, cs ] = new_div("animation: flexShrinkTwoToThree linear 1s");
 is_approx(cs.flexShrink, 2, 0.01,  "flexShrinkTwoToThree at 0.0s");
 advance_clock(500);
 is_approx(cs.flexShrink, 2.5, 0.01, "flexShrinkTwoToThree at 0.5s");
 advance_clock(1000);
-is(cs.flexShrink, 20, "flexShrinkTwoToThree at 1.5s");
+is(cs.flexShrink, "20", "flexShrinkTwoToThree at 1.5s");
 done_div();
 
 // flexGrowZeroToZero: 0 at 0%, 0 at 50%, 10 after animation is over
 [ div, cs ] = new_div("animation: flexGrowZeroToZero linear 1s");
-is(cs.flexGrow, 0, "flexGrowZeroToZero at 0.0s");
+is(cs.flexGrow, "0", "flexGrowZeroToZero at 0.0s");
 advance_clock(500);
-is(cs.flexGrow, 0, "flexGrowZeroToZero at 0.5s");
+is(cs.flexGrow, "0", "flexGrowZeroToZero at 0.5s");
 advance_clock(1000);
-is(cs.flexGrow, 10, "flexGrowZeroToZero at 1.5s");
+is(cs.flexGrow, "10", "flexGrowZeroToZero at 1.5s");
 done_div();
 
 // flexShrinkZeroToZero: 0 at 0%, 0 at 50%, 20 after animation is over
 [ div, cs ] = new_div("animation: flexShrinkZeroToZero linear 1s");
-is(cs.flexShrink, 0, "flexShrinkZeroToZero at 0.0s");
+is(cs.flexShrink, "0", "flexShrinkZeroToZero at 0.0s");
 advance_clock(500);
-is(cs.flexShrink, 0, "flexShrinkZeroToZero at 0.5s");
+is(cs.flexShrink, "0", "flexShrinkZeroToZero at 0.5s");
 advance_clock(1000);
-is(cs.flexShrink, 20, "flexShrinkZeroToZero at 1.5s");
+is(cs.flexShrink, "20", "flexShrinkZeroToZero at 1.5s");
 done_div();
 
 // ANIMATIONS THAT DIDN'T USED TO AFFECT COMPUTED STYLE, BUT NOW DO
 // ----------------------------------------------------------------
 // (In an older version of the flexbox spec, flex-grow & flex-shrink were not
 // allowed to animate between 0 and other values. But now that's allowed.)
 
 // flexGrowZeroToOne: 0 at 0%, 0.5 at 50%, 10 after animation is over.
 [ div, cs ] = new_div("animation: flexGrowZeroToOne linear 1s");
-is(cs.flexGrow, 0, "flexGrowZeroToOne at 0.0s");
+is(cs.flexGrow, "0", "flexGrowZeroToOne at 0.0s");
 advance_clock(500);
-is(cs.flexGrow, 0.5, "flexGrowZeroToOne at 0.5s");
+is(cs.flexGrow, "0.5", "flexGrowZeroToOne at 0.5s");
 advance_clock(1000);
-is(cs.flexGrow, 10, "flexGrowZeroToOne at 1.5s");
+is(cs.flexGrow, "10", "flexGrowZeroToOne at 1.5s");
 done_div();
 
 // flexShrinkZeroToOne: 0 at 0%, 0.5 at 50%, 20 after animation is over.
 [ div, cs ] = new_div("animation: flexShrinkZeroToOne linear 1s");
-is(cs.flexShrink, 0,  "flexShrinkZeroToOne at 0.0s");
+is(cs.flexShrink, "0",  "flexShrinkZeroToOne at 0.0s");
 advance_clock(500);
-is(cs.flexShrink, 0.5, "flexShrinkZeroToOne at 0.5s");
+is(cs.flexShrink, "0.5", "flexShrinkZeroToOne at 0.5s");
 advance_clock(1000);
-is(cs.flexShrink, 20, "flexShrinkZeroToOne at 1.5s");
+is(cs.flexShrink, "20", "flexShrinkZeroToOne at 1.5s");
 done_div();
 
 // flexGrowOneToZero: 1 at 0%, 0.5 at 50%, 10 after animation is over.
 [ div, cs ] = new_div("animation: flexGrowOneToZero linear 1s");
-is(cs.flexGrow, 1, "flexGrowOneToZero at 0.0s");
+is(cs.flexGrow, "1", "flexGrowOneToZero at 0.0s");
 advance_clock(500);
-is(cs.flexGrow, 0.5, "flexGrowOneToZero at 0.5s");
+is(cs.flexGrow, "0.5", "flexGrowOneToZero at 0.5s");
 advance_clock(1000);
-is(cs.flexGrow, 10, "flexGrowOneToZero at 1.5s");
+is(cs.flexGrow, "10", "flexGrowOneToZero at 1.5s");
 done_div();
 
 // flexShrinkOneToZero: 1 at 0%, 0.5 at 50%, 20 after animation is over.
 [ div, cs ] = new_div("animation: flexShrinkOneToZero linear 1s");
-is(cs.flexShrink, 1,  "flexShrinkOneToZero at 0.0s");
+is(cs.flexShrink, "1",  "flexShrinkOneToZero at 0.0s");
 advance_clock(500);
-is(cs.flexShrink, 0.5, "flexShrinkOneToZero at 0.5s");
+is(cs.flexShrink, "0.5", "flexShrinkOneToZero at 0.5s");
 advance_clock(1000);
-is(cs.flexShrink, 20, "flexShrinkOneToZero at 1.5s");
+is(cs.flexShrink, "20", "flexShrinkOneToZero at 1.5s");
 done_div();
 
 SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
 
 </script>
 </pre>
 </body>
 </html>
--- a/layout/style/test/test_namespace_rule.html
+++ b/layout/style/test/test_namespace_rule.html
@@ -58,17 +58,17 @@ function run() {
         var should_match = match_fn(ifdoc);
         var should_not_match = notmatch_fn(ifdoc);
         if (should_match.length + should_not_match.length == 0) {
             ok(false, "nothing to check");
         }
 
         for (var i = 0; i < should_match.length; ++i) {
             var e = should_match[i];
-            is(ifwin.getComputedStyle(e, "").zIndex, zi,
+            is(ifwin.getComputedStyle(e, "").zIndex, String(zi),
                "element in " + body_contents + " matched " + selector);
         }
         for (var i = 0; i < should_not_match.length; ++i) {
             var e = should_not_match[i];
             is(ifwin.getComputedStyle(e, "").zIndex, "auto",
                "element in " + body_contents + " did not match " + selector);
         }
 
@@ -78,17 +78,17 @@ function run() {
         // elements.
         zi = ++gCounter;
         var ruleList = style_text.parentNode.sheet.cssRules;
         var ser1 = ruleList[ruleList.length-1].selectorText;
         style_text.data =
           namespaceRules + " " + ser1 + "{ z-index: " + zi + " }";
         for (var i = 0; i < should_match.length; ++i) {
             var e = should_match[i];
-            is(ifwin.getComputedStyle(e, "").zIndex, zi,
+            is(ifwin.getComputedStyle(e, "").zIndex, String(zi),
                "element in " + body_contents + " matched " + ser1 +
                " which is the reserialization of " + selector);
         }
         for (var i = 0; i < should_not_match.length; ++i) {
             var e = should_not_match[i];
             is(ifwin.getComputedStyle(e, "").zIndex, "auto",
                "element in " + body_contents + " did not match " + ser1 +
                " which is the reserialization of " + selector);
--- a/layout/style/test/test_of_type_selectors.xhtml
+++ b/layout/style/test/test_of_type_selectors.xhtml
@@ -54,17 +54,17 @@ function run() {
 
     function test_selector(selector, match_indices, notmatch_indices)
     {
         var zi = ++counter;
         styleText.data = selector + " { z-index: " + zi + " }";
         var i;
         for (i in match_indices) {
             var e = elements[match_indices[i]];
-            is(getComputedStyle(e, "").zIndex, zi,
+            is(getComputedStyle(e, "").zIndex, String(zi),
                "element " + match_indices[i] + " matched " + selector);
         }
         for (i in notmatch_indices) {
             var e = elements[notmatch_indices[i]];
             is(getComputedStyle(e, "").zIndex, "auto",
                "element " + notmatch_indices[i] + " did not match " + selector);
         }
     }
--- a/layout/style/test/test_selectors.html
+++ b/layout/style/test/test_selectors.html
@@ -70,17 +70,17 @@ function run() {
         var should_match = match_fn(ifdoc);
         var should_not_match = notmatch_fn(ifdoc);
         if (should_match.length + should_not_match.length == 0) {
             ok(false, "nothing to check");
         }
 
         for (var i = 0; i < should_match.length; ++i) {
             var e = should_match[i];
-            is(ifwin.getComputedStyle(e, "").zIndex, zi,
+            is(ifwin.getComputedStyle(e, "").zIndex, String(zi),
                "element in " + body_contents + " matched " + selector);
         }
         for (var i = 0; i < should_not_match.length; ++i) {
             var e = should_not_match[i];
             is(ifwin.getComputedStyle(e, "").zIndex, "auto",
                "element in " + body_contents + " did not match " + selector);
         }
 
@@ -88,17 +88,17 @@ function run() {
         // works correctly.  It need not produce the exact same text,
         // but it should produce a selector that matches the same
         // elements.
         zi = ++gCounter;
         var ser1 = style_text.parentNode.sheet.cssRules[idx].selectorText;
         style_text.data = namespaces + ser1 + "{ z-index: " + zi + " }";
         for (var i = 0; i < should_match.length; ++i) {
             var e = should_match[i];
-            is(ifwin.getComputedStyle(e, "").zIndex, zi,
+            is(ifwin.getComputedStyle(e, "").zIndex, String(zi),
                "element in " + body_contents + " matched " + ser1 +
                " which is the reserialization of " + selector);
         }
         for (var i = 0; i < should_not_match.length; ++i) {
             var e = should_not_match[i];
             is(ifwin.getComputedStyle(e, "").zIndex, "auto",
                "element in " + body_contents + " did not match " + ser1 +
                " which is the reserialization of " + selector);
@@ -146,17 +146,17 @@ function run() {
             var should_not_match = notmatch_fn(clonedoc);
 
             if (should_match.length + should_not_match.length == 0) {
                 ok(false, "nothing to check");
             }
 
             for (var i = 0; i < should_match.length; ++i) {
                 var e = should_match[i];
-                is(clonewin.getComputedStyle(e, "").zIndex, zi,
+                is(clonewin.getComputedStyle(e, "").zIndex, String(zi),
                    "element in " + body_contents + " matched clone of " +
                    selector);
             }
             for (var i = 0; i < should_not_match.length; ++i) {
                 var e = should_not_match[i];
                 is(clonewin.getComputedStyle(e, "").zIndex, "auto",
                    "element in " + body_contents + " did not match clone of " +
                    selector);
@@ -189,17 +189,17 @@ function run() {
         if (!parsed) {
             return;
         }
 
         // Test that it serializes to something that is also parseable.
         var ser1 = style_elem.sheet.cssRules[0].selectorText;
         zi = ++gCounter;
         style_text.data = ser1 + "{ z-index: " + zi + " }";
-        is(ifwin.getComputedStyle(should_match, "").zIndex, zi,
+        is(ifwin.getComputedStyle(should_match, "").zIndex, String(zi),
            "serialization " + ser1 + " of selector p, " + selector +
            " was parsed");
         var ser2 = style_elem.sheet.cssRules[0].selectorText;
         is(ser2, ser1,
            "parse+serialize of selector " + selector + " is idempotent");
 
         ifdoc.body.innerHTML = "";
         style_text.data = "";
@@ -220,17 +220,17 @@ function run() {
             var clonewin = cloneiframe.contentWindow;
             var links = clonedoc.getElementsByTagName("link");
             // cause a clone
             links[1].sheet.insertRule("#nonexistent { color: purple}", 0);
             // remove the uncloned sheet
             links[0].parentNode.removeChild(links[0]);
 
             should_match = clonedoc.getElementsByTagName("p")[0];
-            is(clonewin.getComputedStyle(should_match, "").zIndex, zi,
+            is(clonewin.getComputedStyle(should_match, "").zIndex, String(zi),
                "selector " + selector + " was cloned correctly");
             var ser3 = links[0].sheet.cssRules[1].selectorText;
             is(ser3, ser1,
                "selector " + selector + " serializes correctly after cloning");
         });
     }
 
     function test_unparseable_via_api(selector)
@@ -265,17 +265,17 @@ function run() {
         var zi2 = ++gCounter;
         ifdoc.body.innerHTML = "<p></p><div></div>";
         style_text.data = "p, " + selector + "{ z-index: " + zi1 + " }" +
                           "div { z-index: " + zi2 + " }";
         var should_not_match = ifdoc.getElementsByTagName("p")[0];
         var should_match = ifdoc.getElementsByTagName("div")[0];
         is(ifwin.getComputedStyle(should_not_match, "").zIndex, "auto",
            "selector " + selector + " was a parser error");
-        is(ifwin.getComputedStyle(should_match, "").zIndex, zi2,
+        is(ifwin.getComputedStyle(should_match, "").zIndex, String(zi2),
            "selector " + selector + " error was recovered from");
         ifdoc.body.innerHTML = "";
         style_text.data = "";
         test_unparseable_via_api(selector);
     }
 
     function test_unbalanced_unparseable(selector)
     {
--- a/layout/style/test/test_selectors_on_anonymous_content.html
+++ b/layout/style/test/test_selectors_on_anonymous_content.html
@@ -45,17 +45,17 @@ function run() {
         var anon_div = SpecialPowers.wrap(document).getAnonymousNodes(doc_div)[0];
         var should_match = [];
         var should_not_match = [];
         (matches_docdiv ? should_match : should_not_match).push(doc_div);
         (matches_anondiv ? should_match : should_not_match).push(anon_div);
 
         for (var i = 0; i < should_match.length; ++i) {
             var e = should_match[i];
-            is(SpecialPowers.wrap(window).getComputedStyle(e, "").zIndex, zi,
+            is(SpecialPowers.wrap(window).getComputedStyle(e, "").zIndex, String(zi),
                "element matched " + selector);
         }
         for (var i = 0; i < should_not_match.length; ++i) {
             var e = should_not_match[i];
             is(SpecialPowers.wrap(window).getComputedStyle(e, "").zIndex, "auto",
                "element did not match " + selector);
         }
 
--- a/layout/style/test/test_transitions_events.html
+++ b/layout/style/test/test_transitions_events.html
@@ -312,17 +312,17 @@ var e = new TransitionEvent("transitione
                               cancelable: true,
                               propertyName: "some-unknown-prop",
                               elapsedTime: 0.5,
                               pseudoElement: "pseudo"
                             });
 is(e.bubbles, true);
 is(e.cancelable, true);
 is(e.propertyName, "some-unknown-prop");
-is(e.elapsedTime, "0.5");
+is(e.elapsedTime, 0.5);
 is(e.pseudoElement, "pseudo");
 is(e.isTrusted, false)
 
 document.body.dispatchEvent(e);
 
 </script>
 </pre>
 </body>
--- a/layout/style/test/test_unclosed_parentheses.html
+++ b/layout/style/test/test_unclosed_parentheses.html
@@ -251,39 +251,39 @@ document.getElementById("style").appendC
 var cs = getComputedStyle(document.getElementById("display"), "");
 
 for (var i = 0; i < semirules.length; ++i) {
   var sheet = semirules[i] +
               "p#display { color: red } ) ; p { color: green; z-index: " + (i + 1) + " }";
   textNode.data = sheet;
   is(cs.color, "rgb(0, 128, 0)",
      "color for rule '" + semirules[i] + "'");
-  is(cs.zIndex, i+1,
+  is(cs.zIndex, String(i + 1),
      "z-index for rule '" + semirules[i] + "'");
 }
 
 for (var i = 0; i < declarations.length; ++i) {
   var sheet = "@namespace html url(http://www.w3.org/1999/xhtml);\n" +
               "#display { color: green; " + declarations[i] +
               " x x x x x x x ; color: red; ) ; z-index: " + (i + 1) + " }";
   textNode.data = sheet;
   is(cs.color, "rgb(0, 128, 0)",
      "color for declaration '" + declarations[i] + "'");
-  is(cs.zIndex, i+1,
+  is(cs.zIndex, String(i + 1),
      "z-index for declaration '" + declarations[i] + "'");
 }
 
 for (var i = 0; i < selectors.length; ++i) {
   var sheet = "@namespace html url(http://www.w3.org/1999/xhtml);\n" +
               "#display { color: green } " +
               selectors[i] + " x x x x x x x , #display { color: red } #display { color: red } ) , #display { color: red } " +
               "#display { z-index: " + (i + 1) + " }";
   textNode.data = sheet;
   is(cs.color, "rgb(0, 128, 0)",
      "color for selector '" + selectors[i] + "'");
-  is(cs.zIndex, i+1,
+  is(cs.zIndex, String(i + 1),
      "z-index for selector '" + selectors[i] + "'");
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/layout/xul/test/test_bug703150.xul
+++ b/layout/xul/test/test_bug703150.xul
@@ -28,17 +28,17 @@ function doTest()
     aEvent.stopPropagation();
   }
   window.addEventListener("mousedown", mousedownHandler, true);
 
   // Wait for finishing reflow...
   SimpleTest.executeSoon(function () {
     synthesizeMouseAtCenter(scrollbarThumb, { type: "mousedown" });
 
-    is(scrollbar.getAttribute("curpos"), 0,
+    is(scrollbar.getAttribute("curpos"), "0",
        "scrollbar thumb has been moved already");
 
     synthesizeMouseAtCenter(scrollbar, { type: "mousemove" });
 
     ok(scrollbar.getAttribute("curpos") > 0,
        "scrollbar thumb hasn't been dragged");
 
     synthesizeMouseAtCenter(scrollbarThumb, { type: "mouseup" });
--- a/layout/xul/test/test_stack.xul
+++ b/layout/xul/test/test_stack.xul
@@ -162,17 +162,17 @@
       var expectedval = child.getAttribute("expected" + side);
       if (expectedval.indexOf("*") == 0)
         expectedval = (vertical ? stackRect.bottom : stackRect.right) - Number(expectedval.substring(1));
       else if (direction == "rtl")
         expectedval = (vertical ? stackRect.top : -stackRect.width + clientRect.right + clientRect.left) + Number(expectedval);
       else
         expectedval = (vertical ? stackRect.top : stackRect.left) + Number(expectedval);
 
-      is(actual, expectedval, child.id + " " + side + (dyn ? " dynamic" : ""));
+      is(+actual, expectedval, child.id + " " + side + (dyn ? " dynamic" : ""));
     }
 
     function runTest()
     {
       runTestForStack("stack", false);
       runTestForStack("stack-with-size", false);
       runTestForStartEndAttributes("stack-with-start-end", "ltr");
       runTestForStartEndAttributes("stack-with-start-end", "rtl");
@@ -240,18 +240,18 @@
       var children = stack.childNodes;
       for (var c = children.length - 1; c >= 0; c--) {
         var child = children[c];
         if (dyn) {
           // for dynamic tests, get the size after appending the child as the
           // stack size will be effected by it
           dynStack.appendChild(child);
           stackRect = dynStack.getBoundingClientRect();
-          is(stackRect.width, child.getAttribute("stackwidth"), child.id + " stack width" + (dyn ? " dynamic" : ""));
-          is(stackRect.height, child.getAttribute("stackheight"), child.id + " stack height" + (dyn ? " dynamic" : ""));
+          is(String(stackRect.width), child.getAttribute("stackwidth"), child.id + " stack width" + (dyn ? " dynamic" : ""));
+          is(String(stackRect.height), child.getAttribute("stackheight"), child.id + " stack height" + (dyn ? " dynamic" : ""));
         }
 
         var childrect = child.getBoundingClientRect();
         compareSide(child, childrect.left, "left", dyn);
         compareSide(child, childrect.top, "top", dyn);
         compareSide(child, childrect.right, "right", dyn);
         compareSide(child, childrect.bottom, "bottom", dyn);
         if (dyn)
--- a/testing/mochitest/chrome/test_sample.xul
+++ b/testing/mochitest/chrome/test_sample.xul
@@ -21,17 +21,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 </pre>
 </body>
 
 <script class="testbody" type="application/javascript">
 <![CDATA[
 
 /** Test for Bug 8675309 **/
 
-is(1, "1", "sanity check");
+is_loosely(1, "1", "sanity check");
 ok(true, "sanity check");
 
 
 
 ]]>
 </script>
 
 </window>
--- a/testing/mochitest/tests/Harness_sanity/test_sanity.html
+++ b/testing/mochitest/tests/Harness_sanity/test_sanity.html
@@ -8,32 +8,37 @@
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a>
 <p id="display">
   <input id="testKeyEvent1" onkeypress="press1 = true">
   <input id="testKeyEvent2" onkeydown="return false;" onkeypress="press2 = true">
   <input id="testKeyEvent3" onkeypress="press3 = true">
   <input id="testKeyEvent4" onkeydown="return false;" onkeypress="press4 = true">
-</p
+</p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for sanity  **/
 ok(true, "true must be ok");
-is(1, true, "1 must be true");
+is_loosely(1, true, "1 must loosely be true");
+isnot(1, true, "1 must not be true");
 isnot(1, false, "1 must not be false");
-is(0, false, "0 must be false");
+is_loosely(0, false, "0 must loosely be false");
+isnot(0, false, "0 must not be false");
 isnot(0, true, "0 must not be true");
-is("", 0, "Empty string must be 0");
-is("1", 1, "Numeric string must be equal the number");
+is_loosely("", 0, "Empty string must loosely be 0");
+isnot("", 0, "Empty string must not be 0");
+is_loosely("1", 1, "Numeric string must loosely equal the number");
+isnot("1", 1, "Numeric string must not equal the number");
 isnot("", null, "Empty string must not be null");
+isnot(undefined, null, "Undefined must not be null");
 
 var press1 = false;
 $("testKeyEvent1").focus();
 synthesizeKey("x", {});
 is($("testKeyEvent1").value, "x", "synthesizeKey should work");
 is(press1, true, "synthesizeKey should dispatch keyPress");
 
 var press2 = false;
--- a/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Async.html
+++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Async.html
@@ -256,17 +256,17 @@ try {
     var defList = new DeferredList(callList); 
     ok(defList instanceof Deferred, "DeferredList looks like a Deferred");
     
     callList[0].callback(3); 
     callList[1].callback(5); 
     callList[2].callback(4); 
      
     defList.addCallback(function (lst) { 
-        is( arrayEqual(lst, [[true, 4], [true, 6], [true, 5]]), 1, 
+        is( arrayEqual(lst, [[true, 4], [true, 6], [true, 5]]), true,
            "deferredlist result ok" ); 
     }); 
     
     /* 
         Test fireOnOneCallback 
     */ 
     
     var callList2 = [new Deferred(), new Deferred(), new Deferred()];
@@ -274,17 +274,17 @@ try {
     callList2[1].addCallback(increment); 
     callList2[2].addCallback(increment); 
     var defList2 = new DeferredList(callList2, true); 
     callList2[1].callback(5); 
     callList2[0].callback(3); 
     callList2[2].callback(4); 
      
     defList2.addCallback(function (lst) { 
-        is( arrayEqual(lst, [1, 6]), 1, "deferredlist fireOnOneCallback ok" ); 
+        is( arrayEqual(lst, [1, 6]), true, "deferredlist fireOnOneCallback ok" ); 
     }); 
    
     /* 
         Test fireOnOneErrback 
     */ 
   
     var callList3 = [new Deferred(), new Deferred(), new Deferred()];
     callList3[0].addCallback(increment); 
@@ -326,17 +326,17 @@ try {
     callList5[1].addCallback(increment); 
     callList5[2].addCallback(increment); 
     var gatherRet = gatherResults(callList5); 
     callList5[0].callback(3); 
     callList5[1].callback(5); 
     callList5[2].callback(4); 
      
     gatherRet.addCallback(function (lst) { 
-        is( arrayEqual(lst, [4, 6, 5]), 1, 
+        is( arrayEqual(lst, [4, 6, 5]), true,
            "gatherResults result ok" ); 
     }); 
     
     /*
         Test maybeDeferred
     */
 
     var maybeDef = maybeDeferred(increment, 4);
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -265,42 +265,43 @@ SimpleTest.ok = function (condition, nam
       var successInfo = {status:"PASS", expected:"PASS", message:"TEST-PASS"};
       var failureInfo = {status:"FAIL", expected:"PASS", message:"TEST-UNEXPECTED-FAIL"};
     }
     SimpleTest._logResult(test, successInfo, failureInfo);
     SimpleTest._tests.push(test);
 };
 
 /**
- * Roughly equivalent to ok(a==b, name)
+ * Roughly equivalent to ok(a===b, name)
 **/
 SimpleTest.is = function (a, b, name) {
-    var pass = (a == b);
+    var pass = (a === b);
     var diag = pass ? "" : "got " + repr(a) + ", expected " + repr(b)
     SimpleTest.ok(pass, name, diag);
 };
+SimpleTest.ise = SimpleTest.is;
 
 SimpleTest.isfuzzy = function (a, b, epsilon, name) {
   var pass = (a >= b - epsilon) && (a <= b + epsilon);
   var diag = pass ? "" : "got " + repr(a) + ", expected " + repr(b) + " epsilon: +/- " + repr(epsilon)
   SimpleTest.ok(pass, name, diag);
 };
 
 SimpleTest.isnot = function (a, b, name) {
-    var pass = (a != b);
+    var pass = (a !== b);
     var diag = pass ? "" : "didn't expect " + repr(a) + ", but got it";
     SimpleTest.ok(pass, name, diag);
 };
 
 /**
- * Roughly equivalent to ok(a===b, name)
+ * Roughly equivalent to ok(a==b, name)
 **/
-SimpleTest.ise = function (a, b, name) {
-    var pass = (a === b);
-    var diag = pass ? "" : "got " + repr(a) + ", strictly expected " + repr(b)
+SimpleTest.is_loosely = function (a, b, name) {
+    var pass = (a == b);
+    var diag = pass ? "" : "got " + repr(a) + ", expected " + repr(b)
     SimpleTest.ok(pass, name, diag);
 };
 
 /**
  * Check that the function call throws an exception.
  */
 SimpleTest.doesThrow = function(fn, name) {
     var gotException = false;
@@ -407,24 +408,24 @@ SimpleTest.info = function(name, message
     }
 };
 
 /**
  * Copies of is and isnot with the call to ok replaced by a call to todo.
 **/
 
 SimpleTest.todo_is = function (a, b, name) {
-    var pass = (a == b);
+    var pass = (a === b);
     var diag = pass ? repr(a) + " should equal " + repr(b)
                     : "got " + repr(a) + ", expected " + repr(b);
     SimpleTest.todo(pass, name, diag);
 };
 
 SimpleTest.todo_isnot = function (a, b, name) {
-    var pass = (a != b);
+    var pass = (a !== b);
     var diag = pass ? repr(a) + " should not equal " + repr(b)
                     : "didn't expect " + repr(a) + ", but got it";
     SimpleTest.todo(pass, name, diag);
 };
 
 
 /**
  * Makes a test report, returns it as a DIV element.
@@ -1448,16 +1449,17 @@ SimpleTest.isa = function (object, clas)
 };
 
 // Global symbols:
 var ok = SimpleTest.ok;
 var is = SimpleTest.is;
 var isfuzzy = SimpleTest.isfuzzy;
 var isnot = SimpleTest.isnot;
 var ise = SimpleTest.ise;
+var is_loosely = SimpleTest.is_loosely;
 var todo = SimpleTest.todo;
 var todo_is = SimpleTest.todo_is;
 var todo_isnot = SimpleTest.todo_isnot;
 var isDeeply = SimpleTest.isDeeply;
 var info = SimpleTest.info;
 
 var gOldOnError = window.onerror;
 window.onerror = function simpletestOnerror(errorMsg, url, lineNumber) {
--- a/toolkit/components/microformats/tests/test_Microformats.html
+++ b/toolkit/components/microformats/tests/test_Microformats.html
@@ -235,30 +235,30 @@ function test_Microformats() {
 
   is(valueCard.fn, "JohnDoe", "value_test");
 
   var nestCard1 = new hCard(document.getElementById("nested_vcard1"));
   var nestCard2 = new hCard(document.getElementById("nested_vcard2"));
   var nestCard3 = new hCard(document.getElementById("nested_vcard3"));
 
   is(nestCard1.fn, "John Doe", "nesting (fn) 1");
-  is(nestCard1.title, "CEO", "nesting (title) 1");
+  is(String(nestCard1.title), "CEO", "nesting (title) 1");
   is(nestCard2.fn, "Jack Jones", "nesting (fn) 2");
-  is(nestCard2.title, "Executive Assistant", "nesting (title) 2");
+  is(String(nestCard2.title), "Executive Assistant", "nesting (title) 2");
   is(nestCard3.fn, "Bob Smith", "nesting (fn) 3");
-  is(nestCard3.title, "Office Assistant", "nesting (title) 3");
+  is(String(nestCard3.title), "Office Assistant", "nesting (title) 3");
   is(nestCard1.agent[0].agent[0].fn, "Bob Smith", "nesting all");
   
   var dateCal = new hCalendar(document.getElementById("date_vcal"));
   jsdate = Microformats.dateFromISO8601(dateCal.dtstart);
   origdate = Microformats.iso8601FromDate(jsdate, true);
   is(dateCal.dtstart, origdate, "date round trip");
 
   var dateCal = new hCalendar(document.getElementById("vcal_vcard"));
-  is(dateCal.description, "Mozilla's Birthday", "vcard in vcal");
+  is(String(dateCal.description), "Mozilla's Birthday", "vcard in vcal");
 
   is(Microformats.count("hCard", document.getElementById("float_test")), 2, "Check Microformats.count for floated div");
 
   var hcard = new hCard(document.getElementById("geo_vcard"));
   ok(!hcard.geo, "Check if invalid geo does not exist");
   var hcal = new hCalendar(document.getElementById("loc_vevent"));
   is(hcal.location, "The White House", "Check if non vcard location works");
   var hcal = new hCalendar(document.getElementById("loc_vcard_vevent"));
@@ -287,15 +287,15 @@ function test_Microformats() {
 }
 
 function test_hCard() {
   var Microformats = SpecialPowers.Cu.import("resource://gre/modules/Microformats.js").Microformats;
   
   var hCards = Microformats.get("hCard", document.getElementById("test_1"),  {showHidden: true}); 
   
   is(hCards[0].fn, "Tantek Çelik", "Check for fn on test vcard");
-  is(hCards[0].url, "http://tantek.com/", "Check for url on test vcard");
+  is(String(hCards[0].url), "http://tantek.com/", "Check for url on test vcard");
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/toolkit/components/microformats/tests/test_Microformats_geo.html
+++ b/toolkit/components/microformats/tests/test_Microformats_geo.html
@@ -90,28 +90,28 @@ function test_Microformats() {
 
 function test_geo() {
   var geo = SpecialPowers.Cu.import("resource://gre/modules/Microformats.js").geo;
 
   var Geo;
 
   Geo = new geo(document.getElementById("01-geo-basic"));
 
-  is(Geo.latitude, "37.77", "01-geo-basic - latitude");
-  is(Geo.longitude, "-122.411", "01-geo-basic - longitude");
+  is(Geo.latitude, 37.77, "01-geo-basic - latitude");
+  is(Geo.longitude, -122.411, "01-geo-basic - longitude");
 
   Geo = new geo(document.getElementById("01-geo-abbr-latlong"));
 
-  is(Geo.latitude, "37.77", "02-geo-abbr-latlong - latitude");
-  is(Geo.longitude, "-122.41", "02-geo-abbr-latlong - longitude");
+  is(Geo.latitude, 37.77, "02-geo-abbr-latlong - latitude");
+  is(Geo.longitude, -122.41, "02-geo-abbr-latlong - longitude");
 
   Geo = new geo(document.getElementById("01-geo-abbr"));
 
-  is(Geo.latitude, "30.267991", "01-geo-abbr - latitude");
-  is(Geo.longitude, "-97.739568", "01-geo-abbr - longitude");
+  is(Geo.latitude, 30.267991, "01-geo-abbr - latitude");
+  is(Geo.longitude, -97.739568, "01-geo-abbr - longitude");
   
   Geo = new geo(document.getElementById("02-geo-vcard-01"));
 
   is(Geo.toString(), "John Doe", "02-geo-vcard-01");
 
   Geo = new geo(document.getElementById("02-geo-vcard-02"));
 
   is(Geo.toString(), "Northern California", "02-geo-vcard-02");
--- a/toolkit/components/microformats/tests/test_Microformats_hCalendar.html
+++ b/toolkit/components/microformats/tests/test_Microformats_hCalendar.html
@@ -225,17 +225,17 @@ function test_hCard() {
   is(hcalendar.location, "Argent Hotel, San Francisco, CA", "05-calendar-simple - location");
 
   hcalendar = new hCalendar(document.getElementById("06-component-vevent-uri-relative"));
   is(hcalendar.url, "http://mochi.test:8888/squidlist/calendar/12279/2006/1/15", "06-component-vevent-uri-relative - url");
   is(hcalendar.summary, "Bad Movie Night - Gigli (blame mike spiegelman)", "06-component-vevent-uri-relative - summary");
   is(hcalendar.dtstart, "2006-01-15T00:00:00", "06-component-vevent-uri-relative - dtstart");
 
   hcalendar = new hCalendar(document.getElementById("07-component-vevent-description-simple"));
-  is(hcalendar.description, "Project xyz Review Meeting Minutes", "07-component-vevent-description-simple - description");
+  is(String(hcalendar.description), "Project xyz Review Meeting Minutes", "07-component-vevent-description-simple - description");
 
   hcalendar = new hCalendar(document.getElementById("08-component-vevent-multiple-classes"));
   is(hcalendar.dtstart, "2005-10-05", "08-component-vevent-multiple-classes - dtstart");
   is(hcalendar.dtend, "2005-10-08", "08-component-vevent-multiple-classes - dtend");
   is(hcalendar.url, "http://www.web2con.com/", "08-component-vevent-multiple-classes - url");
   is(hcalendar.summary, "Web 2.0 Conference", "08-component-vevent-multiple-classes - summary");
   is(hcalendar.location, "Argent Hotel, San Francisco, CA", "08-component-vevent-multiple-classes - location");
 
@@ -243,17 +243,17 @@ function test_hCard() {
   is(hcalendar.dtstart, "2006-03-06", "09-component-vevent-summary-in-img-alt - dtstart");
   is(hcalendar.dtend, "2006-03-10", "09-component-vevent-summary-in-img-alt - dtend");
   is(hcalendar.url, "http://conferences.oreillynet.com/et2006/", "09-component-vevent-summary-in-img-alt - url");
   is(hcalendar.summary, "O'Reilly Emerging Technology Conference", "09-component-vevent-summary-in-img-alt - summary");
   is(hcalendar.location, "Manchester Grand Hyatt in San Diego, CA", "09-component-vevent-summary-in-img-alt - location");
 
   hcalendar = new hCalendar(document.getElementById("10-component-vevent-entity"));
   is(hcalendar.summary, "Cricket & Tennis Centre", "10-component-vevent-entity - summary");
-  is(hcalendar.description, "Melbourne's Cricket & Tennis Centres are in the heart of the city", "10-component-vevent-entity - description");
+  is(String(hcalendar.description), "Melbourne's Cricket & Tennis Centres are in the heart of the city", "10-component-vevent-entity - description");
 
   hcalendar = new hCalendar(document.getElementById("11-component-vevent-summary-in-subelements"));
   is(hcalendar.dtstart, "2005-10-05T16:30:00-0700", "11-component-vevent-summary-in-subelements - dtstart");
   is(hcalendar.dtend, "2005-10-05T16:45:00-0700", "11-component-vevent-summary-in-subelements - dtend");
   is(hcalendar.summary, "Welcome! John Battelle, Tim O'Reilly", "11-component-vevent-summary-in-subelements - summary");
 
   hcalendar = new hCalendar(document.getElementById("12-component-vevent-summary-url-in-same-class"));
   is(hcalendar.dtstart, "2006-01-25T00:00:00", "12-component-vevent-summary-url-in-same-class - dtstart");
@@ -273,17 +273,17 @@ function test_hCard() {
 
   hcalendar = new hCalendar(document.getElementById("16-calendar-force-outlook"));
   is(hcalendar.dtend, "2005-10-08", "16-calendar-force-outlook - dtend");
   is(hcalendar.dtstart, "2005-10-05", "16-calendar-force-outlook - dtstart");
   is(hcalendar.location, "Argent Hotel, San Francisco, CA", "16-calendar-force-outlook - location");
   is(hcalendar.url, "http://www.web2con.com/", "16-calendar-force-outlook - url");
 
   hcalendar = new hCalendar(document.getElementById("17-component-vevent-description-value-in-subelements"));
-  is(hcalendar.description, "RESOLUTION: to have a 3rd PAW ftf meeting 18-19 Jan in Maryland; location contingent on confirmation from timbl", "17-component-vevent-description-value-in-subelements - description");
+  is(String(hcalendar.description), "RESOLUTION: to have a 3rd PAW ftf meeting 18-19 Jan in Maryland; location contingent on confirmation from timbl", "17-component-vevent-description-value-in-subelements - description");
   is(hcalendar.dtstart, "2006-01-18", "17-component-vevent-description-value-in-subelements - dtstart");
   is(hcalendar.dtend, "2006-01-20", "17-component-vevent-description-value-in-subelements - dtend");
   is(hcalendar.location, "Maryland", "17-component-vevent-description-value-in-subelements - location");
   is(hcalendar.summary, "3rd PAW ftf meeting", "17-component-vevent-description-value-in-subelements - summary");
 
   hcalendar = new hCalendar(document.getElementById("18-component-vevent-uid.1"));
 
   hcalendar = new hCalendar(document.getElementById("18-component-vevent-uid.2"));
@@ -292,15 +292,15 @@ function test_hCard() {
 
   hcalendar = new hCalendar(document.getElementById("18-component-vevent-uid.4"));
 
   hcalendar = new hCalendar(document.getElementById("18-component-vevent-uid.5"));
 
   hcalendar = new hCalendar(document.getElementById("19-calendar-attachments"));
 
   hcalendar = new hCalendar(document.getElementById("empty-description"));
-  is (hcalendar.description, "", "Empty description");
+  is(String(hcalendar.description), "", "Empty description");
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/toolkit/components/microformats/tests/test_Microformats_hCard.html
+++ b/toolkit/components/microformats/tests/test_Microformats_hCard.html
@@ -571,17 +571,17 @@ function test_Microformats() {
 function test_hCard() {
   var hCard = SpecialPowers.Cu.import("resource://gre/modules/Microformats.js").hCard;
 
   var hcard;
 
   hcard = new hCard(document.getElementById("01-tantek-basic"));
 
   is(hcard.fn, "Tantek Çelik", "01-tantek-basic - fn");
-  is(hcard.url, "http://tantek.com/", "01-tantek-basic - url");
+  is(String(hcard.url), "http://tantek.com/", "01-tantek-basic - url");
   is(hcard.n["given-name"][0], "Tantek", "01-tantek-basic - given-name");
   is(hcard.n["family-name"][0], "Çelik", "01-tantek-basic - family-name");
   is(hcard.org[0]["organization-name"], "Technorati", "01-tantek-basic - organization-name");
 
   hcard = new hCard(document.getElementById("02-multiple-class-names-on-vcard.1"));
 
   is(hcard.fn, "Ryan King", "02-multiple-class-names-on-vcard.1 - fn");
   is(hcard.n["given-name"][0], "Ryan", "02-multiple-class-names-on-vcard.1 - given-name");
@@ -678,17 +678,17 @@ function test_hCard() {
   is(hcard.email[0].value, "brian@example.com", "06-mailto-2 - email");
 
   hcard = new hCard(document.getElementById("07-relative-url"));
 
   is(hcard.fn, "John Doe", "07-relative-url - fn");
   is(hcard.n["given-name"][0], "John", "07-relative-url - given-name");
   is(hcard.n["family-name"][0], "Doe", "07-relative-url - family-name");
 //  is(hcard.url[0], "http://microformats.org/home/blah", "07-relative-url - url");
-  is(hcard.url, "http://mochi.test:8888/home/blah", "07-relative-url - url");
+  is(String(hcard.url), "http://mochi.test:8888/home/blah", "07-relative-url - url");
 
   hcard = new hCard(document.getElementById("11-multiple-urls"));
 
   is(hcard.fn, "John Doe", "11-multiple-urls - fn");
   is(hcard.n["given-name"][0], "John", "11-multiple-urls - given-name");
   is(hcard.n["family-name"][0], "Doe", "11-multiple-urls - family-name");
   is(hcard.url[0], "http://example.com/foo", "11-multiple-urls - url");
   is(hcard.url[1], "http://example.com/bar", "11-multiple-urls - url");
@@ -700,35 +700,35 @@ function test_hCard() {
   is(hcard.n["family-name"][0], "Doe", "12-img-src-url - family-name");
   is(hcard.url[0], "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "12-img-src-url - url");
 
   hcard = new hCard(document.getElementById("13-photo-logo"));
 
   is(hcard.fn, "John Doe", "13-photo-logo - fn");
   is(hcard.n["given-name"][0], "John", "13-photo-logo - given-name");
   is(hcard.n["family-name"][0], "Doe", "13-photo-logo - family-name");
-  is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - logo");
-  is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - photo");
+  is(String(hcard.logo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - logo");
+  is(String(hcard.photo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - photo");
 
   hcard = new hCard(document.getElementById("14-img-src-data-url"));
 
   is(hcard.fn, "John Doe", "14-img-src-data-url - fn");
   is(hcard.n["given-name"][0], "John", "14-img-src-data-url - given-name");
   is(hcard.n["family-name"][0], "Doe", "14-img-src-data-url - family-name");
-  is(hcard.logo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - logo");
-  is(hcard.photo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - photo");
+  is(String(hcard.logo), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - logo");
+  is(String(hcard.photo), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - photo");
 
   hcard = new hCard(document.getElementById("15-honorific-additional-single"));
 
   is(hcard.fn, "Mr. John Maurice Doe, Ph.D.", "15-honorific-additional-single - fn");
   is(hcard.n["given-name"][0], "John", "15-honorific-additional-single - given-name");
   is(hcard.n["family-name"][0], "Doe", "15-honorific-additional-single - family-name");
-  is(hcard.n["honorific-prefix"], "Mr.", "15-honorific-additional-single - honorific-prefix");
-  is(hcard.n["additional-name"], "Maurice", "15-honorific-additional-single - additional-name");
-  is(hcard.n["honorific-suffix"], "Ph.D.", "15-honorific-additional-single - honorific-suffix");
+  is(String(hcard.n["honorific-prefix"]), "Mr.", "15-honorific-additional-single - honorific-prefix");
+  is(String(hcard.n["additional-name"]), "Maurice", "15-honorific-additional-single - additional-name");
+  is(String(hcard.n["honorific-suffix"]), "Ph.D.", "15-honorific-additional-single - honorific-suffix");
 
   hcard = new hCard(document.getElementById("16-honorific-additional-multiple"));
 
   is(hcard.fn, "Mr. Dr. John Maurice Benjamin Doe Ph.D., J.D.", "16-honorific-additional-multiple - fn");
   is(hcard.n["given-name"][0], "John", "16-honorific-additional-multiple - given-name");
   is(hcard.n["family-name"][0], "Doe", "16-honorific-additional-multiple - family-name");
   is(hcard.n["honorific-prefix"][0], "Mr.", "16-honorific-additional-multiple - honorific-prefix");
   is(hcard.n["honorific-prefix"][1], "Dr.", "16-honorific-additional-multiple - honorific-prefix");
@@ -744,36 +744,36 @@ function test_hCard() {
   is(hcard.n["family-name"][0], "Doe", "17-email-not-uri - family-name");
   is(hcard.email[0].value, "john@example.com", "17-email-not-uri - email");
 
   hcard = new hCard(document.getElementById("18-object-data-http-uri"));
 
   is(hcard.fn, "John Doe", "18-object-data-http-uri - fn");
   is(hcard.n["given-name"][0], "John", "18-object-data-http-uri - given-name");
   is(hcard.n["family-name"][0], "Doe", "18-object-data-http-uri - family-name");
-  is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - logo");
-  is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - photo");
-  is(hcard.url, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - url");
+  is(String(hcard.logo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - logo");
+  is(String(hcard.photo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - photo");
+  is(String(hcard.url), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - url");
 
   hcard = new hCard(document.getElementById("19-object-data-data-uri"));
 
   is(hcard.fn, "John Doe", "19-object-data-data-uri - fn");
   is(hcard.n["given-name"][0], "John", "19-object-data-data-uri - given-name");
   is(hcard.n["family-name"][0], "Doe", "19-object-data-data-uri - family-name");
-  is(hcard.logo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - logo");
-  is(hcard.photo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - photo");
+  is(String(hcard.logo), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - logo");
+  is(String(hcard.photo), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - photo");
 
 
   hcard = new hCard(document.getElementById("20-image-alt"));
 
   is(hcard.fn, "John Doe", "20-image-alt - fn");
   is(hcard.n["given-name"][0], "John", "20-image-alt - given-name");
   is(hcard.n["family-name"][0], "Doe", "20-image-alt - family-name");
-  is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - logo");
-  is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - photo");
+  is(String(hcard.logo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - logo");
+  is(String(hcard.photo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - photo");
 
   hcard = new hCard(document.getElementById("21-tel"));
 
   is(hcard.fn, "John Doe", "21-tel - fn");
   is(hcard.n["given-name"][0], "John", "21-tel - given-name");
   is(hcard.n["family-name"][0], "Doe", "21-tel - family-name");
   is(hcard.tel[0].value, "+1.415.555.1231", "21-tel - tel");
   is(hcard.tel[1].value, "+1 415 555 1232", "21-tel - tel");
@@ -849,67 +849,67 @@ function test_hCard() {
   is(hcard.adr[3]["postal-code"], "90210", "22-adr - postal-code");
   is(hcard.adr[3]["country-name"], "United States of America", "22-adr - country-name");
 
   hcard = new hCard(document.getElementById("23-abbr-title-everything"));
 
   is(hcard.fn, "John Doe", "23-abbr-title-everything - fn");
   is(hcard.n["given-name"][0], "Jonathan", "23-abbr-title-everything - given-name");
   is(hcard.n["family-name"][0], "Doe-Smith", "23-abbr-title-everything - family-name");
-  is(hcard.n["additional-name"], "John", "23-abbr-title-everything - additional-name");
-  is(hcard.n["honorific-prefix"], "Mister", "23-abbr-title-everything - honorific-prefix");
-  is(hcard.n["honorific-suffix"], "Medical Doctor", "23-abbr-title-everything - honorific-suffix");
+  is(String(hcard.n["additional-name"]), "John", "23-abbr-title-everything - additional-name");
+  is(String(hcard.n["honorific-prefix"]), "Mister", "23-abbr-title-everything - honorific-prefix");
+  is(String(hcard.n["honorific-suffix"]), "Medical Doctor", "23-abbr-title-everything - honorific-suffix");
   is(hcard["class"], "public", "23-abbr-title-everything - class");
-  is(hcard.geo.latitude, "37.77", "23-abbr-title-everything - geo.latitude");
-  is(hcard.geo.longitude, "-122.41", "23-abbr-title-everything - geo.longitude");
+  is(hcard.geo.latitude, 37.77, "23-abbr-title-everything - geo.latitude");
+  is(hcard.geo.longitude, -122.41, "23-abbr-title-everything - geo.longitude");
   is(hcard.bday, "2006-04-04", "23-abbr-title-everything - bday");
   is(hcard.nickname[0], "JJ", "23-abbr-title-everything - nickname");
-  is(hcard.note[0], "this is a note", "23-abbr-title-everything - note");
-  isnot(hcard.note[0], "this is not a note", "23-abbr-title-everything - note");
+  is(String(hcard.note[0]), "this is a note", "23-abbr-title-everything - note");
+  isnot(String(hcard.note[0]), "this is not a note", "23-abbr-title-everything - note");
   is(hcard.org[0]["organization-name"], "Intellicorp", "23-abbr-title-everything - organization-name");
   is(hcard.org[0]["organization-unit"][0], "Intelligence", "23-abbr-title-everything - organization-unit");
-  is(hcard.role, "Chief", "23-abbr-title-everything - role");
+  is(String(hcard.role), "Chief", "23-abbr-title-everything - role");
   is(hcard.tel[0].value, "415.555.1234", "23-abbr-title-everything - tel");
   is(hcard.title[0], "President", "23-abbr-title-everything - title");
   is(hcard.tz, "-0700", "23-abbr-title-everything - tz");
   is(hcard.uid, "abcdefghijklmnopqrstuvwxyz", "23-abbr-title-everything - uid");
   is(hcard.adr[0]["post-office-box"], "Box 1234", "23-abbr-title-everything - post-office-box");
   is(hcard.adr[0]["street-address"][0], "123 Fake Street", "23-abbr-title-everything - street-address");
   is(hcard.adr[0]["extended-address"], "Suite 100", "23-abbr-title-everything - street-address");
   is(hcard.adr[0].locality, "San Francisco", "23-abbr-title-everything - locality");
   is(hcard.adr[0].region, "California", "23-abbr-title-everything - region");
   is(hcard.adr[0]["postal-code"], "12345-6789", "23-abbr-title-everything - postal-code");
   is(hcard.adr[0]["country-name"], "United States of America", "23-abbr-title-everything - country-name");
 
   hcard = new hCard(document.getElementById("25-geo-abbr"));
 
   is(hcard.fn, "Paradise", "25-geo-abbr - fn");
-  is(hcard.geo.latitude, "30.267991", "25-geo-abbr - geo.latitude");
-  is(hcard.geo.longitude, "-97.739568", "25-geo-abbr - geo.longitude");
+  is(hcard.geo.latitude, 30.267991, "25-geo-abbr - geo.latitude");
+  is(hcard.geo.longitude, -97.739568, "25-geo-abbr - geo.longitude");
   
   hcard = new hCard(document.getElementById("26-ancestors"));
 
   is(hcard.fn, "John Doe", "26-ancestors - fn");
   is(hcard.n["given-name"][0], "Jonathan", "26-ancestors - given-name");
   is(hcard.n["family-name"][0], "Doe-Smith", "26-ancestors - family-name");
-  is(hcard.n["additional-name"], "John", "26-ancestors - additional-name");
-  is(hcard.n["honorific-prefix"], "Mister", "26-ancestors - honorific-prefix");
-  is(hcard.n["honorific-suffix"], "Medical Doctor", "26-ancestors - honorific-suffix");
+  is(String(hcard.n["additional-name"]), "John", "26-ancestors - additional-name");
+  is(String(hcard.n["honorific-prefix"]), "Mister", "26-ancestors - honorific-prefix");
+  is(String(hcard.n["honorific-suffix"]), "Medical Doctor", "26-ancestors - honorific-suffix");
   is(hcard["class"], "public", "26-ancestors - class");
-  is(hcard.geo.latitude, "37.77", "26-ancestors - geo.latitude");
-  is(hcard.geo.longitude, "-122.41", "26-ancestors - geo.longitude");
+  is(hcard.geo.latitude, 37.77, "26-ancestors - geo.latitude");
+  is(hcard.geo.longitude, -122.41, "26-ancestors - geo.longitude");
   is(hcard.bday, "2006-04-04", "26-ancestors - bday");
   is(hcard.nickname[0], "JJ", "26-ancestors - nickname");
-  is(hcard.note[0], "this is a note", "26-ancestors - note");
-  isnot(hcard.note[0], "this is not a note", "26-ancestors - note");
+  is(String(hcard.note[0]), "this is a note", "26-ancestors - note");
+  isnot(String(hcard.note[0]), "this is not a note", "26-ancestors - note");
   is(hcard.org[0]["organization-name"], "Intellicorp", "26-ancestors - organization-name");
   is(hcard.org[0]["organization-unit"][0], "Intelligence", "26-ancestors - organization-unit");
-  is(hcard.role, "Chief", "26-ancestors - role");
+  is(String(hcard.role), "Chief", "26-ancestors - role");
   is(hcard.agent[0].fn, "Bob Smith", "26-ancestors - agent.fn");
-  is(hcard.agent[0].title, "Executive Assistant", "26-ancestors - agent.title");
+  is(String(hcard.agent[0].title), "Executive Assistant", "26-ancestors - agent.title");
   is(hcard.tel[0].value, "415.555.1234", "26-ancestors - tel");
   is(hcard.title[0], "President", "26-ancestors - title");
   is(hcard.tz, "-0700", "26-ancestors - tz");
   is(hcard.uid, "abcdefghijklmnopqrstuvwxyz", "26-ancestors - uid");
   is(hcard.adr[0]["post-office-box"], "Box 1234", "26-ancestors - post-office-box");
   is(hcard.adr[0]["street-address"][0], "123 Fake Street", "26-ancestors - street-address");
   is(hcard.adr[0]["extended-address"], "Suite 100", "26-ancestors - street-address");
   is(hcard.adr[0].locality, "San Francisco", "26-ancestors - locality");
@@ -966,106 +966,106 @@ function test_hCard() {
   is(hcard.fn, "World Wide Web Consortium", "30-fn-org.5 - fn");
   is(hcard.org[0]["organization-name"], "World Wide Web Consortium", "30-fn-org.5 - organization-name");
 
   hcard = new hCard(document.getElementById("31-include.1"));
 
   is(hcard.fn, "Brian Suda", "31-include.1 - fn");
   is(hcard.n["given-name"][0], "Brian", "31-include.1 - given-name");
   is(hcard.n["family-name"][0], "Suda", "31-include.1 - family-name");
-  is(hcard.url, "http://suda.co.uk/", "31-include.1 - url");
+  is(String(hcard.url), "http://suda.co.uk/", "31-include.1 - url");
   is(hcard.email[0].value, "correct@example.com", "31-include.1 - email");
   isnot(hcard.email[0].value, "incorrect@example.com", "31-include.1 - email");
 
   hcard = new hCard(document.getElementById("31-include.2"));
 
   is(hcard.fn, "Brian Suda", "31-include.2 - fn");
   is(hcard.n["given-name"][0], "Brian", "31-include.2 - given-name");
   is(hcard.n["family-name"][0], "Suda", "31-include.2 - family-name");
-  is(hcard.url, "http://suda.co.uk/", "31-include.2 - url");
+  is(String(hcard.url), "http://suda.co.uk/", "31-include.2 - url");
   is(hcard.email[0].value, "correct@example.com", "31-include.2 - email");
   isnot(hcard.email[0].value, "incorrect@example.com", "31-include.2 - email");
 
   hcard = new hCard(document.getElementById("31-include.3"));
 
   is(hcard.fn, "Brian Suda", "31-include.3 - fn");
   is(hcard.n["given-name"][0], "Brian", "31-include.3 - given-name");
   is(hcard.n["family-name"][0], "Suda", "31-include.3 - family-name");
-  is(hcard.url, "http://suda.co.uk/", "31-include.3 - url");
+  is(String(hcard.url), "http://suda.co.uk/", "31-include.3 - url");
   is(hcard.email[0].value, "correct@example.com", "31-include.3 - email");
   isnot(hcard.email[0].value, "incorrect@example.com", "31-include.3 - email");
 
   hcard = new hCard(document.getElementById("31-include.4"));
 
   is(hcard.fn, "Brian Suda", "31-include.3 - fn");
   is(hcard.n["given-name"][0], "Brian", "31-include.3 - given-name");
   is(hcard.n["family-name"][0], "Suda", "31-include.3 - family-name");
-  is(hcard.url, "http://suda.co.uk/", "31-include.3 - url");
+  is(String(hcard.url), "http://suda.co.uk/", "31-include.3 - url");
 
   hcard = new hCard(document.getElementById("32-header.1"));
 
   is(hcard.fn, "Brian Suda", "32-header.1 - fn");
   is(hcard.n["given-name"][0], "Brian", "32-header.1 - given-name");
   is(hcard.n["family-name"][0], "Suda", "32-header.1 - family-name");
   is(hcard.org[0]["organization-name"], "example.org", "32-header.1 - organization-name");
-  is(hcard.url, "http://example.org/", "32-header.1 - url");
+  is(String(hcard.url), "http://example.org/", "32-header.1 - url");
 
   hcard = new hCard(document.getElementById("32-header.2"));
 
   is(hcard.fn, "John Doe", "32-header.2 - fn");
   is(hcard.n["given-name"][0], "John", "32-header.2 - given-name");
   is(hcard.n["family-name"][0], "Doe", "32-header.2 - family-name");
   is(hcard.org[0]["organization-name"], "example.org", "32-header.2 - organization-name");
-  is(hcard.url, "http://example.org/", "32-header.2 - url");
+  is(String(hcard.url), "http://example.org/", "32-header.2 - url");
 
   hcard = new hCard(document.getElementById("33-area.1"));
 
   is(hcard.fn, "Joe Public", "33-area.1 - fn");
   is(hcard.n["given-name"][0], "Joe", "33-area.1 - given-name");
   is(hcard.n["family-name"][0], "Public", "33-area.1 - family-name");
-  is(hcard.url, "http://example.com/", "33-area.1 - url");
+  is(String(hcard.url), "http://example.com/", "33-area.1 - url");
   is(hcard.email[0].value, "joe@example.com", "33-area.1 - email");
 
   hcard = new hCard(document.getElementById("33-area.2"));
 
   is(hcard.fn, "Joe Public", "33-area.2 - fn");
-  is(hcard.url, "http://example.com/", "33-area.2 - url");
+  is(String(hcard.url), "http://example.com/", "33-area.2 - url");
   is(hcard.email[0].value, "joe@example.com", "33-area.2 - email");
   is(hcard.org[0]["organization-name"], "Joe Public", "33-area.2 - organization-name");
   
   hcard = new hCard(document.getElementById("33-area.3"));
 
   is(hcard.fn, "Joe Public", "33-area.3 - fn");
-  is(hcard.url, "http://example.com/", "33-area.3 - url");
+  is(String(hcard.url), "http://example.com/", "33-area.3 - url");
   is(hcard.email[0].value, "joe@example.com", "33-area.3 - email");
   is(hcard.org[0]["organization-name"], "Joe Public", "33-area.3 - organization-name");
   
   hcard = new hCard(document.getElementById("33-area.4"));
 
   is(hcard.fn, "Joe Public", "33-area.4 - fn");
-  is(hcard.url, "http://example.com/", "33-area.4 - url");
+  is(String(hcard.url), "http://example.com/", "33-area.4 - url");
   is(hcard.email[0].value, "joe@example.com", "33-area.4 - email");
   is(hcard.org[0]["organization-name"], "Joe Public", "33-area.4 - organization-name");
   
   hcard = new hCard(document.getElementById("33-area.5"));
 
   is(hcard.fn, "Joe Public", "33-area.5 - fn");
-  is(hcard.url, "http://example.com/", "33-area.5 - url");
+  is(String(hcard.url), "http://example.com/", "33-area.5 - url");
   is(hcard.email[0].value, "joe@example.com", "33-area.5 - email");
   is(hcard.org[0]["organization-name"], "Joe Public", "33-area.5 - organization-name");
 
   hcard = new hCard(document.getElementById("34-notes"));
 
   is(hcard.fn, "Joe Public", "34-notes - fn");
   is(hcard.n["given-name"][0], "Joe", "34-notes - given-name");
   is(hcard.n["family-name"][0], "Public", "34-notes - family-name");
-  is(hcard.note[0], "Note 1", "34-notes - note");
-  isnot(hcard.note[1], "Note 2", "34-notes - note");
-  is(hcard.note[1], "Note 3", "34-notes - note");
-  is(hcard.note[2], "Note 4 with a ; and a , to be escaped", "34-notes - note");
+  is(String(hcard.note[0]), "Note 1", "34-notes - note");
+  isnot(String(hcard.note[1]), "Note 2", "34-notes - note");
+  is(String(hcard.note[1]), "Note 3", "34-notes - note");
+  is(String(hcard.note[2]), "Note 4 with a ; and a , to be escaped", "34-notes - note");
 
   hcard = new hCard(document.getElementById("35-include-pattern.1"));
 
   is(hcard.fn, "James Levine", "35-include-pattern.1 - fn");
   is(hcard.n["given-name"][0], "James", "35-include-pattern.1 - given-name");
   is(hcard.n["family-name"][0], "Levine", "35-include-pattern.1 - family-name");
 
   hcard = new hCard(document.getElementById("35-include-pattern.2"));
@@ -1116,18 +1116,18 @@ function test_hCard() {
   hcard = new hCard(document.getElementById("37-singleton"));
 
   is(hcard.fn, "john doe 1", "37-singleton - fn");
   is(hcard.n["given-name"][0], "john", "37-singleton - given-name");
   is(hcard.n["family-name"][0], "doe", "37-singleton - family-name");
   is(hcard.uid, "unique-id-1", "37-singleton - uid");
   is(hcard.tz, "+0600", "37-singleton - tz");
   is(hcard["sort-string"], "d", "37-singleton - sort-string");
-  is(hcard.geo.latitude, "123.45", "37-singleton - geo.latitude");
-  is(hcard.geo.longitude, "67.89", "37-singleton - geo.longitude");
+  is(hcard.geo.latitude, 123.45, "37-singleton - geo.latitude");
+  is(hcard.geo.longitude, 67.89, "37-singleton - geo.longitude");
   is(hcard["class"], "public", "37-singleton - class");
   is(hcard.bday, "2006-07-07", "37-singleton - bday");
   is(hcard.rev, "2006-07-07", "37-singleton - rev");
 
   hcard = new hCard(document.getElementById("38-uid.1"));
 
   is(hcard.fn, "Ryan King", "38-uid.1 - fn");
   is(hcard.n["given-name"][0], "Ryan", "38-uid.1 - given-name");
@@ -1156,21 +1156,21 @@ function test_hCard() {
   is(hcard.fn, "Ryan King", "38-uid.4 - fn");
   is(hcard.n["given-name"][0], "Ryan", "38-uid.4 - given-name");
   is(hcard.n["family-name"][0], "King", "38-uid.4 - family-name");
   is(hcard.uid, "http://theryanking.com/contact/", "38-uid.4 - uid");
   is(hcard.url[0], "http://theryanking.com/contact/", "38-uid.4 - url");
 
   hcard = new hCard(document.getElementById("39-noteHTML"));
 
-  is(hcard.note[0], "Note", "39-noteHTML - note");
+  is(String(hcard.note[0]), "Note", "39-noteHTML - note");
   is(hcard.note[0].toHTML(), "<b>Note</b>", "39-noteHTML - note as HTML");
-  is(hcard.note[0].match("Note"), "Note", "39-noteHTML - match in note");
+  is(String(hcard.note[0].match("Note")), "Note", "39-noteHTML - match in note");
 
   hcard = new hCard(document.getElementById("email-type"));
-  is(hcard.email[0].type, "internet", "email - type no value (type)");
+  is(String(hcard.email[0].type), "internet", "email - type no value (type)");
   is(hcard.email[0].value, "john@example.com", "email - type no value (value)");
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/toolkit/components/microformats/tests/test_Microformats_negative.html
+++ b/toolkit/components/microformats/tests/test_Microformats_negative.html
@@ -82,17 +82,17 @@
                            document.getElementById("testhere"),
                            {recurseExternalFrames: true});
     is(mfs.length, 0, "Check that we don't pick up invalid MFs.");
 
     mfs = Microformats.get("notAMicroformat",
                            document.getElementById("testhere"),
                            {recurseExternalFrames: true});
 
-    is(mfs, null, "No microformat called notAMicroformat");
+    is(mfs, undefined, "No microformat called notAMicroformat");
 
     // What if we try another way?
     is(Microformats.isMicroformat(document.getElementById("notme")), false,
        "Check that the NotAMicroformat is still not a microformat");
 
     // Attempt to physically add one to the object
     try {
       Microformats.push("notAMicroformat");
--- a/toolkit/components/passwordmgr/test/test_prompt_async.html
+++ b/toolkit/components/passwordmgr/test/test_prompt_async.html
@@ -463,17 +463,17 @@
                     checkIframe(iframe1Doc.getElementById("iframe3"));
                     break;
 
                 case 3:
                     ok(true, "doCheck testNum 3");
                     is(monitor.windowsRegistered, 1, "Registered 1 open dialog");
 
                     // ensure that the page content is not displayed on failed proxy auth
-                    is(iframe1Doc.getElementById("ok"), undefined, "frame did not load");
+                    is(iframe1Doc.getElementById("ok"), null, "frame did not load");
                     break;
 
                 case 4:
                     ok(true, "doCheck testNum 4");
                     is(monitor.windowsRegistered, 2, "Registered 2 open dialogs");
                     var authok1 = iframe1Doc.getElementById("ok").textContent;
                     var proxyok1 = iframe1Doc.getElementById("proxy").textContent;
 
@@ -481,17 +481,17 @@
                     is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
                     break;
 
                 case 5:
                     ok(true, "doCheck testNum 5");
                     is(monitor.windowsRegistered, 1, "Registered 1 open dialog");
 
                     // ensure that the page content is not displayed on failed proxy auth
-                    is(iframe1Doc.getElementById("footnote"), undefined, "frame did not load");
+                    is(iframe1Doc.getElementById("footnote"), null, "frame did not load");
                     break;
 
                 case 6:
                     ok(true, "doCheck testNum 6");
                     is(monitor.windowsRegistered, 2, "Registered 2 open dialogs");
                     var authok1 = iframe1Doc.getElementById("ok").textContent;
                     var proxyok1 = iframe1Doc.getElementById("proxy").textContent;
                     var footnote = iframe1Doc.getElementById("footnote").textContent;
--- a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
@@ -51,39 +51,39 @@ function checkLoads() {
 
   // Make sure that every node in blockedTrackingNodes exists in the tree
   // (that may not always be the case but do not expect any nodes to disappear
   // from the tree here)
   var allNodeMatch = true;
   for (var i = 0; i < blockedTrackingNodes.length; i++) {
     var nodeMatch = false;
     for (var j = 0; j < badids.length && !nodeMatch; j++) {
-      nodeMatch |=
+      nodeMatch = nodeMatch ||
         (blockedTrackingNodes[i] == document.getElementById(badids[j]));
     }
 
-    allNodeMatch &= nodeMatch;
+    allNodeMatch = allNodeMatch && nodeMatch;
   }
-  window.parent.is(allNodeMatch, true,
+  window.parent.ok(allNodeMatch,
     "All annotated nodes are expected in the tree");
 
   // Make sure that every node with a badid (see badids) is found in the
   // blockedTrackingNodes. This tells us if we are neglecting to annotate
   // some nodes
   allNodeMatch = true;
   for (var j = 0; j < badids.length; j++) {
     var nodeMatch = false;
     for (var i = 0; i < blockedTrackingNodes.length && !nodeMatch; i++) {
-      nodeMatch |=
+      nodeMatch = nodeMatch ||
         (blockedTrackingNodes[i] == document.getElementById(badids[j]));
     }
 
-    allNodeMatch &= nodeMatch;
+    allNodeMatch = allNodeMatch && nodeMatch;
   }
-  window.parent.is(allNodeMatch, true,
+  window.parent.ok(allNodeMatch,
     "All tracking nodes are expected to be annotated as such");
 
   // Unset prefs, etc.
   window.parent.cleanup();
   // End (parent) test.
   window.parent.SimpleTest.finish();
 }
 
--- a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
@@ -88,36 +88,36 @@ function checkLoads(aWindow, aBlocked) {
 
   // Make sure that every node in blockedTrackingNodes exists in the tree
   // (that may not always be the case but do not expect any nodes to disappear
   // from the tree here)
   var allNodeMatch = true;
   for (var i = 0; i < blockedTrackingNodes.length; i++) {
     var nodeMatch = false;
     for (var j = 0; j < badids.length && !nodeMatch; j++) {
-      nodeMatch |=
+      nodeMatch = nodeMatch ||
         (blockedTrackingNodes[i] == win.document.getElementById(badids[j]));
     }
 
-    allNodeMatch &= nodeMatch;
+    allNodeMatch = allNodeMatch && nodeMatch;
   }
   is(allNodeMatch, true, "All annotated nodes are expected in the tree");
 
   // Make sure that every node with a badid (see badids) is found in the
   // blockedTrackingNodes. This tells us if we are neglecting to annotate
   // some nodes
   allNodeMatch = true;
   for (var j = 0; j < badids.length; j++) {
     var nodeMatch = false;
     for (var i = 0; i < blockedTrackingNodes.length && !nodeMatch; i++) {
-      nodeMatch |=
+      nodeMatch = nodeMatch ||
         (blockedTrackingNodes[i] == win.document.getElementById(badids[j]));
     }
 
-    allNodeMatch &= nodeMatch;
+    allNodeMatch = allNodeMatch && nodeMatch;
   }
   is(allNodeMatch, aBlocked, "All tracking nodes are expected to be annotated as such");
 }
 
 var dbService = Cc["@mozilla.org/url-classifier/dbservice;1"]
                 .getService(Ci.nsIUrlClassifierDBService);
 
 function doUpdate(update) {
--- a/toolkit/content/tests/chrome/findbar_events_window.xul
+++ b/toolkit/content/tests/chrome/findbar_events_window.xul
@@ -66,17 +66,17 @@
       gFindBar.open();
       gFindBar.onFindCommand();
       nextTest();
     }
 
     function checkSelection(done) {
       SimpleTest.executeSoon(function() {
         var selected = gBrowser.contentWindow.getSelection();
-        is(selected, "", "No text is selected");
+        is(String(selected), "", "No text is selected");
 
         var controller = gFindBar.browser.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
                                  .getInterface(Ci.nsISelectionDisplay)
                                  .QueryInterface(Ci.nsISelectionController);
         var selection = controller.getSelection(controller.SELECTION_FIND);
         is(selection.rangeCount, 0, "No text is highlighted");
         done();
       });
--- a/toolkit/content/tests/chrome/findbar_window.xul
+++ b/toolkit/content/tests/chrome/findbar_window.xul
@@ -441,19 +441,19 @@
         text: "texxx",
         current: 0,
         total: 0
       }];
       let regex = /([\d]*)\sof\s([\d]*)/;
       let timeout = gFindBar._matchesCountTimeoutLength + 20;
 
       function assertMatches(aTest, aMatches) {
-        is(aMatches[1], aTest.current,
+        is(aMatches[1], String(aTest.current),
           "Currently highlighted match should be at " + aTest.current);
-        is(aMatches[2], aTest.total,
+        is(aMatches[2], String(aTest.total),
           "Total amount of matches should be " + aTest.total);
       }
 
       function* generatorTest() {
         for (let test of tests) {
           gFindBar.clear();
           yield;
           enterStringIntoFindField(test.text);
@@ -497,42 +497,42 @@
       enterStringIntoFindField(SEARCH_TEXT);
       gFindBar.clear();
 
       let prefsvc = Cc["@mozilla.org/preferences-service;1"]
                       .getService(Ci.nsIPrefBranch);
       prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 0);
 
       enterStringIntoFindField("t");
-      is(gBrowser.contentWindow.getSelection(), "T", "First T should be selected.");
+      is(String(gBrowser.contentWindow.getSelection()), "T", "First T should be selected.");
 
       prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 1);
       setTimeout(function() {
-        is(gBrowser.contentWindow.getSelection(), "t", "First t should be selected.");
+        is(String(gBrowser.contentWindow.getSelection()), "t", "First t should be selected.");
         deferred.resolve();
       }, 0);
       return deferred.promise;
     }
 
     // Make sure that _findFailedString is cleared:
     // 1. Do a search that fails with case sensitivity but matches with no case sensitivity.
     // 2. Uncheck case sensitivity button to match the string.
     function testFailedStringReset(aCallback) {
       let deferred = Promise.defer();
 
       var prefsvc = Cc["@mozilla.org/preferences-service;1"].
                     getService(Components.interfaces.nsIPrefBranch);
       prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 1);
 
       enterStringIntoFindField(SEARCH_TEXT.toUpperCase());
-      is(gBrowser.contentWindow.getSelection(), "", "Not found.");
+      is(String(gBrowser.contentWindow.getSelection()), "", "Not found.");
 
       prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 0);
       setTimeout(function() {
-        is(gBrowser.contentWindow.getSelection(), SEARCH_TEXT, "Search text should be selected.");
+        is(String(gBrowser.contentWindow.getSelection()), SEARCH_TEXT, "Search text should be selected.");
         deferred.resolve();
       }, 0);
       return deferred.resolve();
     }
 
     function testClipboardSearchString(aExpected) {
       if (!gHasFindClipboard)
         return;
--- a/toolkit/content/tests/chrome/test_datepicker.xul
+++ b/toolkit/content/tests/chrome/test_datepicker.xul
@@ -43,17 +43,17 @@ SimpleTest.waitForExplicitFinish();
 
 function testtag_datepickers()
 {
   var dppopup = document.getElementById("datepicker-popup");
   testtag_datepicker(document.getElementById("datepicker"), "", "datepicker");
   testtag_datepicker(dppopup, "popup", "datepicker popup");
 
   var gridpicker = document.getElementById("datepicker-grid");
-  is(gridpicker.monthField.selectedIndex, 3, "datepicker grid correct month is initially selected");
+  is(gridpicker.monthField.selectedIndex, "3", "datepicker grid correct month is initially selected");
   testtag_datepicker(gridpicker, "grid", "datepicker grid");
   dppopup.open = true;
 }
 
 function testtag_finish()
 {
   ok(!document.getElementById("datepicker-popup").open, "datepicker popup open false again");
 
--- a/toolkit/content/tests/chrome/test_deck.xul
+++ b/toolkit/content/tests/chrome/test_deck.xul
@@ -90,44 +90,44 @@ function test_deck_child_removal()
   child.remove();
   is(deck.selectedIndex, "0", "Should have the deck element at index 0 selected");
 
   // Now scale it up by using a deck with 7 child nodes, and remove the
   // first three, making sure that the selectedIndex is decremented
   // each time.
   deck = $("deck4");
   let expectedIndex = 5;
-  is(deck.selectedIndex, expectedIndex,
+  is(deck.selectedIndex, String(expectedIndex),
      "Should have the deck element at index " + expectedIndex + " selected");
 
   for (let i = 0; i < 3; ++i) {
     deck.firstChild.remove();
     expectedIndex--;
-    is(deck.selectedIndex, expectedIndex,
+    is(deck.selectedIndex, String(expectedIndex),
        "Should have the deck element at index " + expectedIndex + " selected");
   }
 
   // Check that removing the currently selected node doesn't change
   // behaviour.
   deck.childNodes[expectedIndex].remove();
-  is(deck.selectedIndex, expectedIndex,
+  is(deck.selectedIndex, String(expectedIndex),
      "The selectedIndex should not change when removing the node " +
      "at the selected index.");
 
   // Finally, make sure we haven't changed the behaviour when removing
   // nodes at indexes greater than the selected node.
   deck = $("deck5");
   expectedIndex = 2;
-  is(deck.selectedIndex, expectedIndex,
+  is(deck.selectedIndex, String(expectedIndex),
      "Should have the deck element at index " + expectedIndex + " selected");
 
   // And then remove all of the nodes, starting from last to first, making
   // sure that the selectedIndex does not change.
   while (deck.lastChild) {
     deck.lastChild.remove();
-    is(deck.selectedIndex, expectedIndex,
+    is(deck.selectedIndex, String(expectedIndex),
        "Should have the deck element at index " + expectedIndex + " selected");
   }
 }
 ]]>
 </script>
 
 </window>
--- a/toolkit/content/tests/chrome/test_progressmeter.xul
+++ b/toolkit/content/tests/chrome/test_progressmeter.xul
@@ -41,20 +41,20 @@ function doTests() {
   n1.value = "17";
   SimpleTest.ise(n1.value, "17", "determined value set 17 string");
   n1.value = 18;
   SimpleTest.ise(n1.value, "17", "determined value set 18");
   n1.value = "Cat";
   SimpleTest.ise(n1.value, "17", "determined value set invalid");
 
   n1.max = 200;
-  is(n1.max, 200, "max changed");
+  is(n1.max, "200", "max changed");
   n1.value = 150;
   n1.max = 120;
-  is(n1.value, 120, "max lowered below value");
+  is(n1.value, "120", "max lowered below value");
 
   n2.value = 2;
   SimpleTest.ise(n2.value, "0", "undetermined value set 2");
   n2.value = -1;
   SimpleTest.ise(n2.value, "0", "undetermined value set -1");
   n2.value = 125;
   SimpleTest.ise(n2.value, "100", "undetermined value set 125");
   n2.value = 7;
--- a/toolkit/content/tests/chrome/test_textbox_number.xul
+++ b/toolkit/content/tests/chrome/test_textbox_number.xul
@@ -225,38 +225,38 @@ function doTests() {
 
   // check read only state
   n1.readOnly = true;
   n1.min = -10;
   n1.max = 15;
   n1.value = 12;
   // no events should fire and no changes should occur when the field is read only
   synthesizeKeyExpectEvent("VK_UP", { }, n1, "!change", "key up read only");
-  is(n1.value, 12, "key up read only value");
+  is(n1.value, "12", "key up read only value");
   synthesizeKeyExpectEvent("VK_DOWN", { }, n1, "!change", "key down read only");
-  is(n1.value, 12, "key down read only value");
+  is(n1.value, "12", "key down read only value");
 
   synthesizeMouseExpectEvent(sb, 2, 2, { }, n1, "!change", "mouse up read only");
-  is(n1.value, 12, "mouse up read only value");
+  is(n1.value, "12", "mouse up read only value");
   synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, n1, "!change", "mouse down read only");
-  is(n1.value, 12, "mouse down read only value");
+  is(n1.value, "12", "mouse down read only value");
 
   n1.readOnly = false;
   n1.disabled = true;
   synthesizeMouseExpectEvent(sb, 2, 2, { }, n1, "!change", "mouse up disabled");
-  is(n1.value, 12, "mouse up disabled value");
+  is(n1.value, "12", "mouse up disabled value");
   synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, n1, "!change", "mouse down disabled");
-  is(n1.value, 12, "mouse down disabled value");
+  is(n1.value, "12", "mouse down disabled value");
 
   var nsbrect = $("n8").spinButtons.getBoundingClientRect();
   ok(nsbrect.left == 0 && nsbrect.top == 0 && nsbrect.right == 0, nsbrect.bottom == 0,
      "hidespinbuttons");
 
   var n9 = $("n9");
-  is(n9.value, 0, "initial value");
+  is(n9.value, "0", "initial value");
   n9.select();
   synthesizeKey("4", {});
   is(inputEventCount, 1, "input event count");
   is(inputEventValue, "4", "input value");
   is(n9.value, "4", "updated value");
   synthesizeKey("2", {});
   is(inputEventCount, 2, "input event count");
   is(inputEventValue, "42", "input value");
@@ -317,36 +317,36 @@ function testIncreaseDecrease(nb, testid
   nb.increase();
   testVals(nb, testid + "increase method at max", max, max.toFixed(fixedCount));
 
   nb.focus();
   nb.value = min;
 
   // pressing the cursor up and down keys should adjust the value
   synthesizeKeyExpectEvent("VK_UP", { }, nb, "change", testid + "key up");
-  is(nb.value, min + increment, testid + "key up");
+  is(nb.value, String(min + increment), testid + "key up");
   nb.value = max;
   synthesizeKeyExpectEvent("VK_UP", { }, nb, "!change", testid + "key up at max");
-  is(nb.value, max, testid + "key up at max");
+  is(nb.value, String(max), testid + "key up at max");
   synthesizeKeyExpectEvent("VK_DOWN", { }, nb, "change", testid + "key down");
-  is(nb.value, max - increment, testid + "key down");
+  is(nb.value, String(max - increment), testid + "key down");
   nb.value = min;
   synthesizeKeyExpectEvent("VK_DOWN", { }, nb, "!change", testid + "key down at min");
-  is(nb.value, min, testid + "key down at min");
+  is(nb.value, String(min), testid + "key down at min");
 
   // check pressing the spinbutton arrows
   var sb = nb.spinButtons;
   var sbbottom = sb.getBoundingClientRect().bottom - sb.getBoundingClientRect().top - 2;
   nb.value = min;
   synthesizeMouseExpectEvent(sb, 2, 2, { }, nb, "change", testid + "mouse up");
-  is(nb.value, min + increment, testid + "mouse up");
+  is(nb.value, String(min + increment), testid + "mouse up");
   nb.value = max;
   synthesizeMouseExpectEvent(sb, 2, 2, { }, nb, "!change", testid + "mouse up at max");
   synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, nb, "change", testid + "mouse down");
-  is(nb.value, max - increment, testid + "mouse down");
+  is(nb.value, String(max - increment), testid + "mouse down");
   nb.value = min;
   synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, nb, "!change", testid + "mouse down at min");
 }
 
 SimpleTest.waitForFocus(doTests);
 
   ]]></script>
 
--- a/toolkit/content/tests/chrome/xul_selectcontrol.js
+++ b/toolkit/content/tests/chrome/xul_selectcontrol.js
@@ -128,17 +128,17 @@ function test_nsIDOMXULSelectControlElem
     element.selectedIndex = -1;
 
   var removeditem = element.removeItemAt(0);
   is(removeditem, firstitem, testid + "removeItemAt return value");
   test_nsIDOMXULSelectControlElement_States(element, testid + "removeItemAt", 1,
         selectionRequired ? seconditem : null, selectionRequired ? 0 : -1,
         selectionRequired ? secondvalue : "");
 
-  is(removeditem.control, null, testid + "control not set");
+  is(removeditem.control, undefined, testid + "control not set");
 
   var thirditem = element.appendItem("Third Item", "third");
   var fourthitem = element.appendItem("Fourth Item", fourthvalue);
   var fifthitem = element.appendItem("Fifth Item", "fifth");
 
   // 'removeItemAt 2' - check if removeItemAt removes the selected item and
   //                    adjusts the selection to the next item
   element.selectedItem = thirditem;
--- a/toolkit/content/tests/widgets/test_audiocontrols_dimensions.html
+++ b/toolkit/content/tests/widgets/test_audiocontrols_dimensions.html
@@ -12,17 +12,17 @@
 <div id="content">
   <audio id="audio" controls preload="auto"></audio>
 </div>
 
 <pre id="test">
 <script class="testbody" type="text/javascript">
   function loadedmetadata(event) {
     is(event.type, "loadedmetadata", "checking event type");
-    is(audio.clientHeight, "28", "checking height of audio element");
+    is(audio.clientHeight, 28, "checking height of audio element");
 
     SimpleTest.finish();
   }
 
   var audio = document.getElementById("audio");
 
   SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, startTest);
   function startTest() {
--- a/toolkit/devtools/webconsole/test/test_network_get.html
+++ b/toolkit/devtools/webconsole/test/test_network_get.html
@@ -79,17 +79,17 @@ function onNetworkEventUpdate(aState, aT
       break;
     case "requestPostData":
       ok(false, "got unexpected requestPostData");
       break;
     case "responseStart":
       expectedPacket = {
         response: {
           httpVersion: /^HTTP\/\d\.\d$/,
-          status: 200,
+          status: "200",
           statusText: "OK",
           headersSize: /^\d+$/,
           discardResponseBody: true,
         },
       };
       break;
     case "securityInfo":
       expectedPacket = {
--- a/toolkit/devtools/webconsole/test/test_network_longstring.html
+++ b/toolkit/devtools/webconsole/test/test_network_longstring.html
@@ -102,17 +102,17 @@ function onNetworkEventUpdate(aState, aT
     case "requestPostData":
       ok(aPacket.dataSize > 0, "dataSize > 0");
       ok(!aPacket.discardRequestBody, "discardRequestBody");
       break;
     case "responseStart":
       expectedPacket = {
         response: {
           httpVersion: /^HTTP\/\d\.\d$/,
-          status: 200,
+          status: "200",
           statusText: "OK",
           headersSize: /^\d+$/,
           discardResponseBody: false,
         },
       };
       break;
     case "securityInfo":
       expectedPacket = {
--- a/toolkit/devtools/webconsole/test/test_network_post.html
+++ b/toolkit/devtools/webconsole/test/test_network_post.html
@@ -95,17 +95,17 @@ function onNetworkEventUpdate(aState, aT
     case "requestPostData":
       ok(aPacket.dataSize > 0, "dataSize > 0");
       ok(!aPacket.discardRequestBody, "discardRequestBody");
       break;
     case "responseStart":
       expectedPacket = {
         response: {
           httpVersion: /^HTTP\/\d\.\d$/,
-          status: 200,
+          status: "200",
           statusText: "OK",
           headersSize: /^\d+$/,
           discardResponseBody: false,
         },
       };
       break;
     case "securityInfo":
       expectedPacket = {
--- a/toolkit/devtools/webconsole/test/test_object_actor_native_getters.html
+++ b/toolkit/devtools/webconsole/test/test_object_actor_native_getters.html
@@ -42,17 +42,17 @@ function onAttach(aState, aResponse)
   };
 
   expectedSafeGetters = {
     "title": {
       getterValue: /native getters in object actors/,
       getterPrototypeLevel: 2,
     },
     "styleSheets": {
-      getterValue: "[object Object]",
+      getterValue: /\[object Object\]/,
       getterPrototypeLevel: 2,
     },
   };
 }
 
 function onConsoleCall(aState, aType, aPacket)
 {
   is(aPacket.from, aState.actor, "console API call actor");
--- a/widget/tests/test_keycodes.xul
+++ b/widget/tests/test_keycodes.xul
@@ -282,27 +282,27 @@ function runKeyEventTests()
         is(firedEventType, expectEventType, name + ", wrong type event fired");
       else
         is(firedEventType, expectEventType, name + ", a needed event is not fired");
 
       if (firedEventType != "") {
         var e = eventList[i];
         if (e.type == "keypress") {
           var isCtrlExpected =
-            aEvent.modifiers.ctrlKey || aEvent.modifiers.ctrlRightKey || false;
+            !!(aEvent.modifiers.ctrlKey || aEvent.modifiers.ctrlRightKey);
           var isAltExpected =
-            aEvent.modifiers.altKey || aEvent.modifiers.altRightKey || false;
+            !!(aEvent.modifiers.altKey || aEvent.modifiers.altRightKey);
           if (IS_WIN && aEvent.modifiers.altGrKey) {
             isCtrlExpected = isAltExpected =
               ((aShouldDelivedEvent & SHOULD_NOT_CAUSE_INPUT) != 0);
           }
           is(e.ctrlKey, isCtrlExpected, name + ", Ctrl mismatch");
-          is(e.metaKey, aEvent.modifiers.metaKey || aEvent.modifiers.metaRightKey || false, name + ", Command mismatch");
+          is(e.metaKey, !!(aEvent.modifiers.metaKey || aEvent.modifiers.metaRightKey), name + ", Command mismatch");
           is(e.altKey, isAltExpected, name + ", Alt mismatch");
-          is(e.shiftKey, aEvent.modifiers.shiftKey || aEvent.modifiers.shiftRightKey || false, name + ", Shift mismatch");
+          is(e.shiftKey, !!(aEvent.modifiers.shiftKey || aEvent.modifiers.shiftRightKey), name + ", Shift mismatch");
         }
 
         if (aExpectGeckoChar.length > 0 && e.type == "keypress") {
           is(e.charCode, aExpectGeckoChar.charCodeAt(keypressCount++), name + ", charcode");
           if (aExpectedGeckoKeyCode >= 0) {
             if (aExpectGeckoChar) {
               is(e.keyCode, 0, name + ", wrong keycode");
             } else {