merge mozilla-inbound to mozilla-central. r=merge a=merge
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 24 Oct 2017 11:52:35 +0200
changeset 387821 a80d568a417ea8410cd2d874c1e0267fb92888fe
parent 387747 25bc10affd99b854d971b27f3111050616ab22d5 (current diff)
parent 387820 f67f8342b9811251f9d72d62f8a5df62f5efa124 (diff)
child 387822 cfb0f6d21b357de71e82466bff6f6c43d0b77425
child 387828 7de3cc48b5b1c8a3c144c8a2dc1f8a7ead28babb
child 387914 65cec6da9ec7e103f0314cd1fd8f07fea371a7c0
push id32735
push userarchaeopteryx@coole-files.de
push dateTue, 24 Oct 2017 09:53:08 +0000
treeherdermozilla-central@a80d568a417e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge, merge
milestone58.0a1
first release with
nightly linux32
a80d568a417e / 58.0a1 / 20171024100135 / files
nightly linux64
a80d568a417e / 58.0a1 / 20171024100135 / files
nightly mac
a80d568a417e / 58.0a1 / 20171024100135 / files
nightly win32
a80d568a417e / 58.0a1 / 20171024100135 / files
nightly win64
a80d568a417e / 58.0a1 / 20171024100135 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge mozilla-inbound to mozilla-central. r=merge a=merge MozReview-Commit-ID: 4Lk5P5UYmTe
modules/libpref/init/all.js
testing/mozharness/scripts/release/updates.py
--- a/accessible/windows/msaa/Compatibility.cpp
+++ b/accessible/windows/msaa/Compatibility.cpp
@@ -112,22 +112,32 @@ InSendMessageExHook(LPVOID lpReserved)
 {
   MOZ_ASSERT(XRE_IsParentProcess());
   DWORD result = sInSendMessageExStub(lpReserved);
   if (NS_IsMainThread() && sInSendMessageExHackEnabled &&
       IsCurrentThreadInBlockingMessageSend(result)) {
     // We want to take a strong reference to the dll so that it is never
     // unloaded/reloaded from this point forward, hence we use LoadLibrary
     // and not GetModuleHandle.
-    static HMODULE comModule = LoadLibrary(L"combase.dll");
+    static const HMODULE comModule = []() -> HMODULE {
+      HMODULE module = LoadLibraryW(L"combase.dll");
+      if (!module) {
+        // combase is not present on Windows 7, so we fall back to ole32 there
+        module = LoadLibraryW(L"ole32.dll");
+      }
+
+      return module;
+    }();
+
     MOZ_ASSERT(comModule);
     if (!comModule) {
       return result;
     }
-    // Check if InSendMessageEx is being called from code within combase.dll
+
+    // Check if InSendMessageEx is being called from code within comModule
     HMODULE callingModule;
     if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
                           GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
                           reinterpret_cast<LPCWSTR>(RETURN_ADDRESS()),
                           &callingModule) && callingModule == comModule) {
       result = ISMEX_NOTIFY;
     }
   }
@@ -212,19 +222,19 @@ Compatibility::Init()
   // Turn off new tab switching for Jaws and WE.
   if (sConsumers & (JAWS | OLDJAWS | WE)) {
     // Check to see if the pref for disallowing CtrlTab is already set. If so,
     // bail out (respect the user settings). If not, set it.
     if (!Preferences::HasUserValue("browser.ctrlTab.disallowForScreenReaders"))
       Preferences::SetBool("browser.ctrlTab.disallowForScreenReaders", true);
   }
 
-  // If we have a known consumer who is not NVDA, we enable detection for the
+  // If we have a consumer who is not NVDA, we enable detection for the
   // InSendMessageEx compatibility hack. NVDA does not require this.
-  if ((sConsumers & ~(Compatibility::UNKNOWN | NVDA)) &&
+  if ((sConsumers & (~NVDA)) &&
       BrowserTabsRemoteAutostart()) {
     sUser32Interceptor.Init("user32.dll");
     if (!sInSendMessageExStub) {
       sUser32Interceptor.AddHook("InSendMessageEx",
                                  reinterpret_cast<intptr_t>(&InSendMessageExHook),
                                  (void**)&sInSendMessageExStub);
     }
     // The vectored exception handler allows us to catch exceptions ahead of any
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -306,18 +306,16 @@ pref("browser.urlbar.filter.javascript",
 pref("browser.urlbar.maxRichResults", 10);
 // The amount of time (ms) to wait after the user has stopped typing
 // before starting to perform autocomplete.  50 is the default set in
 // autocomplete.xml.
 pref("browser.urlbar.delay", 50);
 
 // The maximum number of historical search results to show.
 pref("browser.urlbar.maxHistoricalSearchSuggestions", 0);
-// The awesomebar result composition.
-pref("browser.urlbar.matchBuckets", "suggestion:4,general:5");
 
 // The default behavior for the urlbar can be configured to use any combination
 // of the match filters with each additional filter adding more results (union).
 pref("browser.urlbar.suggest.history",              true);
 pref("browser.urlbar.suggest.bookmark",             true);
 pref("browser.urlbar.suggest.openpage",             true);
 pref("browser.urlbar.suggest.searches",             true);
 
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -91,22 +91,16 @@
                 oncommand="gBrowser.unpinTab(TabContextMenu.contextTab);"/>
       <menuitem id="context_duplicateTab" label="&duplicateTab.label;"
                 accesskey="&duplicateTab.accesskey;"
                 oncommand="duplicateTabIn(TabContextMenu.contextTab, 'tab');"/>
       <menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;"
                 accesskey="&moveToNewWindow.accesskey;"
                 tbattr="tabbrowser-multiple"
                 oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
-#ifdef E10S_TESTING_ONLY
-      <menuitem id="context_openNonRemoteWindow" label="Open in new non-e10s window"
-                tbattr="tabbrowser-remote"
-                hidden="true"
-                oncommand="gBrowser.openNonRemoteWindow(TabContextMenu.contextTab);"/>
-#endif
       <menuseparator id="context_sendTabToDevice_separator"/>
       <menu id="context_sendTabToDevice" label="&sendTabToDevice.label;"
             accesskey="&sendTabToDevice.accesskey;">
         <menupopup id="context_sendTabToDevicePopupMenu"
                    onpopupshowing="gSync.populateSendTabToDevicesMenu(event.target, TabContextMenu.contextTab.linkedBrowser.currentURI.spec, TabContextMenu.contextTab.linkedBrowser.contentTitle);"/>
       </menu>
       <menuseparator/>
       <menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;"
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -846,17 +846,17 @@ function makePreview(row) {
 
     var newImage = new Image;
     newImage.id = "thepreviewimage";
     var physWidth = 0, physHeight = 0;
     var width = 0, height = 0;
 
     let serial = Components.classes["@mozilla.org/network/serialization-helper;1"]
                            .getService(Components.interfaces.nsISerializationHelper);
-    let loadingPrincipalStr = serial.serializeToString(gDocInfo.principal);
+    let triggeringPrinStr = serial.serializeToString(gDocInfo.principal);
     if ((item.HTMLLinkElement || item.HTMLInputElement ||
          item.HTMLImageElement || item.SVGImageElement ||
          (item.HTMLObjectElement && mimeType && mimeType.startsWith("image/")) ||
          isBG) && isProtocolAllowed) {
       // We need to wait for the image to finish loading before using width & height
       newImage.addEventListener("loadend", function() {
         physWidth = newImage.width || 0;
         physHeight = newImage.height || 0;
@@ -905,35 +905,35 @@ function makePreview(row) {
             imageSize = gBundle.getFormattedString("mediaDimensions",
                                                    [formatNumber(width),
                                                     formatNumber(height)]);
           }
         }
         setItemValue("imagedimensiontext", imageSize);
       }, {once: true});
 
-      newImage.setAttribute("loadingprincipal", loadingPrincipalStr);
+      newImage.setAttribute("triggeringprincipal", triggeringPrinStr);
       newImage.setAttribute("src", url);
     } else {
       // Handle the case where newImage is not used for width & height
       if (item.HTMLVideoElement && isProtocolAllowed) {
         newImage = document.createElementNS("http://www.w3.org/1999/xhtml", "video");
         newImage.id = "thepreviewimage";
-        newImage.setAttribute("loadingprincipal", loadingPrincipalStr);
+        newImage.setAttribute("triggeringprincipal", triggeringPrinStr);
         newImage.src = url;
         newImage.controls = true;
         width = physWidth = item.videoWidth;
         height = physHeight = item.videoHeight;
 
         document.getElementById("theimagecontainer").collapsed = false;
         document.getElementById("brokenimagecontainer").collapsed = true;
       } else if (item.HTMLAudioElement && isProtocolAllowed) {
         newImage = new Audio;
         newImage.id = "thepreviewimage";
-        newImage.setAttribute("loadingprincipal", loadingPrincipalStr);
+        newImage.setAttribute("triggeringprincipal", triggeringPrinStr);
         newImage.src = url;
         newImage.controls = true;
         isAudio = true;
 
         document.getElementById("theimagecontainer").collapsed = false;
         document.getElementById("brokenimagecontainer").collapsed = true;
       } else {
         // fallback image for protocols not allowed (e.g., javascript:)
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -3953,30 +3953,16 @@
             }
 
             // tell a new window to take the "dropped" tab
             return window.openDialog(getBrowserURL(), "_blank", options, aTab);
           ]]>
         </body>
       </method>
 
-      <!-- Opens a given tab to a non-remote window. -->
-      <method name="openNonRemoteWindow">
-        <parameter name="aTab"/>
-        <body>
-          <![CDATA[
-            if (!AppConstants.E10S_TESTING_ONLY) {
-              throw "This method is intended only for e10s testing!";
-            }
-            let url = aTab.linkedBrowser.currentURI.spec;
-            return window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no,non-remote", url);
-          ]]>
-        </body>
-      </method>
-
       <method name="moveTabTo">
         <parameter name="aTab"/>
         <parameter name="aIndex"/>
         <parameter name="aKeepRelatedTabs"/>
         <body>
         <![CDATA[
           var oldPosition = aTab._tPos;
           if (oldPosition == aIndex)
@@ -5543,24 +5529,21 @@
                   "tabs.unmuteAudio.background.tooltip" :
                   "tabs.muteAudio.background.tooltip";
               }
 
               label = gTabBrowserBundle.GetStringFromName(stringID);
             }
           } else {
             label = tab._fullLabel || tab.getAttribute("label");
-            if (AppConstants.E10S_TESTING_ONLY &&
+            if (AppConstants.NIGHTLY_BUILD &&
                 tab.linkedBrowser &&
-                tab.linkedBrowser.isRemoteBrowser) {
-              label += " - e10s";
-              if (tab.linkedBrowser.frameLoader &&
-                  Services.appinfo.maxWebProcessCount > 1) {
-                label += " (" + tab.linkedBrowser.frameLoader.tabParent.osPid + ")";
-              }
+                tab.linkedBrowser.isRemoteBrowser &&
+                tab.linkedBrowser.frameLoader) {
+              label += " (pid " + tab.linkedBrowser.frameLoader.tabParent.osPid + ")";
             }
             if (tab.userContextId) {
               label = gTabBrowserBundle.formatStringFromName("tabs.containers.tooltip", [label, ContextualIdentityService.getUserContextLabel(tab.userContextId)], 2);
             }
           }
 
           event.target.setAttribute("label", label);
         ]]></body>
@@ -7764,17 +7747,17 @@
                   anonid="tab-loading-burst"
                   class="tab-loading-burst"/>
         <xul:hbox xbl:inherits="pinned,selected=visuallyselected,titlechanged,attention"
                   class="tab-content" align="center">
           <xul:hbox xbl:inherits="fadein,pinned,busy,progress,selected=visuallyselected"
                     anonid="tab-throbber"
                     class="tab-throbber"
                     layer="true"/>
-          <xul:image xbl:inherits="src=image,loadingprincipal=iconloadingprincipal,requestcontextid,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
+          <xul:image xbl:inherits="src=image,triggeringprincipal=iconloadingprincipal,requestcontextid,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
                      anonid="tab-icon-image"
                      class="tab-icon-image"
                      validate="never"
                      role="presentation"/>
           <xul:image xbl:inherits="sharing,selected=visuallyselected,pinned"
                      anonid="sharing-icon"
                      class="tab-sharing-icon-overlay"
                      role="presentation"/>
--- a/browser/base/content/test/alerts/browser.ini
+++ b/browser/base/content/test/alerts/browser.ini
@@ -1,12 +1,13 @@
 [DEFAULT]
 support-files =
   head.js
   file_dom_notifications.html
 
 [browser_notification_close.js]
 skip-if = os == 'win' # Bug 1227785
 [browser_notification_do_not_disturb.js]
+skip-if = os == 'win' # Bug 1352791
 [browser_notification_open_settings.js]
 [browser_notification_remove_permission.js]
 [browser_notification_replace.js]
 [browser_notification_tab_switching.js]
--- a/browser/base/content/test/pageinfo/browser_pageinfo_firstPartyIsolation.js
+++ b/browser/base/content/test/pageinfo/browser_pageinfo_firstPartyIsolation.js
@@ -24,17 +24,17 @@ function testFirstPartyDomain(pageInfo) 
         tree.treeBoxObject.ensureRowIsVisible(i);
         tree.focus();
 
         let preview = pageInfo.document.getElementById("thepreviewimage");
         info("preview.src=" + preview.src);
 
         // For <img>, we will query imgIRequest.imagePrincipal later, so we wait
         // for loadend event. For <audio> and <video>, so far we only can get
-        // the loadingprincipal attribute on the node, so we simply wait for
+        // the triggeringprincipal attribute on the node, so we simply wait for
         // loadstart.
         if (i == 0) {
           await waitForEvent(preview, "loadend");
         } else {
           await waitForEvent(preview, "loadstart");
         }
 
         info("preview load " + i);
@@ -43,20 +43,20 @@ function testFirstPartyDomain(pageInfo) 
         // it won't have origin attributes, now we've changed to loadingPrincipal
         // to the content in bug 1376971, it should have firstPartyDomain set.
         if (i == 0) {
           let req = preview.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST);
           Assert.equal(req.imagePrincipal.originAttributes.firstPartyDomain, EXPECTED_DOMAIN,
                        "imagePrincipal should have firstPartyDomain set to " + EXPECTED_DOMAIN);
         }
 
-        // Check the node has the attribute 'loadingprincipal'.
+        // Check the node has the attribute 'triggeringprincipal'.
         let serial = Components.classes["@mozilla.org/network/serialization-helper;1"]
                                .getService(Components.interfaces.nsISerializationHelper);
-        let loadingPrincipalStr = preview.getAttribute("loadingprincipal");
+        let loadingPrincipalStr = preview.getAttribute("triggeringprincipal");
         let loadingPrincipal = serial.deserializeObject(loadingPrincipalStr);
         Assert.equal(loadingPrincipal.originAttributes.firstPartyDomain, EXPECTED_DOMAIN,
                      "loadingPrincipal should have firstPartyDomain set to " + EXPECTED_DOMAIN);
 
       }
 
       resolve();
     });
--- a/browser/components/preferences/in-content/main.xul
+++ b/browser/components/preferences/in-content/main.xul
@@ -13,28 +13,16 @@
 
 <script type="application/javascript"
         src="chrome://mozapps/content/preferences/fontbuilder.js"/>
 
 <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences.properties"/>
 
 <preferences id="mainPreferences" hidden="true" data-category="paneGeneral">
 
-#ifdef E10S_TESTING_ONLY
-    <preference id="browser.tabs.remote.autostart"
-                name="browser.tabs.remote.autostart"
-                type="bool"/>
-    <preference id="e10sTempPref"
-                name="browser.tabs.remote.autostart.2"
-                type="bool"/>
-    <preference id="e10sForceEnable"
-                name="browser.tabs.remote.force-enable"
-                type="bool"/>
-#endif
-
     <!-- Startup -->
     <preference id="browser.startup.page"
                 name="browser.startup.page"
                 type="int"/>
     <preference id="browser.startup.homepage"
                 name="browser.startup.homepage"
                 type="wstring"/>
 
@@ -289,21 +277,16 @@
       <deck id="getStarted">
         <label class="text-link">&getStarted.notloggedin.label;</label>
         <label class="text-link">&getStarted.configured.label;</label>
       </deck>
     </hbox>
   </vbox>
 #endif
 
-#ifdef E10S_TESTING_ONLY
-  <checkbox id="e10sAutoStart"
-            label="&e10sEnabled.label;"/>
-#endif
-
 #ifdef HAVE_SHELL_SERVICE
   <vbox id="defaultBrowserBox">
     <checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
               label="&alwaysCheckDefault2.label;" accesskey="&alwaysCheckDefault2.accesskey;"/>
     <deck id="setDefaultPane">
       <hbox align="center" class="indent">
         <image class="face-sad"/>
         <label id="isNotDefaultLabel" flex="1">&isNotDefault.label;</label>
--- a/browser/components/shell/test/test_headless_screenshot.html
+++ b/browser/components/shell/test/test_headless_screenshot.html
@@ -95,25 +95,51 @@ https://bugzilla.mozilla.org/show_bug.cg
       };
       reader.readAsDataURL(blob);
     });
     await OS.File.remove(screenshotPath);
   }
 
   (async function() {
     SimpleTest.waitForExplicitFinish();
+
+    // On Windows, nsICommandLine doesn't support double-dash arguments,
+    // nor single-dash arguments whose value is specified via an equals sign,
+    // so we only test those variations on non-Windows platforms.
+
+    // Test all four basic variations of the "screenshot" argument
+    // when a file path is specified.
     await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", screenshotPath], screenshotPath);
+    await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", `-screenshot=${screenshotPath}`], screenshotPath);
+    await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "--screenshot", screenshotPath], screenshotPath);
+    await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", `--screenshot=${screenshotPath}`], screenshotPath);
+
+    // Test variations of the "screenshot" argument when a file path
+    // isn't specified.
     await testFileCreationPositive(["-screenshot", "http://mochi.test:8888/headless.html"], "screenshot.png");
     await testFileCreationPositive(["http://mochi.test:8888/headless.html", "-screenshot"], "screenshot.png");
+    await testFileCreationPositive(["--screenshot", "http://mochi.test:8888/headless.html"], "screenshot.png");
+    await testFileCreationPositive(["http://mochi.test:8888/headless.html", "--screenshot"], "screenshot.png");
+
+    // Test invalid URL arguments (either no argument or too many arguments).
     await testFileCreationNegative(["-screenshot"], "screenshot.png");
     await testFileCreationNegative(["http://mochi.test:8888/headless.html", "http://mochi.test:8888/headless.html", "-screenshot"], "screenshot.png");
+
+    // Test all four basic variations of the "window-size" argument.
+    await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "-window-size", "800"], "screenshot.png");
+    await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "-window-size=800"], "screenshot.png");
+    await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "--window-size", "800"], "screenshot.png");
+    await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "--window-size=800"], "screenshot.png");
+
+    // Test other variations of the "window-size" argument.
     await testWindowSizePositive(800, 600);
     await testWindowSizePositive(1234);
-    await testFileCreationNegative(["-url", "http://mochi.test:8888/headless.html", "-screenshot", screenshotPath, "-window-size", "hello"], screenshotPath);
-    await testFileCreationNegative(["-url", "http://mochi.test:8888/headless.html", "-screenshot", screenshotPath, "-window-size", "800,"], screenshotPath);
+    await testFileCreationNegative(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "-window-size", "hello"], "screenshot.png");
+    await testFileCreationNegative(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "-window-size", "800,"], "screenshot.png");
+
     SimpleTest.finish();
   })();
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1378010">Mozilla Bug 1378010</a>
 <p id="display"></p>
 <div id="content" style="display: none">
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -10475,69 +10475,69 @@ nsContentUtils::AppendNativeAnonymousChi
   // Detect and handle this case.
   if (!(aFlags & nsIContent::eSkipDocumentLevelNativeAnonymousContent) &&
       aContent == aContent->OwnerDoc()->GetRootElement()) {
     AppendDocumentLevelNativeAnonymousContentTo(aContent->OwnerDoc(), aKids);
   }
 }
 
 /* static */ bool
-nsContentUtils::GetLoadingPrincipalForXULNode(nsIContent* aLoadingNode,
-                                              nsIPrincipal* aDefaultPrincipal,
-                                              nsIPrincipal** aLoadingPrincipal)
+nsContentUtils::QueryTriggeringPrincipal(nsIContent* aLoadingNode,
+                                         nsIPrincipal* aDefaultPrincipal,
+                                         nsIPrincipal** aTriggeringPrincipal)
 {
   MOZ_ASSERT(aLoadingNode);
-  MOZ_ASSERT(aLoadingPrincipal);
+  MOZ_ASSERT(aTriggeringPrincipal);
 
   bool result = false;
   nsCOMPtr<nsIPrincipal> loadingPrincipal = aDefaultPrincipal;
   if (!loadingPrincipal) {
     loadingPrincipal = aLoadingNode->NodePrincipal();
   }
+
+  // If aLoadingNode is content, bail out early.
+  if (!aLoadingNode->NodePrincipal()->GetIsSystemPrincipal()) {
+    loadingPrincipal.forget(aTriggeringPrincipal);
+    return result;
+  }
+
   nsAutoString loadingStr;
-  aLoadingNode->GetAttr(kNameSpaceID_None, nsGkAtoms::loadingprincipal,
+  aLoadingNode->GetAttr(kNameSpaceID_None, nsGkAtoms::triggeringprincipal,
                         loadingStr);
 
-  // Fall back to mContent's principal if 'loadingprincipal' isn't specified,
-  // or if the doc isn't loaded by System Principal.
-  if (loadingStr.IsEmpty() ||
-      !aLoadingNode->OwnerDoc()->NodePrincipal()->GetIsSystemPrincipal()) {
-    loadingPrincipal.forget(aLoadingPrincipal);
+  // Fall back if 'triggeringprincipal' isn't specified,
+  if (loadingStr.IsEmpty()) {
+    loadingPrincipal.forget(aTriggeringPrincipal);
     return result;
   }
 
   nsCOMPtr<nsISupports> serializedPrincipal;
   NS_DeserializeObject(NS_ConvertUTF16toUTF8(loadingStr),
                        getter_AddRefs(serializedPrincipal));
-  loadingPrincipal = do_QueryInterface(serializedPrincipal);
-  if (loadingPrincipal) {
-    // We only allow specifying loadingprincipal attribute on a node loaded by
-    // SystemPrincipal.
-    MOZ_ASSERT(nsContentUtils::IsSystemPrincipal(aLoadingNode->NodePrincipal()),
-               "aLoadingNode Should be loaded with SystemPrincipal");
-
+  nsCOMPtr<nsIPrincipal> serializedPrin = do_QueryInterface(serializedPrincipal);
+  if (serializedPrin) {
     result = true;
+    serializedPrin.forget(aTriggeringPrincipal);
   } else {
     // Fallback if the deserialization is failed.
-    loadingPrincipal = aLoadingNode->NodePrincipal();
-  }
-
-  loadingPrincipal.forget(aLoadingPrincipal);
+    loadingPrincipal.forget(aTriggeringPrincipal);
+  }
+
   return result;
 }
 
 /* static */ void
 nsContentUtils::GetContentPolicyTypeForUIImageLoading(nsIContent* aLoadingNode,
-                                                      nsIPrincipal** aLoadingPrincipal,
+                                                      nsIPrincipal** aTriggeringPrincipal,
                                                       nsContentPolicyType& aContentPolicyType,
                                                       uint64_t* aRequestContextID)
 {
   MOZ_ASSERT(aRequestContextID);
 
-  bool result = GetLoadingPrincipalForXULNode(aLoadingNode, aLoadingPrincipal);
+  bool result = QueryTriggeringPrincipal(aLoadingNode, aTriggeringPrincipal);
   if (result) {
     // Set the content policy type to TYPE_INTERNAL_IMAGE_FAVICON for
     // indicating it's a favicon loading.
     aContentPolicyType = nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON;
 
     nsAutoString requestContextID;
     aLoadingNode->GetAttr(kNameSpaceID_None, nsGkAtoms::requestcontextid,
                           requestContextID);
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -3078,44 +3078,45 @@ public:
    *
    * See `AllChildrenIterator` for the description of the `aFlags` parameter.
    */
   static void AppendNativeAnonymousChildren(const nsIContent* aContent,
                                             nsTArray<nsIContent*>& aKids,
                                             uint32_t aFlags);
 
   /**
-   * Query loadingPrincipal if it is specified as 'loadingprincipal' attribute on
-   * aLoadingNode, otherwise the NodePrincipal of aLoadingNode is returned
-   * (which is System Principal).
+   * Query triggeringPrincipal if there's a 'triggeringprincipal' attribute on
+   * aLoadingNode, if no such attribute is specified, aDefaultPrincipal is
+   * returned if it is provided, otherwise the NodePrincipal of aLoadingNode is
+   * returned.
    *
-   * Return true if aLoadingPrincipal has 'loadingprincipal' attributes, and
-   * the value 'loadingprincipal' is also successfully deserialized, otherwise
+   * Return true if aLoadingNode has a 'triggeringprincipal' attribute, and
+   * the value 'triggeringprincipal' is also successfully deserialized, otherwise
    * return false.
    */
   static bool
-  GetLoadingPrincipalForXULNode(nsIContent* aLoadingNode,
-                                nsIPrincipal* aDefaultPrincipal,
-                                nsIPrincipal** aTriggeringPrincipal);
+  QueryTriggeringPrincipal(nsIContent* aLoadingNode,
+                           nsIPrincipal* aDefaultPrincipal,
+                           nsIPrincipal** aTriggeringPrincipal);
 
   static bool
-  GetLoadingPrincipalForXULNode(nsIContent* aLoadingNode,
-                                nsIPrincipal** aTriggeringPrincipal)
+  QueryTriggeringPrincipal(nsIContent* aLoadingNode,
+                           nsIPrincipal** aTriggeringPrincipal)
   {
-    return GetLoadingPrincipalForXULNode(aLoadingNode, nullptr, aTriggeringPrincipal);
+    return QueryTriggeringPrincipal(aLoadingNode, nullptr, aTriggeringPrincipal);
   }
 
   /**
    * Returns the content policy type that should be used for loading images
    * for displaying in the UI.  The sources of such images can be <xul:image>,
    * <xul:menuitem> on OSX where we load the image through nsMenuItemIconX, etc.
    */
   static void
   GetContentPolicyTypeForUIImageLoading(nsIContent* aLoadingNode,
-                                        nsIPrincipal** aLoadingPrincipal,
+                                        nsIPrincipal** aTriggeringPrincipal,
                                         nsContentPolicyType& aContentPolicyType,
                                         uint64_t* aRequestContextID);
 
   static nsresult
   CreateJSValueFromSequenceOfObject(JSContext* aCx,
                                     const mozilla::dom::Sequence<JSObject*>& aTransfer,
                                     JS::MutableHandle<JS::Value> aValue);
 
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -639,17 +639,17 @@ GK_ATOM(listcol, "listcol")
 GK_ATOM(listcols, "listcols")
 GK_ATOM(listener, "listener")
 GK_ATOM(listhead, "listhead")
 GK_ATOM(listheader, "listheader")
 GK_ATOM(listing, "listing")
 GK_ATOM(listitem, "listitem")
 GK_ATOM(listrows, "listrows")
 GK_ATOM(load, "load")
-GK_ATOM(loadingprincipal, "loadingprincipal")
+GK_ATOM(triggeringprincipal, "triggeringprincipal")
 GK_ATOM(localedir, "localedir")
 GK_ATOM(localName, "local-name")
 GK_ATOM(longdesc, "longdesc")
 GK_ATOM(loop, "loop")
 GK_ATOM(low, "low")
 GK_ATOM(lowerAlpha, "lower-alpha")
 GK_ATOM(lowerFirst, "lower-first")
 GK_ATOM(lowerRoman, "lower-roman")
--- a/dom/base/nsImageLoadingContent.cpp
+++ b/dom/base/nsImageLoadingContent.cpp
@@ -1039,20 +1039,20 @@ nsImageLoadingContent::LoadImage(nsIURI*
   }
 
   RefPtr<imgRequestProxy>& req = PrepareNextRequest(aImageLoadType);
   nsCOMPtr<nsIContent> content =
       do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
 
   nsCOMPtr<nsIPrincipal> triggeringPrincipal;
   bool result =
-    nsContentUtils::GetLoadingPrincipalForXULNode(content, aTriggeringPrincipal,
-                                                  getter_AddRefs(triggeringPrincipal));
+    nsContentUtils::QueryTriggeringPrincipal(content, aTriggeringPrincipal,
+                                             getter_AddRefs(triggeringPrincipal));
 
-  // If result is true, which means this node has specified 'loadingprincipal'
+  // If result is true, which means this node has specified 'triggeringprincipal'
   // attribute on it, so we use favicon as the policy type.
   nsContentPolicyType policyType = result ?
                                      nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON:
                                      PolicyTypeForLoad(aImageLoadType);
 
   nsCOMPtr<nsINode> thisNode =
     do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
   nsresult rv = nsContentUtils::LoadImage(aNewURI,
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -2414,28 +2414,30 @@ nsRange::CutContents(DocumentFragment** 
                                getter_AddRefs(farthestAncestor));
       NS_ENSURE_SUCCESS(rv, rv);
 
       ErrorResult res;
       if (farthestAncestor)
       {
         nsCOMPtr<nsINode> n = do_QueryInterface(commonCloneAncestor);
         n->AppendChild(*farthestAncestor, res);
+        res.WouldReportJSException();
         if (NS_WARN_IF(res.Failed())) {
           return res.StealNSResult();
         }
       }
 
       nsMutationGuard guard;
       nsCOMPtr<nsINode> parent = nodeToResult->GetParentNode();
       if (closestAncestor) {
         closestAncestor->AppendChild(*nodeToResult, res);
       } else {
         commonCloneAncestor->AppendChild(*nodeToResult, res);
       }
+      res.WouldReportJSException();
       if (NS_WARN_IF(res.Failed())) {
         return res.StealNSResult();
       }
       NS_ENSURE_STATE(!guard.Mutated(parent ? 2 : 1) ||
                       ValidateCurrentNode(this, iter));
     } else if (nodeToResult) {
       nsMutationGuard guard;
       nsCOMPtr<nsINode> node = nodeToResult;
--- a/dom/events/test/pointerevents/pointerevent_support.js
+++ b/dom/events/test/pointerevents/pointerevent_support.js
@@ -158,20 +158,23 @@ function updateDescriptionComplete() {
 
 function updateDescriptionSecondStepTouchActionElement(target, scrollReturnInterval) {
     window.setTimeout(function() {
     objectScroller(target, 'up', 0);}
     , scrollReturnInterval);
     document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT moving your outside of the red border";
 }
 
-function updateDescriptionThirdStepTouchActionElement(target, scrollReturnInterval) {
+function updateDescriptionThirdStepTouchActionElement(target, scrollReturnInterval, callback = null) {
     window.setTimeout(function() {
-    objectScroller(target, 'left', 0);}
-    , scrollReturnInterval);
+        objectScroller(target, 'left', 0);
+        if (callback) {
+            callback();
+        }
+    }, scrollReturnInterval);
     document.getElementById('desc').innerHTML = "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the element. Then tap complete button";
 }
 
 function updateDescriptionFourthStepTouchActionElement(target, scrollReturnInterval) {
     document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT starting your touch inside of the element";
 }
 
 function objectScroller(target, direction, value) {
--- a/dom/events/test/pointerevents/pointerevent_touch-action-button-test_touch-manual.html
+++ b/dom/events/test/pointerevents/pointerevent_touch-action-button-test_touch-manual.html
@@ -83,20 +83,21 @@
                             test_touchaction_div.step(function () {
                                 yScrollIsReceived = true;
                             });
                             updateDescriptionSecondStepTouchActionElement(target0, scrollReturnInterval);
                         }
 
                         if(xScrollIsReceived && yScrollIsReceived) {
                             test_touchaction_div.done();
-                            updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval);
-                            setTimeout(function() {
-                                isFirstPart = false;
-                            }, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval, function () {
+                                setTimeout(function() {
+                                    isFirstPart = false;
+                                }, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            });
                         }
                     }
                     else {
                         test_touchaction_button.step(failOnScroll, "scroll received while shouldn't");
                     }
                 });
             }
         </script>
--- a/dom/events/test/pointerevents/pointerevent_touch-action-span-test_touch-manual.html
+++ b/dom/events/test/pointerevents/pointerevent_touch-action-span-test_touch-manual.html
@@ -86,24 +86,25 @@
                             test_touchaction_div.step(function () {
                                 yScrollIsReceived = true;
                             });
                             updateDescriptionSecondStepTouchActionElement(target0, scrollReturnInterval);
                         }
 
                         if(xScrollIsReceived && yScrollIsReceived) {
                             test_touchaction_div.done();
-                            updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval);
-                            setTimeout(function() {
-                                isFirstPart = false;
-                                xScr0 = target0.scrollLeft;
-                                xScr0 = target0.scrollLeft;
-                                xScrollIsReceived = false;
-                                yScrollIsReceived = false;
-                            }, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval, function () {
+                                setTimeout(function() {
+                                    isFirstPart = false;
+                                    xScr0 = target0.scrollLeft;
+                                    xScr0 = target0.scrollLeft;
+                                    xScrollIsReceived = false;
+                                    yScrollIsReceived = false;
+                                }, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            });
                         }
                     }
                 });
             }
         </script>
         <h1>touch-action: none</h1>
         <div id="complete-notice">
             <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
--- a/dom/events/test/pointerevents/pointerevent_touch-action-table-test_touch-manual.html
+++ b/dom/events/test/pointerevents/pointerevent_touch-action-table-test_touch-manual.html
@@ -98,39 +98,43 @@
                             test_touchaction_row.step(function () {
                                 yScrollIsReceived = true;
                             });
                             updateDescriptionSecondStepTable(target0, scrollReturnInterval);
                         }
 
                         if(xScrollIsReceived && yScrollIsReceived) {
                             test_touchaction_row.done();
-                            updateDescriptionThirdStepTable(target0, scrollReturnInterval);
-                            setTimeout(function() {
-                                isFirstPart = false;
-                            }, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            updateDescriptionThirdStepTable(target0, scrollReturnInterval, function() {
+                                setTimeout(function() {
+                                    isFirstPart = false;
+                                }, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            });
                         }
                     }
                     else {
                         test_touchaction_cell.step(failOnScroll, "scroll received while shouldn't");
                     }
                 });
             }
 
             function updateDescriptionSecondStepTable(target, scrollReturnInterval, element) {
                 window.setTimeout(function() {
                     objectScroller(target, 'up', 0);
                 }
                 , scrollReturnInterval);
                 document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT staring your touch over the Row 1";
             }
 
-            function updateDescriptionThirdStepTable(target, scrollReturnInterval) {
+            function updateDescriptionThirdStepTable(target, scrollReturnInterval, callback = null) {
                 window.setTimeout(function() {
                     objectScroller(target, 'left', 0);
+                    if (callback) {
+                        callback();
+                    }
                 }
                 , scrollReturnInterval);
                 document.getElementById('desc').innerHTML = "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the Cell 3";
             }
 
         </script>
         <h1>touch-action: none</h1>
         <div id="complete-notice">
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1188,26 +1188,27 @@ public:
       securityFlags |= nsILoadInfo::SEC_COOKIES_INCLUDE;
     }
 
     MOZ_ASSERT(aElement->IsAnyOfHTMLElements(nsGkAtoms::audio, nsGkAtoms::video));
     nsContentPolicyType contentPolicyType = aElement->IsHTMLElement(nsGkAtoms::audio)
       ? nsIContentPolicy::TYPE_INTERNAL_AUDIO :
         nsIContentPolicy::TYPE_INTERNAL_VIDEO;
 
-    // If aElement has 'loadingprincipal' attribute, we will use the value as
+    // If aElement has 'triggeringprincipal' attribute, we will use the value as
     // triggeringPrincipal for the channel, otherwise it will default to use
     // aElement->NodePrincipal().
-    // This function returns true when aElement has 'loadingprincipal', so if
+    // This function returns true when aElement has 'triggeringprincipal', so if
     // setAttrs is true we will override the origin attributes on the channel
     // later.
     nsCOMPtr<nsIPrincipal> triggeringPrincipal;
-    bool setAttrs = nsContentUtils::GetLoadingPrincipalForXULNode(aElement,
-                                    aElement->mLoadingSrcTriggeringPrincipal,
-                                    getter_AddRefs(triggeringPrincipal));
+    bool setAttrs =
+      nsContentUtils::QueryTriggeringPrincipal(aElement,
+                                               aElement->mLoadingSrcTriggeringPrincipal,
+                                               getter_AddRefs(triggeringPrincipal));
 
     nsCOMPtr<nsILoadGroup> loadGroup = aElement->GetDocumentLoadGroup();
     nsCOMPtr<nsIChannel> channel;
     nsresult rv =
       NS_NewChannelWithTriggeringPrincipal(getter_AddRefs(channel),
                                            aElement->mLoadingSrc,
                                            static_cast<Element*>(aElement),
                                            triggeringPrincipal,
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -497,17 +497,17 @@ skip-if = toolkit == 'android' # bug 939
 [test_link_sizes.html]
 [test_map_attributes_reflection.html]
 [test_meta_attributes_reflection.html]
 [test_mod_attributes_reflection.html]
 [test_named_options.html]
 [test_nested_invalid_fieldsets.html]
 [test_object_attributes_reflection.html]
 [test_object_plugin_nav.html]
-skip-if = (toolkit == 'android') || (os == 'win' && debug) # plugins not supported on android, bug 1388764 for debug
+skip-if = (toolkit == 'android') || ((os == 'win' || os == 'linux') && debug) # plugins not supported on android, bug 1388764 for debug
 [test_ol_attributes_reflection.html]
 [test_option_defaultSelected.html]
 [test_option_selected_state.html]
 [test_param_attributes_reflection.html]
 [test_q_attributes_reflection.html]
 [test_restore_from_parser_fragment.html]
 [test_rowscollection.html]
 [test_srcdoc-2.html]
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -4920,22 +4920,19 @@ CreateStorageConnection(nsIFile* aDBFile
   return NS_OK;
 }
 
 already_AddRefed<nsIFile>
 GetFileForPath(const nsAString& aPath)
 {
   MOZ_ASSERT(!aPath.IsEmpty());
 
-  nsCOMPtr<nsIFile> file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
-  if (NS_WARN_IF(!file)) {
-    return nullptr;
-  }
-
-  if (NS_WARN_IF(NS_FAILED(file->InitWithPath(aPath)))) {
+  nsCOMPtr<nsIFile> file;
+  if (NS_WARN_IF(NS_FAILED(NS_NewLocalFile(aPath, false,
+                                           getter_AddRefs(file))))) {
     return nullptr;
   }
 
   return file.forget();
 }
 
 nsresult
 GetStorageConnection(nsIFile* aDatabaseFile,
@@ -11250,23 +11247,18 @@ DatabaseConnection::EnableQuotaChecks()
 }
 
 nsresult
 DatabaseConnection::GetFileSize(const nsAString& aPath, int64_t* aResult)
 {
   MOZ_ASSERT(!aPath.IsEmpty());
   MOZ_ASSERT(aResult);
 
-  nsresult rv;
-  nsCOMPtr<nsIFile> file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = file->InitWithPath(aPath);
+  nsCOMPtr<nsIFile> file;
+  nsresult rv = NS_NewLocalFile(aPath, false, getter_AddRefs(file));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   int64_t fileSize;
 
   bool exists;
   rv = file->Exists(&exists);
--- a/dom/media/ChannelMediaResource.cpp
+++ b/dom/media/ChannelMediaResource.cpp
@@ -758,43 +758,43 @@ ChannelMediaResource::RecreateChannel()
   nsSecurityFlags securityFlags = element->ShouldCheckAllowOrigin()
                                   ? nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS
                                   : nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS;
 
   MOZ_ASSERT(element->IsAnyOfHTMLElements(nsGkAtoms::audio, nsGkAtoms::video));
   nsContentPolicyType contentPolicyType = element->IsHTMLElement(nsGkAtoms::audio) ?
     nsIContentPolicy::TYPE_INTERNAL_AUDIO : nsIContentPolicy::TYPE_INTERNAL_VIDEO;
 
-  // If element has 'loadingprincipal' attribute, we will use the value as
-  // loadingPrincipal for the channel, otherwise it will default to use
+  // If element has 'triggeringprincipal' attribute, we will use the value as
+  // triggeringPrincipal for the channel, otherwise it will default to use
   // aElement->NodePrincipal().
-  // This function returns true when element has 'loadingprincipal', so if
+  // This function returns true when element has 'triggeringprincipal', so if
   // setAttrs is true we will override the origin attributes on the channel
   // later.
-  nsCOMPtr<nsIPrincipal> loadingPrincipal;
+  nsCOMPtr<nsIPrincipal> triggeringPrincipal;
   bool setAttrs =
-    nsContentUtils::GetLoadingPrincipalForXULNode(element,
-                                                  getter_AddRefs(loadingPrincipal));
+    nsContentUtils::QueryTriggeringPrincipal(element,
+                                             getter_AddRefs(triggeringPrincipal));
 
   nsresult rv = NS_NewChannelWithTriggeringPrincipal(getter_AddRefs(mChannel),
                                                      mURI,
                                                      element,
-                                                     loadingPrincipal,
+                                                     triggeringPrincipal,
                                                      securityFlags,
                                                      contentPolicyType,
                                                      loadGroup,
                                                      nullptr,  // aCallbacks
                                                      loadFlags);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (setAttrs) {
     nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
     if (loadInfo) {
       // The function simply returns NS_OK, so we ignore the return value.
-      Unused << loadInfo->SetOriginAttributes(loadingPrincipal->OriginAttributesRef());
+      Unused << loadInfo->SetOriginAttributes(triggeringPrincipal->OriginAttributesRef());
    }
   }
 
   nsCOMPtr<nsIClassOfService> cos(do_QueryInterface(mChannel));
   if (cos) {
     // Unconditionally disable throttling since we want the media to fluently
     // play even when we switch the tab to background.
     cos->AddClassFlags(nsIClassOfService::DontThrottle);
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -3579,26 +3579,21 @@ QuotaManager::CollectOriginsForEviction(
   }
 
   return 0;
 }
 
 nsresult
 QuotaManager::Init(const nsAString& aBasePath)
 {
-  nsresult rv;
 
   mBasePath = aBasePath;
 
-  nsCOMPtr<nsIFile> baseDir = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = baseDir->InitWithPath(aBasePath);
+  nsCOMPtr<nsIFile> baseDir;
+  nsresult rv = NS_NewLocalFile(aBasePath, false, getter_AddRefs(baseDir));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = CloneStoragePath(baseDir,
                         NS_LITERAL_STRING(INDEXEDDB_DIRECTORY_NAME),
                         mIndexedDBPath);
   if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -3942,21 +3937,18 @@ QuotaManager::GetQuotaObject(Persistence
                              int64_t* aFileSizeOut /* = nullptr */)
 {
   NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
 
   if (aFileSizeOut) {
     *aFileSizeOut = 0;
   }
 
-  nsresult rv;
-  nsCOMPtr<nsIFile> file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, nullptr);
-
-  rv = file->InitWithPath(aPath);
+  nsCOMPtr<nsIFile> file;
+  nsresult rv = NS_NewLocalFile(aPath, false, getter_AddRefs(file));
   NS_ENSURE_SUCCESS(rv, nullptr);
 
   return GetQuotaObject(aPersistenceType, aGroup, aOrigin, file, aFileSizeOut);
 }
 
 Nullable<bool>
 QuotaManager::OriginPersisted(const nsACString& aGroup,
                               const nsACString& aOrigin)
@@ -4001,22 +3993,19 @@ QuotaManager::AbortOperationsForProcess(
   }
 }
 
 nsresult
 QuotaManager::GetDirectoryForOrigin(PersistenceType aPersistenceType,
                                     const nsACString& aASCIIOrigin,
                                     nsIFile** aDirectory) const
 {
-  nsresult rv;
-  nsCOMPtr<nsIFile> directory =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = directory->InitWithPath(GetStoragePath(aPersistenceType));
+  nsCOMPtr<nsIFile> directory;
+  nsresult rv = NS_NewLocalFile(GetStoragePath(aPersistenceType), false,
+                                getter_AddRefs(directory));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoCString originSanitized(aASCIIOrigin);
   SanitizeOriginString(originSanitized);
 
   rv = directory->Append(NS_ConvertASCIItoUTF16(originSanitized));
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -4212,25 +4201,19 @@ QuotaManager::GetDirectoryMetadata2WithR
 }
 
 nsresult
 QuotaManager::InitializeRepository(PersistenceType aPersistenceType)
 {
   MOZ_ASSERT(aPersistenceType == PERSISTENCE_TYPE_TEMPORARY ||
              aPersistenceType == PERSISTENCE_TYPE_DEFAULT);
 
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> directory =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = directory->InitWithPath(GetStoragePath(aPersistenceType));
+  nsCOMPtr<nsIFile> directory;
+  nsresult rv = NS_NewLocalFile(GetStoragePath(aPersistenceType), false,
+                                getter_AddRefs(directory));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   bool created;
   rv = EnsureDirectory(directory, &created);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -4391,23 +4374,20 @@ QuotaManager::InitializeOrigin(Persisten
   return NS_OK;
 }
 
 nsresult
 QuotaManager::MaybeUpgradeIndexedDBDirectory()
 {
   AssertIsOnIOThread();
 
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> indexedDBDir =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = indexedDBDir->InitWithPath(mIndexedDBPath);
+
+  nsCOMPtr<nsIFile> indexedDBDir;
+  nsresult rv = NS_NewLocalFile(mIndexedDBPath, false,
+                                getter_AddRefs(indexedDBDir));
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool exists;
   rv = indexedDBDir->Exists(&exists);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!exists) {
     // Nothing to upgrade.
@@ -4418,21 +4398,19 @@ QuotaManager::MaybeUpgradeIndexedDBDirec
   rv = indexedDBDir->IsDirectory(&isDirectory);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!isDirectory) {
     NS_WARNING("indexedDB entry is not a directory!");
     return NS_OK;
   }
 
-  nsCOMPtr<nsIFile> persistentStorageDir =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = persistentStorageDir->InitWithPath(mStoragePath);
+  nsCOMPtr<nsIFile> persistentStorageDir;
+  rv = NS_NewLocalFile(mStoragePath, false,
+                       getter_AddRefs(persistentStorageDir));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = persistentStorageDir->Append(NS_LITERAL_STRING(PERSISTENT_DIRECTORY_NAME));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = persistentStorageDir->Exists(&exists);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -4457,25 +4435,20 @@ QuotaManager::MaybeUpgradeIndexedDBDirec
   return NS_OK;
 }
 
 nsresult
 QuotaManager::MaybeUpgradePersistentStorageDirectory()
 {
   AssertIsOnIOThread();
 
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> persistentStorageDir =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = persistentStorageDir->InitWithPath(mStoragePath);
+
+  nsCOMPtr<nsIFile> persistentStorageDir;
+  nsresult rv = NS_NewLocalFile(mStoragePath, false,
+                                getter_AddRefs(persistentStorageDir));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = persistentStorageDir->Append(NS_LITERAL_STRING(PERSISTENT_DIRECTORY_NAME));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
@@ -4497,23 +4470,19 @@ QuotaManager::MaybeUpgradePersistentStor
     return rv;
   }
 
   if (!isDirectory) {
     NS_WARNING("persistent entry is not a directory!");
     return NS_OK;
   }
 
-  nsCOMPtr<nsIFile> defaultStorageDir =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = defaultStorageDir->InitWithPath(mDefaultStoragePath);
+  nsCOMPtr<nsIFile> defaultStorageDir;
+  rv = NS_NewLocalFile(mDefaultStoragePath, false,
+                       getter_AddRefs(defaultStorageDir));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = defaultStorageDir->Exists(&exists);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
@@ -4529,23 +4498,19 @@ QuotaManager::MaybeUpgradePersistentStor
                                                /* aPersistent */ true);
 
   rv = helper->CreateOrUpgradeMetadataFiles();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // Upgrade metadata files for origin directories in temporary storage.
-  nsCOMPtr<nsIFile> temporaryStorageDir =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = temporaryStorageDir->InitWithPath(mTemporaryStoragePath);
+  nsCOMPtr<nsIFile> temporaryStorageDir;
+  rv = NS_NewLocalFile(mTemporaryStoragePath, false,
+                       getter_AddRefs(temporaryStorageDir));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = temporaryStorageDir->Exists(&exists);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
@@ -4580,25 +4545,19 @@ QuotaManager::MaybeUpgradePersistentStor
   return NS_OK;
 }
 
 nsresult
 QuotaManager::MaybeRemoveOldDirectories()
 {
   AssertIsOnIOThread();
 
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> indexedDBDir =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = indexedDBDir->InitWithPath(mIndexedDBPath);
+  nsCOMPtr<nsIFile> indexedDBDir;
+  nsresult rv = NS_NewLocalFile(mIndexedDBPath, false,
+                                getter_AddRefs(indexedDBDir));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   bool exists;
   rv = indexedDBDir->Exists(&exists);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -4608,23 +4567,19 @@ QuotaManager::MaybeRemoveOldDirectories(
     QM_WARNING("Deleting old <profile>/indexedDB directory!");
 
     rv = indexedDBDir->Remove(/* aRecursive */ true);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
 
-  nsCOMPtr<nsIFile> persistentStorageDir =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = persistentStorageDir->InitWithPath(mStoragePath);
+  nsCOMPtr<nsIFile> persistentStorageDir;
+  rv = NS_NewLocalFile(mStoragePath, false,
+                       getter_AddRefs(persistentStorageDir));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = persistentStorageDir->Append(NS_LITERAL_STRING(PERSISTENT_DIRECTORY_NAME));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
@@ -4663,23 +4618,19 @@ QuotaManager::UpgradeStorageFrom0_0To1_0
   }
 
   rv = MaybeRemoveOldDirectories();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   for (const PersistenceType persistenceType : kAllPersistenceTypes) {
-    nsCOMPtr<nsIFile> directory =
-      do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-
-    rv = directory->InitWithPath(GetStoragePath(persistenceType));
+    nsCOMPtr<nsIFile> directory;
+    rv = NS_NewLocalFile(GetStoragePath(persistenceType), false,
+                         getter_AddRefs(directory));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     bool persistent = persistenceType == PERSISTENCE_TYPE_PERSISTENT;
     RefPtr<UpgradeStorageFrom0_0To1_0Helper> helper =
       new UpgradeStorageFrom0_0To1_0Helper(directory, persistent);
 
@@ -4780,23 +4731,19 @@ QuotaManager::UpgradeStorageFrom1_0To2_0
   // File manager directories without the ".files" suffix can appear if user
   // runs an already upgraded profile in an older version of Firefox. File
   // manager directories without the ".files" suffix then prevent current
   // Firefox from initializing and using the storage.
 
   nsresult rv;
 
   for (const PersistenceType persistenceType : kAllPersistenceTypes) {
-    nsCOMPtr<nsIFile> directory =
-      do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-
-    rv = directory->InitWithPath(GetStoragePath(persistenceType));
+    nsCOMPtr<nsIFile> directory;
+    rv = NS_NewLocalFile(GetStoragePath(persistenceType), false,
+                         getter_AddRefs(directory));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     bool exists;
     rv = directory->Exists(&exists);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
@@ -4843,23 +4790,19 @@ QuotaManager::UpgradeStorageFrom2_0To2_1
   MOZ_ASSERT(aConnection);
 
   // The upgrade is mainly to create a directory padding file in DOM Cache
   // directory to record the overall padding size of an origin.
 
   nsresult rv;
 
   for (const PersistenceType persistenceType : kAllPersistenceTypes) {
-    nsCOMPtr<nsIFile> directory =
-      do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-
-    rv = directory->InitWithPath(GetStoragePath(persistenceType));
+    nsCOMPtr<nsIFile> directory;
+    rv = NS_NewLocalFile(GetStoragePath(persistenceType), false,
+                         getter_AddRefs(directory));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     bool exists;
     rv = directory->Exists(&exists);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
@@ -4914,25 +4857,19 @@ nsresult
 QuotaManager::EnsureStorageIsInitialized()
 {
   AssertIsOnIOThread();
 
   if (mStorageInitialized) {
     return NS_OK;
   }
 
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> storageFile =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = storageFile->InitWithPath(mBasePath);
+
+  nsCOMPtr<nsIFile> storageFile;
+  nsresult rv = NS_NewLocalFile(mBasePath, false, getter_AddRefs(storageFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = storageFile->Append(NS_LITERAL_STRING(STORAGE_FILE_NAME));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
@@ -4988,41 +4925,32 @@ QuotaManager::EnsureStorageIsInitialized
   if (GetMajorStorageVersion(storageVersion) > kMajorStorageVersion) {
     NS_WARNING("Unable to initialize storage, version is too high!");
     return NS_ERROR_FAILURE;
   }
 
   if (storageVersion < kStorageVersion) {
     const bool newDatabase = !storageVersion;
 
-    nsCOMPtr<nsIFile> storageDir =
-      do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-
-    rv = storageDir->InitWithPath(mStoragePath);
+    nsCOMPtr<nsIFile> storageDir;
+    rv = NS_NewLocalFile(mStoragePath, false, getter_AddRefs(storageDir));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     bool exists;
     rv = storageDir->Exists(&exists);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     if (!exists) {
-      nsCOMPtr<nsIFile> indexedDBDir =
-        do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return rv;
-      }
-
-      rv = indexedDBDir->InitWithPath(mIndexedDBPath);
+      nsCOMPtr<nsIFile> indexedDBDir;
+      rv = NS_NewLocalFile(mIndexedDBPath, false,
+                           getter_AddRefs(indexedDBDir));
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
 
       rv = indexedDBDir->Exists(&exists);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
@@ -5236,16 +5164,20 @@ QuotaManager::EnsureOriginIsInitializedI
       *aCreated = false;
       return NS_OK;
     }
   } else {
     rv = EnsureTemporaryStorageIsInitialized();
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
+
+    mTemporaryStorageInitialized = true;
+
+    CheckTemporaryStorageLimits();
   }
 
   bool created;
   rv = EnsureOriginDirectory(directory, &created);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -6940,25 +6872,20 @@ GetUsageOp::GetUsageOp(const UsageReques
 
 nsresult
 GetUsageOp::TraverseRepository(QuotaManager* aQuotaManager,
                                PersistenceType aPersistenceType)
 {
   AssertIsOnIOThread();
   MOZ_ASSERT(aQuotaManager);
 
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> directory =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  rv = directory->InitWithPath(aQuotaManager->GetStoragePath(aPersistenceType));
+
+  nsCOMPtr<nsIFile> directory;
+  nsresult rv = NS_NewLocalFile(aQuotaManager->GetStoragePath(aPersistenceType),
+                                false, getter_AddRefs(directory));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   bool exists;
   rv = directory->Exists(&exists);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -7382,44 +7309,35 @@ InitOriginOp::GetResponse(RequestRespons
 }
 
 void
 ResetOrClearOp::DeleteFiles(QuotaManager* aQuotaManager)
 {
   AssertIsOnIOThread();
   MOZ_ASSERT(aQuotaManager);
 
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> directory =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return;
-  }
-
-  rv = directory->InitWithPath(aQuotaManager->GetStoragePath());
+
+  nsCOMPtr<nsIFile> directory;
+  nsresult rv = NS_NewLocalFile(aQuotaManager->GetStoragePath(), false,
+                                getter_AddRefs(directory));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   rv = directory->Remove(true);
   if (rv != NS_ERROR_FILE_TARGET_DOES_NOT_EXIST &&
       rv != NS_ERROR_FILE_NOT_FOUND && NS_FAILED(rv)) {
     // This should never fail if we've closed all storage connections
     // correctly...
     MOZ_ASSERT(false, "Failed to remove storage directory!");
   }
 
-  nsCOMPtr<nsIFile> storageFile =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return;
-  }
-
-  rv = storageFile->InitWithPath(aQuotaManager->GetBasePath());
+  nsCOMPtr<nsIFile> storageFile;
+  rv = NS_NewLocalFile(aQuotaManager->GetBasePath(), false,
+                       getter_AddRefs(storageFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   rv = storageFile->Append(NS_LITERAL_STRING(STORAGE_FILE_NAME));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
@@ -7464,25 +7382,20 @@ ResetOrClearOp::GetResponse(RequestRespo
 
 void
 ClearRequestBase::DeleteFiles(QuotaManager* aQuotaManager,
                               PersistenceType aPersistenceType)
 {
   AssertIsOnIOThread();
   MOZ_ASSERT(aQuotaManager);
 
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> directory =
-    do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return;
-  }
-
-  rv = directory->InitWithPath(aQuotaManager->GetStoragePath(aPersistenceType));
+
+  nsCOMPtr<nsIFile> directory;
+  nsresult rv = NS_NewLocalFile(aQuotaManager->GetStoragePath(aPersistenceType),
+                                false, getter_AddRefs(directory));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   nsCOMPtr<nsISimpleEnumerator> entries;
   if (NS_WARN_IF(NS_FAILED(
         directory->GetDirectoryEntries(getter_AddRefs(entries)))) || !entries) {
     return;
@@ -8876,29 +8789,24 @@ CreateOrUpgradeDirectoryMetadataHelper::
                                  aOriginProps.mOrigin);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     // Move internal origins to new persistent storage.
     if (QuotaManager::IsOriginInternal(aOriginProps.mSpec)) {
       if (!mPermanentStorageDir) {
-        mPermanentStorageDir =
-          do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-        if (NS_WARN_IF(NS_FAILED(rv))) {
-          return rv;
-        }
-
         QuotaManager* quotaManager = QuotaManager::Get();
         MOZ_ASSERT(quotaManager);
 
         const nsString& permanentStoragePath =
           quotaManager->GetStoragePath(PERSISTENCE_TYPE_PERSISTENT);
 
-        rv = mPermanentStorageDir->InitWithPath(permanentStoragePath);
+        rv = NS_NewLocalFile(permanentStoragePath, false,
+                             getter_AddRefs(mPermanentStorageDir));
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return rv;
         }
       }
 
       nsString leafName;
       rv = aOriginProps.mDirectory->GetLeafName(leafName);
       if (NS_WARN_IF(NS_FAILED(rv))) {
--- a/dom/tests/mochitest/pointerlock/file_pointerlock-api.html
+++ b/dom/tests/mochitest/pointerlock/file_pointerlock-api.html
@@ -70,17 +70,21 @@
           window.addEventListener("contextmenu",
                                   function() { gotContextMenuEvent = true; },
                                   true);
           synthesizeMouse(document.body, 4, 4,
                           { type: "contextmenu", button: 2 },
                           window);
 
           document.addEventListener("mousemove", mouseMoveHandler);
-          synthesizeMouseAtCenter(div, {type: "mousemove"}, window);
+          requestAnimationFrame(() => {
+            setTimeout(() => {
+              synthesizeMouseAtCenter(div, {type: "mousemove"}, window);
+            }, 0);
+          });
         } else {
           info("Got pointerlockchange for exiting");
           pointerUnlocked = true;
           addFullscreenChangeContinuation("exit", function() {
             info("Got fullscreenchange for exiting");
             runTests();
             SimpleTest.finish();
           });
--- a/dom/workers/ServiceWorkerPrivate.cpp
+++ b/dom/workers/ServiceWorkerPrivate.cpp
@@ -41,18 +41,18 @@ BEGIN_WORKERS_NAMESPACE
 
 NS_IMPL_CYCLE_COLLECTING_NATIVE_ADDREF(ServiceWorkerPrivate)
 NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE(ServiceWorkerPrivate)
 NS_IMPL_CYCLE_COLLECTION(ServiceWorkerPrivate, mSupportsArray)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(ServiceWorkerPrivate, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(ServiceWorkerPrivate, Release)
 
-// Tracks the "dom.disable_open_click_delay" preference.  Modified on main
-// thread, read on worker threads.
+// Tracks the "dom.serviceWorkers.disable_open_click_delay" preference.  Modified
+// on main thread, read on worker threads.
 // It is updated every time a "notificationclick" event is dispatched. While
 // this is done without synchronization, at the worst, the thread will just get
 // an older value within which a popup is allowed to be displayed, which will
 // still be a valid value since it was set prior to dispatching the runnable.
 Atomic<uint32_t> gDOMDisableOpenClickDelay(0);
 
 // Used to keep track of pending waitUntil as well as in-flight extendable events.
 // When the last token is released, we attempt to terminate the worker.
@@ -1277,17 +1277,18 @@ ServiceWorkerPrivate::SendNotificationEv
                                             const nsAString& aIcon,
                                             const nsAString& aData,
                                             const nsAString& aBehavior,
                                             const nsAString& aScope)
 {
   WakeUpReason why;
   if (aEventName.EqualsLiteral(NOTIFICATION_CLICK_EVENT_NAME)) {
     why = NotificationClickEvent;
-    gDOMDisableOpenClickDelay = Preferences::GetInt("dom.disable_open_click_delay");
+    gDOMDisableOpenClickDelay =
+      Preferences::GetInt("dom.serviceWorkers.disable_open_click_delay");
   } else if (aEventName.EqualsLiteral(NOTIFICATION_CLOSE_EVENT_NAME)) {
     why = NotificationCloseEvent;
   } else {
     MOZ_ASSERT_UNREACHABLE("Invalid notification event name");
     return NS_ERROR_FAILURE;
   }
 
   nsresult rv = SpawnWorkerIfNeeded(why, nullptr);
--- a/dom/workers/test/serviceworkers/browser_userContextId_openWindow.js
+++ b/dom/workers/test/serviceworkers/browser_userContextId_openWindow.js
@@ -49,17 +49,17 @@ add_task(async function setup() {
   await SpecialPowers.pushPrefEnv({"set": [
     ["privacy.userContext.enabled", true],
     ["dom.serviceWorkers.exemptFromPerDomainMax", true],
     ["dom.serviceWorkers.enabled", true],
     ["dom.serviceWorkers.testing.enabled", true],
     ["dom.webnotifications.workers.enabled", true],
     ["dom.webnotifications.serviceworker.enabled", true],
     ["notification.prompt.testing", true],
-    ["dom.disable_open_click_delay", 1000],
+    ["dom.serviceWorkers.disable_open_click_delay", 1000],
     ["dom.serviceWorkers.idle_timeout", 299999],
     ["dom.serviceWorkers.idle_extended_timeout", 299999],
     ["browser.link.open_newwindow", 3],
   ]});
 });
 
 add_task(async function test() {
   Cm.QueryInterface(Ci.nsIComponentRegistrar).
--- a/dom/workers/test/serviceworkers/test_notificationclick_focus.html
+++ b/dom/workers/test/serviceworkers/test_notificationclick_focus.html
@@ -54,13 +54,13 @@ https://bugzilla.mozilla.org/show_bug.cg
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({"set": [
     ["dom.serviceWorkers.exemptFromPerDomainMax", true],
     ["dom.serviceWorkers.enabled", true],
     ["dom.serviceWorkers.testing.enabled", true],
     ["dom.webnotifications.workers.enabled", true],
     ["dom.webnotifications.serviceworker.enabled", true],
     ["notification.prompt.testing", true],
-    ["dom.disable_open_click_delay", 1000],
+    ["dom.serviceWorkers.disable_open_click_delay", 1000],
   ]}, runTest);
 </script>
 </body>
 </html>
--- a/dom/workers/test/serviceworkers/test_openWindow.html
+++ b/dom/workers/test/serviceworkers/test_openWindow.html
@@ -95,15 +95,15 @@ https://bugzilla.mozilla.org/show_bug.cg
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({"set": [
     ["dom.serviceWorkers.exemptFromPerDomainMax", true],
     ["dom.serviceWorkers.enabled", true],
     ["dom.serviceWorkers.testing.enabled", true],
     ["dom.webnotifications.workers.enabled", true],
     ["dom.webnotifications.serviceworker.enabled", true],
     ["notification.prompt.testing", true],
-    ["dom.disable_open_click_delay", 1000],
+    ["dom.serviceWorkers.disable_open_click_delay", 1000],
     ["dom.serviceWorkers.idle_timeout", 299999],
     ["dom.serviceWorkers.idle_extended_timeout", 299999]
   ]}, runTest);
 </script>
 </body>
 </html>
--- a/gfx/ipc/GPUProcessHost.cpp
+++ b/gfx/ipc/GPUProcessHost.cpp
@@ -185,35 +185,28 @@ GPUProcessHost::Shutdown()
   }
 
   DestroyProcess();
 }
 
 void
 GPUProcessHost::OnChannelClosed()
 {
-  if (!mShutdownRequested) {
+  mChannelClosed = true;
+
+  if (!mShutdownRequested && mListener) {
     // This is an unclean shutdown. Notify our listener that we're going away.
-    mChannelClosed = true;
-    if (mListener) {
-      mListener->OnProcessUnexpectedShutdown(this);
-    }
+    mListener->OnProcessUnexpectedShutdown(this);
+  } else {
+    DestroyProcess();
   }
 
   // Release the actor.
   GPUChild::Destroy(Move(mGPUChild));
   MOZ_ASSERT(!mGPUChild);
-
-  // If the owner of GPUProcessHost already requested shutdown, we can now
-  // schedule destruction. Otherwise we must wait for someone to call
-  // Shutdown. Note that GPUProcessManager calls Shutdown within
-  // OnProcessUnexpectedShutdown.
-  if (mShutdownRequested) {
-    DestroyProcess();
-  }
 }
 
 void
 GPUProcessHost::KillHard(const char* aReason)
 {
   ProcessHandle handle = GetChildProcessHandle();
   if (!base::KillProcess(handle, base::PROCESS_END_KILLED_BY_USER, false)) {
     NS_WARNING("failed to kill subprocess!");
--- a/gfx/ipc/VsyncBridgeParent.cpp
+++ b/gfx/ipc/VsyncBridgeParent.cpp
@@ -23,17 +23,17 @@ VsyncBridgeParent::Start(Endpoint<PVsync
 
   return parent;
 }
 
 VsyncBridgeParent::VsyncBridgeParent()
  : mOpen(false)
 {
   MOZ_COUNT_CTOR(VsyncBridgeParent);
-  mCompositorThreadRef = CompositorThreadHolder::GetSingleton();
+  mCompositorThreadRef = new CompositorThreadHolderDebug("VsyncBridge");
 }
 
 VsyncBridgeParent::~VsyncBridgeParent()
 {
   MOZ_COUNT_DTOR(VsyncBridgeParent);
 }
 
 void
--- a/gfx/ipc/VsyncBridgeParent.h
+++ b/gfx/ipc/VsyncBridgeParent.h
@@ -33,15 +33,15 @@ private:
   VsyncBridgeParent();
   ~VsyncBridgeParent();
 
   void Open(Endpoint<PVsyncBridgeParent>&& aEndpoint);
   void ShutdownImpl();
 
 private:
   bool mOpen;
-  RefPtr<layers::CompositorThreadHolder> mCompositorThreadRef;
+  RefPtr<layers::CompositorThreadHolderDebug> mCompositorThreadRef;
 };
 
 } // namespace gfx
 } // namespace mozilla
 
 #endif // include_gfx_ipc_VsyncBridgeParent_h
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -521,41 +521,46 @@ CompositorBridgeChild::RecvHideAllPlugin
     return IPC_OK();
   }
   SendRemotePluginsReady();
   return IPC_OK();
 #endif // !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
 }
 
 mozilla::ipc::IPCResult
-CompositorBridgeChild::RecvDidComposite(const uint64_t& aId, const uint64_t& aTransactionId,
+CompositorBridgeChild::RecvDidComposite(const uint64_t& aId,
+                                        const uint64_t& aTransactionId,
                                         const TimeStamp& aCompositeStart,
                                         const TimeStamp& aCompositeEnd)
 {
+  // Hold a reference to keep texture pools alive.  See bug 1387799
+  AutoTArray<RefPtr<TextureClientPool>,2> texturePools = mTexturePools;
+
   if (mLayerManager) {
     MOZ_ASSERT(aId == 0);
     MOZ_ASSERT(mLayerManager->GetBackendType() == LayersBackend::LAYERS_CLIENT ||
                mLayerManager->GetBackendType() == LayersBackend::LAYERS_WR);
     // Hold a reference to keep LayerManager alive. See Bug 1242668.
     RefPtr<LayerManager> m = mLayerManager;
     m->DidComposite(aTransactionId, aCompositeStart, aCompositeEnd);
   } else if (aId != 0) {
     RefPtr<dom::TabChild> child = dom::TabChild::GetFrom(aId);
     if (child) {
       child->DidComposite(aTransactionId, aCompositeStart, aCompositeEnd);
     }
   }
 
-  for (size_t i = 0; i < mTexturePools.Length(); i++) {
-    mTexturePools[i]->ReturnDeferredClients();
+  for (size_t i = 0; i < texturePools.Length(); i++) {
+    texturePools[i]->ReturnDeferredClients();
   }
 
   return IPC_OK();
 }
 
+
 void
 CompositorBridgeChild::ActorDestroy(ActorDestroyReason aWhy)
 {
   if (aWhy == AbnormalShutdown) {
     // If the parent side runs into a problem then the actor will be destroyed.
     // There is nothing we can do in the child side, here sets mCanSend as false.
     gfxCriticalNote << "Receive IPC close with reason=AbnormalShutdown";
   }
--- a/gfx/layers/ipc/CompositorManagerParent.cpp
+++ b/gfx/layers/ipc/CompositorManagerParent.cpp
@@ -36,30 +36,34 @@ CompositorManagerParent::CreateSameProce
     MOZ_ASSERT_UNREACHABLE("Already initialized");
     return nullptr;
   }
 
   // The child is responsible for setting up the IPC channel in the same
   // process case because if we open from the child perspective, we can do it
   // on the main thread and complete before we return the manager handles.
   RefPtr<CompositorManagerParent> parent = new CompositorManagerParent();
+  parent->mCompositorThreadHolder =
+    new CompositorThreadHolderDebug("CompositorManagerSame");
   parent->SetOtherProcessId(base::GetCurrentProcId());
   return parent.forget();
 }
 
 /* static */ void
 CompositorManagerParent::Create(Endpoint<PCompositorManagerParent>&& aEndpoint)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // We are creating a manager for the another process, inside the GPU process
   // (or UI process if it subsumbed the GPU process).
   MOZ_ASSERT(aEndpoint.OtherPid() != base::GetCurrentProcId());
 
   RefPtr<CompositorManagerParent> bridge = new CompositorManagerParent();
+  bridge->mCompositorThreadHolder =
+    new CompositorThreadHolderDebug("CompositorManagerContent");
 
   RefPtr<Runnable> runnable = NewRunnableMethod<Endpoint<PCompositorManagerParent>&&>(
     "CompositorManagerParent::Bind",
     bridge,
     &CompositorManagerParent::Bind,
     Move(aEndpoint));
   CompositorThreadHolder::Loop()->PostTask(runnable.forget());
 }
@@ -100,17 +104,16 @@ CompositorManagerParent::CreateSameProce
     new CompositorBridgeParent(sInstance, aScale, vsyncRate, aOptions,
                                aUseExternalSurfaceSize, aSurfaceSize);
 
   sInstance->mPendingCompositorBridges.AppendElement(bridge);
   return bridge.forget();
 }
 
 CompositorManagerParent::CompositorManagerParent()
-  : mCompositorThreadHolder(CompositorThreadHolder::GetSingleton())
 {
 }
 
 CompositorManagerParent::~CompositorManagerParent()
 {
 }
 
 void
--- a/gfx/layers/ipc/CompositorManagerParent.h
+++ b/gfx/layers/ipc/CompositorManagerParent.h
@@ -13,17 +13,17 @@
 #include "mozilla/RefPtr.h"             // for already_AddRefed
 #include "mozilla/layers/PCompositorManagerParent.h"
 #include "nsTArray.h"                   // for AutoTArray
 
 namespace mozilla {
 namespace layers {
 
 class CompositorBridgeParent;
-class CompositorThreadHolder;
+class CompositorThreadHolderDebug;
 
 #ifndef DEBUG
 #define COMPOSITOR_MANAGER_PARENT_EXPLICIT_SHUTDOWN
 #endif
 
 class CompositorManagerParent final : public PCompositorManagerParent
 {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorManagerParent)
@@ -58,17 +58,17 @@ private:
   ~CompositorManagerParent() override;
 
   void Bind(Endpoint<PCompositorManagerParent>&& aEndpoint);
 
   void DeallocPCompositorManagerParent() override;
 
   void DeferredDestroy();
 
-  RefPtr<CompositorThreadHolder> mCompositorThreadHolder;
+  RefPtr<CompositorThreadHolderDebug> mCompositorThreadHolder;
 
   AutoTArray<RefPtr<CompositorBridgeParent>, 1> mPendingCompositorBridges;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif
--- a/gfx/layers/ipc/CompositorThread.cpp
+++ b/gfx/layers/ipc/CompositorThread.cpp
@@ -4,26 +4,56 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "CompositorThread.h"
 #include "MainThreadUtils.h"
 #include "nsThreadUtils.h"
 #include "CompositorBridgeParent.h"
 #include "mozilla/layers/ImageBridgeParent.h"
 #include "mozilla/media/MediaSystemResourceService.h"
+#ifdef MOZ_CRASHREPORTER
+#include "nsExceptionHandler.h"     // for CrashReporter
+#endif
 
 namespace mozilla {
 
 namespace gfx {
 // See VRManagerChild.cpp
 void ReleaseVRManagerParentSingleton();
 } // namespace gfx
 
 namespace layers {
 
+#ifdef MOZ_CRASHREPORTER
+static Atomic<int32_t> sHoldersNextId(0);
+#endif
+
+CompositorThreadHolderDebug::CompositorThreadHolderDebug(const char* aName)
+  : mHolder(CompositorThreadHolder::GetSingleton())
+{
+#ifdef MOZ_CRASHREPORTER
+  if (XRE_IsParentProcess()) {
+    mId.AppendLiteral("gfxCTH:");
+    mId.Append(aName);
+    mId.AppendLiteral(":");
+    mId.AppendInt(++sHoldersNextId);
+    CrashReporter::AnnotateCrashReport(mId, NS_LITERAL_CSTRING("1"));
+  }
+#endif
+}
+
+CompositorThreadHolderDebug::~CompositorThreadHolderDebug()
+{
+#ifdef MOZ_CRASHREPORTER
+  if (XRE_IsParentProcess()) {
+    CrashReporter::AnnotateCrashReport(mId, NS_LITERAL_CSTRING("0"));
+  }
+#endif
+}
+
 static StaticRefPtr<CompositorThreadHolder> sCompositorThreadHolder;
 static bool sFinishedCompositorShutDown = false;
 
 CompositorThreadHolder* GetCompositorThreadHolder()
 {
   return sCompositorThreadHolder;
 }
 
--- a/gfx/layers/ipc/CompositorThread.h
+++ b/gfx/layers/ipc/CompositorThread.h
@@ -55,14 +55,30 @@ private:
   base::Thread* const mCompositorThread;
 
   static base::Thread* CreateCompositorThread();
   static void DestroyCompositorThread(base::Thread* aCompositorThread);
 
   friend class CompositorBridgeParent;
 };
 
+class CompositorThreadHolderDebug final
+{
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorThreadHolderDebug)
+
+public:
+  explicit CompositorThreadHolderDebug(const char* aName);
+
+private:
+  ~CompositorThreadHolderDebug();
+
+  RefPtr<CompositorThreadHolder> mHolder;
+#ifdef MOZ_CRASHREPORTER
+  nsAutoCString mId;
+#endif
+};
+
 base::Thread* CompositorThread();
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // mozilla_layers_CompositorThread_h
--- a/gfx/layers/ipc/ImageBridgeParent.cpp
+++ b/gfx/layers/ipc/ImageBridgeParent.cpp
@@ -61,20 +61,23 @@ ImageBridgeParent::Setup()
   }
 }
 
 ImageBridgeParent::ImageBridgeParent(MessageLoop* aLoop,
                                      ProcessId aChildProcessId)
   : mMessageLoop(aLoop)
   , mSetChildThreadPriority(false)
   , mClosed(false)
-  , mCompositorThreadHolder(CompositorThreadHolder::GetSingleton())
 {
   MOZ_ASSERT(NS_IsMainThread());
 
+  mCompositorThreadHolder =
+    new CompositorThreadHolderDebug(IsSameProcess() ? "ImageBridgeSame"
+                                                    : "ImageBridge");
+
   // creates the map only if it has not been created already, so it is safe
   // with several bridges
   {
     MonitorAutoLock lock(*sImageBridgesLock);
     sImageBridges[aChildProcessId] = this;
   }
   SetOtherProcessId(aChildProcessId);
 }
--- a/gfx/layers/ipc/ImageBridgeParent.h
+++ b/gfx/layers/ipc/ImageBridgeParent.h
@@ -137,15 +137,15 @@ private:
   bool mSetChildThreadPriority;
   bool mClosed;
 
   /**
    * Map of all living ImageBridgeParent instances
    */
   static std::map<base::ProcessId, ImageBridgeParent*> sImageBridges;
 
-  RefPtr<CompositorThreadHolder> mCompositorThreadHolder;
+  RefPtr<CompositorThreadHolderDebug> mCompositorThreadHolder;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // gfx_layers_ipc_ImageBridgeParent_h_
--- a/gfx/layers/ipc/VideoBridgeParent.cpp
+++ b/gfx/layers/ipc/VideoBridgeParent.cpp
@@ -16,17 +16,17 @@ using namespace mozilla::gfx;
 
 static VideoBridgeParent* sVideoBridgeSingleton;
 
 VideoBridgeParent::VideoBridgeParent()
   : mClosed(false)
 {
   mSelfRef = this;
   sVideoBridgeSingleton = this;
-  mCompositorThreadRef = CompositorThreadHolder::GetSingleton();
+  mCompositorThreadRef = new CompositorThreadHolderDebug("VideoBridge");
 }
 
 VideoBridgeParent::~VideoBridgeParent()
 {
   sVideoBridgeSingleton = nullptr;
 }
 
 /* static */ VideoBridgeParent*
--- a/gfx/layers/ipc/VideoBridgeParent.h
+++ b/gfx/layers/ipc/VideoBridgeParent.h
@@ -7,17 +7,17 @@
 #define gfx_layers_ipc_VideoBridgeParent_h_
 
 #include "mozilla/layers/PVideoBridgeParent.h"
 #include "mozilla/layers/ISurfaceAllocator.h"
 
 namespace mozilla {
 namespace layers {
 
-class CompositorThreadHolder;
+class CompositorThreadHolderDebug;
 
 class VideoBridgeParent final : public PVideoBridgeParent,
                                 public HostIPCAllocator,
                                 public ShmemAllocator
 {
 public:
   VideoBridgeParent();
   ~VideoBridgeParent();
@@ -58,17 +58,17 @@ public:
   void DeallocShmem(ipc::Shmem& aShmem) override;
 
 private:
   void DeallocPVideoBridgeParent() override;
 
   // This keeps us alive until ActorDestroy(), at which point we do a
   // deferred destruction of ourselves.
   RefPtr<VideoBridgeParent> mSelfRef;
-  RefPtr<CompositorThreadHolder> mCompositorThreadRef;
+  RefPtr<CompositorThreadHolderDebug> mCompositorThreadRef;
 
   std::map<uint64_t, PTextureParent*> mTextureMap;
 
   bool mClosed;
 };
 
 } // namespace layers
 } // namespace mozilla
--- a/js/src/jit-test/tests/SIMD/bool32x4-const.js
+++ b/js/src/jit-test/tests/SIMD/bool32x4-const.js
@@ -7,34 +7,34 @@ setJitCompilerOption("ion.warmup.trigger
 function f1() {
     var B = SIMD.Bool32x4;
     var S = SIMD.Bool32x4.splat;
     return [
         B(false, false, false, true),
         B(true),
         B(undefined, null, "", "x"),
         B({}, 0, 1, -0.0),
-        B(NaN, -NaN, Symbol(), objectEmulatingUndefined()),
+        B(NaN, -NaN, Symbol(), createIsHTMLDDA()),
 
         S(false),
         S(true),
         S(undefined),
         S(null),
 
         S(""),
         S("x"),
         S(0),
         S(1),
 
         S({}),
         S(-0.0),
         S(NaN),
         S(Symbol()),
 
-        S(objectEmulatingUndefined())
+        S(createIsHTMLDDA())
     ];
 }
 
 function f() {
     for (var i = 0; i < 100; i++) {
         var a = f1()
         assertEqX4(a[0], [false, false, false, true]);
         assertEqX4(a[1], [true,  false, false, false]);
--- a/js/src/jit-test/tests/baseline/bug1349298.js
+++ b/js/src/jit-test/tests/baseline/bug1349298.js
@@ -1,2 +1,2 @@
 for (var i=0; i<40; i++)
-    assertEq(typeof objectEmulatingUndefined(), "undefined");
+    assertEq(typeof createIsHTMLDDA(), "undefined");
--- a/js/src/jit-test/tests/basic/bug1206265.js
+++ b/js/src/jit-test/tests/basic/bug1206265.js
@@ -1,8 +1,8 @@
 x = [
-    objectEmulatingUndefined(),
+    createIsHTMLDDA(),
     function() {}
 ];
 x.forEach(function() {});
 this.x.sort(function() {});
 assertEq(x[0] instanceof Function, false);
 assertEq(x[1] instanceof Function, true);
--- a/js/src/jit-test/tests/basic/emulates-undefined.js
+++ b/js/src/jit-test/tests/basic/emulates-undefined.js
@@ -1,10 +1,10 @@
 function test() {
-    var values = [undefined, null, Math, objectEmulatingUndefined()];
+    var values = [undefined, null, Math, createIsHTMLDDA()];
     var expected = [true, true, false, true];
 
     for (var i=0; i<100; i++) {
         var idx = i % values.length;
         if (values[idx] == undefined)
             assertEq(expected[idx], true);
         else
             assertEq(expected[idx], false);
--- a/js/src/jit-test/tests/cacheir/typeof-proxy.js
+++ b/js/src/jit-test/tests/cacheir/typeof-proxy.js
@@ -1,12 +1,12 @@
 function test() {
-    var funs = [function() {}, new Proxy(function() {}, {}), wrapWithProto(function() {}, null)];
-    var objects = [{}, new Proxy({}, {}), wrapWithProto({}, null), new Proxy(objectEmulatingUndefined(), {})];
-    var undefs = [objectEmulatingUndefined(), wrapWithProto(objectEmulatingUndefined(), null)];
+    var funs = [function() {}, new Proxy(function() {}, {}), wrapWithProto(function() {}, null), new Proxy(createIsHTMLDDA(), {})];
+    var objects = [{}, new Proxy({}, {}), wrapWithProto({}, null)];
+    var undefs = [createIsHTMLDDA(), wrapWithProto(createIsHTMLDDA(), null)];
 
     for (var fun of funs) {
         assertEq(typeof fun, "function")
     }
 
     for (var obj of objects) {
         assertEq(typeof obj, "object");
     }
--- a/js/src/jit-test/tests/ion/bug1105684.js
+++ b/js/src/jit-test/tests/ion/bug1105684.js
@@ -1,6 +1,6 @@
 function f(x) {
         Math.exp(x ? 0 : 1)
 }
-f(objectEmulatingUndefined())
-f(objectEmulatingUndefined())
+f(createIsHTMLDDA())
+f(createIsHTMLDDA())
 
--- a/js/src/jit-test/tests/ion/bug1204675.js
+++ b/js/src/jit-test/tests/ion/bug1204675.js
@@ -4,10 +4,10 @@ function f(m, x) {
                         }
 }
 function g() {
         return false;
 }
 function h(y) {
         return (y === 0);
 }
-f(g, [objectEmulatingUndefined()]);
+f(g, [createIsHTMLDDA()]);
 f(h, [false]);
--- a/js/src/jit-test/tests/ion/dce-with-rinstructions.js
+++ b/js/src/jit-test/tests/ion/dce-with-rinstructions.js
@@ -394,20 +394,20 @@ function rnot_number(i) {
     if (uceFault_not_number(i) || uceFault_not_number(i))
         assertEq(x, false /* = !99 */);
     assertRecoveredOnBailout(x, true);
     return i;
 }
 
 var uceFault_not_object = eval(uneval(uceFault).replace('uceFault', 'uceFault_not_object'));
 function rnot_object(i) {
-    var o = objectEmulatingUndefined();
+    var o = createIsHTMLDDA();
     var x = !o;
     if(uceFault_not_object(i) || uceFault_not_object(i))
-        assertEq(x, true /* = !undefined = !document.all = !objectEmulatingUndefined() */);
+        assertEq(x, true /* = !undefined = !document.all = !createIsHTMLDDA() */);
     assertRecoveredOnBailout(x, true);
     return i;
 }
 
 var uceFault_concat_string = eval(uneval(uceFault).replace('uceFault', 'uceFault_concat_string'));
 function rconcat_string(i) {
     var x = "s" + i.toString();
     if (uceFault_concat_string(i) || uceFault_concat_string(i))
--- a/js/src/jit-test/tests/ion/notV.js
+++ b/js/src/jit-test/tests/ion/notV.js
@@ -23,10 +23,10 @@ assertEq(foo(''), true);
 assertEq(foo('x'), false);
 assertEq(foo('x'), false);
 assertEq(foo(true), false);
 assertEq(foo(true), false);
 assertEq(foo(false), true);
 assertEq(foo(false), true);
 assertEq(foo(-0.0), true);
 assertEq(foo(-0.0), true);
-assertEq(foo(objectEmulatingUndefined()), true);
-assertEq(foo(objectEmulatingUndefined()), true);
+assertEq(foo(createIsHTMLDDA()), true);
+assertEq(foo(createIsHTMLDDA()), true);
--- a/js/src/jit-test/tests/truthiness/equal-null.js
+++ b/js/src/jit-test/tests/truthiness/equal-null.js
@@ -6,18 +6,18 @@ function f(v, value)
 }
 
 f({}, false);
 f({}, false);
 f(null, true);
 f(null, true);
 f(undefined, true);
 f(undefined, true);
-f(objectEmulatingUndefined(), true);
-f(objectEmulatingUndefined(), true);
+f(createIsHTMLDDA(), true);
+f(createIsHTMLDDA(), true);
 f(Object.prototype, false);
 f(Object.prototype, false);
 
 function g(v, value)
 {
   var b = v == null;
   assertEq(b, value,
            "failed: " + v + " " + value);
@@ -28,10 +28,10 @@ g({}, false);
 
 function h(v, value)
 {
   var b = v == null;
   assertEq(b, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), true);
-h(objectEmulatingUndefined(), true);
+h(createIsHTMLDDA(), true);
+h(createIsHTMLDDA(), true);
--- a/js/src/jit-test/tests/truthiness/equal-undefined.js
+++ b/js/src/jit-test/tests/truthiness/equal-undefined.js
@@ -6,18 +6,18 @@ function f(v, value)
 }
 
 f({}, false);
 f({}, false);
 f(null, true);
 f(null, true);
 f(undefined, true);
 f(undefined, true);
-f(objectEmulatingUndefined(), true);
-f(objectEmulatingUndefined(), true);
+f(createIsHTMLDDA(), true);
+f(createIsHTMLDDA(), true);
 f(Object.prototype, false);
 f(Object.prototype, false);
 
 function g(v, value)
 {
   var b = v == undefined;
   assertEq(b, value,
            "failed: " + v + " " + value);
@@ -28,10 +28,10 @@ g({}, false);
 
 function h(v, value)
 {
   var b = v == undefined;
   assertEq(b, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), true);
-h(objectEmulatingUndefined(), true);
+h(createIsHTMLDDA(), true);
+h(createIsHTMLDDA(), true);
--- a/js/src/jit-test/tests/truthiness/if-equal-null.js
+++ b/js/src/jit-test/tests/truthiness/if-equal-null.js
@@ -9,18 +9,18 @@ function f(v, value)
 }
 
 f({}, 0);
 f({}, 0);
 f(null, 1);
 f(null, 2);
 f(undefined, 3);
 f(undefined, 4);
-f(objectEmulatingUndefined(), 5);
-f(objectEmulatingUndefined(), 6);
+f(createIsHTMLDDA(), 5);
+f(createIsHTMLDDA(), 6);
 f(Object.prototype, 6);
 f(Object.prototype, 6);
 
 var counterG = 0;
 
 function g(v, value)
 {
   if (v == null)
@@ -37,10 +37,10 @@ var counterH = 0;
 function h(v, value)
 {
   if (v == null)
     counterH++;
   assertEq(counterH, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), 1);
-h(objectEmulatingUndefined(), 2);
+h(createIsHTMLDDA(), 1);
+h(createIsHTMLDDA(), 2);
--- a/js/src/jit-test/tests/truthiness/if-equal-undefined.js
+++ b/js/src/jit-test/tests/truthiness/if-equal-undefined.js
@@ -9,18 +9,18 @@ function f(v, value)
 }
 
 f({}, 0);
 f({}, 0);
 f(null, 1);
 f(null, 2);
 f(undefined, 3);
 f(undefined, 4);
-f(objectEmulatingUndefined(), 5);
-f(objectEmulatingUndefined(), 6);
+f(createIsHTMLDDA(), 5);
+f(createIsHTMLDDA(), 6);
 f(Object.prototype, 6);
 f(Object.prototype, 6);
 
 var counterG = 0;
 
 function g(v, value)
 {
   if (v == undefined)
@@ -37,10 +37,10 @@ var counterH = 0;
 function h(v, value)
 {
   if (v == undefined)
     counterH++;
   assertEq(counterH, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), 1);
-h(objectEmulatingUndefined(), 2);
+h(createIsHTMLDDA(), 1);
+h(createIsHTMLDDA(), 2);
--- a/js/src/jit-test/tests/truthiness/if-not-equal-null.js
+++ b/js/src/jit-test/tests/truthiness/if-not-equal-null.js
@@ -9,18 +9,18 @@ function f(v, value)
 }
 
 f({}, 1);
 f({}, 2);
 f(null, 2);
 f(null, 2);
 f(undefined, 2);
 f(undefined, 2);
-f(objectEmulatingUndefined(), 2);
-f(objectEmulatingUndefined(), 2);
+f(createIsHTMLDDA(), 2);
+f(createIsHTMLDDA(), 2);
 f(Object.prototype, 3);
 f(Object.prototype, 4);
 
 var counterG = 0;
 
 function g(v, value)
 {
   if (v != null)
@@ -37,10 +37,10 @@ var counterH = 0;
 function h(v, value)
 {
   if (v != null)
     counterH++;
   assertEq(counterH, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), 0);
-h(objectEmulatingUndefined(), 0);
+h(createIsHTMLDDA(), 0);
+h(createIsHTMLDDA(), 0);
--- a/js/src/jit-test/tests/truthiness/if-not-equal-undefined.js
+++ b/js/src/jit-test/tests/truthiness/if-not-equal-undefined.js
@@ -9,18 +9,18 @@ function f(v, value)
 }
 
 f({}, 1);
 f({}, 2);
 f(null, 2);
 f(null, 2);
 f(undefined, 2);
 f(undefined, 2);
-f(objectEmulatingUndefined(), 2);
-f(objectEmulatingUndefined(), 2);
+f(createIsHTMLDDA(), 2);
+f(createIsHTMLDDA(), 2);
 f(Object.prototype, 3);
 f(Object.prototype, 4);
 
 var counterG = 0;
 
 function g(v, value)
 {
   if (v != undefined)
@@ -37,10 +37,10 @@ var counterH = 0;
 function h(v, value)
 {
   if (v != undefined)
     counterH++;
   assertEq(counterH, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), 0);
-h(objectEmulatingUndefined(), 0);
+h(createIsHTMLDDA(), 0);
+h(createIsHTMLDDA(), 0);
--- a/js/src/jit-test/tests/truthiness/if-strict-equal-null.js
+++ b/js/src/jit-test/tests/truthiness/if-strict-equal-null.js
@@ -9,18 +9,18 @@ function f(v, value)
 }
 
 f({}, 0);
 f({}, 0);
 f(null, 1);
 f(null, 2);
 f(undefined, 2);
 f(undefined, 2);
-f(objectEmulatingUndefined(), 2);
-f(objectEmulatingUndefined(), 2);
+f(createIsHTMLDDA(), 2);
+f(createIsHTMLDDA(), 2);
 f(Object.prototype, 2);
 f(Object.prototype, 2);
 
 var counterG = 0;
 
 function g(v, value)
 {
   if (v === null)
@@ -37,10 +37,10 @@ var counterH = 0;
 function h(v, value)
 {
   if (v === null)
     counterH++;
   assertEq(counterH, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), 0);
-h(objectEmulatingUndefined(), 0);
+h(createIsHTMLDDA(), 0);
+h(createIsHTMLDDA(), 0);
--- a/js/src/jit-test/tests/truthiness/if-strict-equal-undefined.js
+++ b/js/src/jit-test/tests/truthiness/if-strict-equal-undefined.js
@@ -9,18 +9,18 @@ function f(v, value)
 }
 
 f({}, 0);
 f({}, 0);
 f(null, 0);
 f(null, 0);
 f(undefined, 1);
 f(undefined, 2);
-f(objectEmulatingUndefined(), 2);
-f(objectEmulatingUndefined(), 2);
+f(createIsHTMLDDA(), 2);
+f(createIsHTMLDDA(), 2);
 f(Object.prototype, 2);
 f(Object.prototype, 2);
 
 var counterG = 0;
 
 function g(v, value)
 {
   if (v === undefined)
@@ -37,10 +37,10 @@ var counterH = 0;
 function h(v, value)
 {
   if (v === undefined)
     counterH++;
   assertEq(counterH, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), 0);
-h(objectEmulatingUndefined(), 0);
+h(createIsHTMLDDA(), 0);
+h(createIsHTMLDDA(), 0);
--- a/js/src/jit-test/tests/truthiness/if-strict-not-equal-null.js
+++ b/js/src/jit-test/tests/truthiness/if-strict-not-equal-null.js
@@ -9,18 +9,18 @@ function f(v, value)
 }
 
 f({}, 1);
 f({}, 2);
 f(null, 2);
 f(null, 2);
 f(undefined, 3);
 f(undefined, 4);
-f(objectEmulatingUndefined(), 5);
-f(objectEmulatingUndefined(), 6);
+f(createIsHTMLDDA(), 5);
+f(createIsHTMLDDA(), 6);
 f(Object.prototype, 7);
 f(Object.prototype, 8);
 
 var counterG = 0;
 
 function g(v, value)
 {
   if (v !== null)
@@ -37,10 +37,10 @@ var counterH = 0;
 function h(v, value)
 {
   if (v !== null)
     counterH++;
   assertEq(counterH, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), 1);
-h(objectEmulatingUndefined(), 2);
+h(createIsHTMLDDA(), 1);
+h(createIsHTMLDDA(), 2);
--- a/js/src/jit-test/tests/truthiness/if-strict-not-equal-undefined.js
+++ b/js/src/jit-test/tests/truthiness/if-strict-not-equal-undefined.js
@@ -9,18 +9,18 @@ function f(v, value)
 }
 
 f({}, 1);
 f({}, 2);
 f(null, 3);
 f(null, 4);
 f(undefined, 4);
 f(undefined, 4);
-f(objectEmulatingUndefined(), 5);
-f(objectEmulatingUndefined(), 6);
+f(createIsHTMLDDA(), 5);
+f(createIsHTMLDDA(), 6);
 f(Object.prototype, 7);
 f(Object.prototype, 8);
 
 var counterG = 0;
 
 function g(v, value)
 {
   if (v !== undefined)
@@ -37,10 +37,10 @@ var counterH = 0;
 function h(v, value)
 {
   if (v !== undefined)
     counterH++;
   assertEq(counterH, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), 1);
-h(objectEmulatingUndefined(), 2);
+h(createIsHTMLDDA(), 1);
+h(createIsHTMLDDA(), 2);
--- a/js/src/jit-test/tests/truthiness/if.js
+++ b/js/src/jit-test/tests/truthiness/if.js
@@ -1,24 +1,24 @@
 function t1(v)
 {
   if (v)
     return 1;
   return 0;
 }
 
-assertEq(t1(objectEmulatingUndefined()), 0);
-assertEq(t1(objectEmulatingUndefined()), 0);
-assertEq(t1(objectEmulatingUndefined()), 0);
+assertEq(t1(createIsHTMLDDA()), 0);
+assertEq(t1(createIsHTMLDDA()), 0);
+assertEq(t1(createIsHTMLDDA()), 0);
 
 function t2(v)
 {
   if (v)
     return 1;
   return 0;
 }
 
 assertEq(t2(17), 1);
 assertEq(t2(0), 0);
 assertEq(t2(-0), 0);
-assertEq(t2(objectEmulatingUndefined()), 0);
-assertEq(t2(objectEmulatingUndefined()), 0);
-assertEq(t2(objectEmulatingUndefined()), 0);
+assertEq(t2(createIsHTMLDDA()), 0);
+assertEq(t2(createIsHTMLDDA()), 0);
+assertEq(t2(createIsHTMLDDA()), 0);
--- a/js/src/jit-test/tests/truthiness/not-equal-null.js
+++ b/js/src/jit-test/tests/truthiness/not-equal-null.js
@@ -6,18 +6,18 @@ function f(v, value)
 }
 
 f({}, true);
 f({}, true);
 f(null, false);
 f(null, false);
 f(undefined, false);
 f(undefined, false);
-f(objectEmulatingUndefined(), false);
-f(objectEmulatingUndefined(), false);
+f(createIsHTMLDDA(), false);
+f(createIsHTMLDDA(), false);
 f(Object.prototype, true);
 f(Object.prototype, true);
 
 function g(v, value)
 {
   var b = v != null;
   assertEq(b, value,
            "failed: " + v + " " + value);
@@ -28,10 +28,10 @@ g({}, true);
 
 function h(v, value)
 {
   var b = v != null;
   assertEq(b, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), false);
-h(objectEmulatingUndefined(), false);
+h(createIsHTMLDDA(), false);
+h(createIsHTMLDDA(), false);
--- a/js/src/jit-test/tests/truthiness/not-equal-undefined.js
+++ b/js/src/jit-test/tests/truthiness/not-equal-undefined.js
@@ -6,18 +6,18 @@ function f(v, value)
 }
 
 f({}, true);
 f({}, true);
 f(null, false);
 f(null, false);
 f(undefined, false);
 f(undefined, false);
-f(objectEmulatingUndefined(), false);
-f(objectEmulatingUndefined(), false);
+f(createIsHTMLDDA(), false);
+f(createIsHTMLDDA(), false);
 f(Object.prototype, true);
 f(Object.prototype, true);
 
 function g(v, value)
 {
   var b = v != undefined;
   assertEq(b, value,
            "failed: " + v + " " + value);
@@ -28,10 +28,10 @@ g({}, true);
 
 function h(v, value)
 {
   var b = v != undefined;
   assertEq(b, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), false);
-h(objectEmulatingUndefined(), false);
+h(createIsHTMLDDA(), false);
+h(createIsHTMLDDA(), false);
--- a/js/src/jit-test/tests/truthiness/not.js
+++ b/js/src/jit-test/tests/truthiness/not.js
@@ -1,24 +1,24 @@
 function t1(v)
 {
   if (!v)
     return 1;
   return 0;
 }
 
-assertEq(t1(objectEmulatingUndefined()), 1);
-assertEq(t1(objectEmulatingUndefined()), 1);
-assertEq(t1(objectEmulatingUndefined()), 1);
+assertEq(t1(createIsHTMLDDA()), 1);
+assertEq(t1(createIsHTMLDDA()), 1);
+assertEq(t1(createIsHTMLDDA()), 1);
 
 function t2(v)
 {
   if (!v)
     return 1;
   return 0;
 }
 
 assertEq(t2(17), 0);
 assertEq(t2(0), 1);
 assertEq(t2(-0), 1);
-assertEq(t2(objectEmulatingUndefined()), 1);
-assertEq(t2(objectEmulatingUndefined()), 1);
-assertEq(t2(objectEmulatingUndefined()), 1);
+assertEq(t2(createIsHTMLDDA()), 1);
+assertEq(t2(createIsHTMLDDA()), 1);
+assertEq(t2(createIsHTMLDDA()), 1);
--- a/js/src/jit-test/tests/truthiness/obj-obj-equal.js
+++ b/js/src/jit-test/tests/truthiness/obj-obj-equal.js
@@ -1,23 +1,23 @@
 function f(v1, v2, value)
 {
   var b = v1 == v2;
   assertEq(b, value,
            "failed: " + v1 + ", " + v2 + ": " + value);
 }
 
 var obj = {};
-var emul = objectEmulatingUndefined();
+var emul = createIsHTMLDDA();
 
 f(obj, obj, true);
 f(obj, obj, true);
 f(emul, obj, false);
 f(emul, obj, false);
 f(obj, emul, false);
 f(obj, emul, false);
 f(Object.prototype, obj, false);
 f(Object.prototype, obj, false);
 f(emul, emul, true);
-f(objectEmulatingUndefined(), emul, false);
-f(objectEmulatingUndefined(), emul, false);
-f(emul, objectEmulatingUndefined(), false);
-f(emul, objectEmulatingUndefined(), false);
+f(createIsHTMLDDA(), emul, false);
+f(createIsHTMLDDA(), emul, false);
+f(emul, createIsHTMLDDA(), false);
+f(emul, createIsHTMLDDA(), false);
--- a/js/src/jit-test/tests/truthiness/obj-obj-not-equal.js
+++ b/js/src/jit-test/tests/truthiness/obj-obj-not-equal.js
@@ -1,23 +1,23 @@
 function f(v1, v2, value)
 {
   var b = v1 != v2;
   assertEq(b, value,
            "failed: " + v1 + ", " + v2 + ": " + value);
 }
 
 var obj = {};
-var emul = objectEmulatingUndefined();
+var emul = createIsHTMLDDA();
 
 f(obj, obj, false);
 f(obj, obj, false);
 f(emul, obj, true);
 f(emul, obj, true);
 f(obj, emul, true);
 f(obj, emul, true);
 f(Object.prototype, obj, true);
 f(Object.prototype, obj, true);
 f(emul, emul, false);
-f(objectEmulatingUndefined(), emul, true);
-f(objectEmulatingUndefined(), emul, true);
-f(emul, objectEmulatingUndefined(), true);
-f(emul, objectEmulatingUndefined(), true);
+f(createIsHTMLDDA(), emul, true);
+f(createIsHTMLDDA(), emul, true);
+f(emul, createIsHTMLDDA(), true);
+f(emul, createIsHTMLDDA(), true);
--- a/js/src/jit-test/tests/truthiness/strict-equal-null.js
+++ b/js/src/jit-test/tests/truthiness/strict-equal-null.js
@@ -6,18 +6,18 @@ function f(v, value)
 }
 
 f({}, false);
 f({}, false);
 f(null, true);
 f(null, true);
 f(undefined, false);
 f(undefined, false);
-f(objectEmulatingUndefined(), false);
-f(objectEmulatingUndefined(), false);
+f(createIsHTMLDDA(), false);
+f(createIsHTMLDDA(), false);
 f(Object.prototype, false);
 f(Object.prototype, false);
 
 function g(v, value)
 {
   var b = v === null;
   assertEq(b, value,
            "failed: " + v + " " + value);
@@ -28,10 +28,10 @@ g({}, false);
 
 function h(v, value)
 {
   var b = v === null;
   assertEq(b, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), false);
-h(objectEmulatingUndefined(), false);
+h(createIsHTMLDDA(), false);
+h(createIsHTMLDDA(), false);
--- a/js/src/jit-test/tests/truthiness/strict-equal-undefined.js
+++ b/js/src/jit-test/tests/truthiness/strict-equal-undefined.js
@@ -6,18 +6,18 @@ function f(v, value)
 }
 
 f({}, false);
 f({}, false);
 f(null, false);
 f(null, false);
 f(undefined, true);
 f(undefined, true);
-f(objectEmulatingUndefined(), false);
-f(objectEmulatingUndefined(), false);
+f(createIsHTMLDDA(), false);
+f(createIsHTMLDDA(), false);
 f(Object.prototype, false);
 f(Object.prototype, false);
 
 function g(v, value)
 {
   var b = v === undefined;
   assertEq(b, value,
            "failed: " + v + " " + value);
@@ -28,10 +28,10 @@ g({}, false);
 
 function h(v, value)
 {
   var b = v === undefined;
   assertEq(b, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), false);
-h(objectEmulatingUndefined(), false);
+h(createIsHTMLDDA(), false);
+h(createIsHTMLDDA(), false);
--- a/js/src/jit-test/tests/truthiness/strict-not-equal-null.js
+++ b/js/src/jit-test/tests/truthiness/strict-not-equal-null.js
@@ -6,18 +6,18 @@ function f(v, value)
 }
 
 f({}, true);
 f({}, true);
 f(null, false);
 f(null, false);
 f(undefined, true);
 f(undefined, true);
-f(objectEmulatingUndefined(), true);
-f(objectEmulatingUndefined(), true);
+f(createIsHTMLDDA(), true);
+f(createIsHTMLDDA(), true);
 f(Object.prototype, true);
 f(Object.prototype, true);
 
 function g(v, value)
 {
   var b = v !== null;
   assertEq(b, value,
            "failed: " + v + " " + value);
@@ -28,10 +28,10 @@ g({}, true);
 
 function h(v, value)
 {
   var b = v !== null;
   assertEq(b, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), true);
-h(objectEmulatingUndefined(), true);
+h(createIsHTMLDDA(), true);
+h(createIsHTMLDDA(), true);
--- a/js/src/jit-test/tests/truthiness/strict-not-equal-undefined.js
+++ b/js/src/jit-test/tests/truthiness/strict-not-equal-undefined.js
@@ -6,18 +6,18 @@ function f(v, value)
 }
 
 f({}, true);
 f({}, true);
 f(null, true);
 f(null, true);
 f(undefined, false);
 f(undefined, false);
-f(objectEmulatingUndefined(), true);
-f(objectEmulatingUndefined(), true);
+f(createIsHTMLDDA(), true);
+f(createIsHTMLDDA(), true);
 f(Object.prototype, true);
 f(Object.prototype, true);
 
 function g(v, value)
 {
   var b = v !== undefined;
   assertEq(b, value,
            "failed: " + v + " " + value);
@@ -28,10 +28,10 @@ g({}, true);
 
 function h(v, value)
 {
   var b = v !== undefined;
   assertEq(b, value,
            "failed: " + v + " " + value);
 }
 
-h(objectEmulatingUndefined(), true);
-h(objectEmulatingUndefined(), true);
+h(createIsHTMLDDA(), true);
+h(createIsHTMLDDA(), true);
--- a/js/src/jit-test/tests/truthiness/typeof.js
+++ b/js/src/jit-test/tests/truthiness/typeof.js
@@ -1,23 +1,23 @@
 function t1(v)
 {
   return typeof v;
 }
 
-assertEq(t1(objectEmulatingUndefined()), "undefined");
-assertEq(t1(objectEmulatingUndefined()), "undefined");
-assertEq(t1(objectEmulatingUndefined()), "undefined");
+assertEq(t1(createIsHTMLDDA()), "undefined");
+assertEq(t1(createIsHTMLDDA()), "undefined");
+assertEq(t1(createIsHTMLDDA()), "undefined");
 
 function t2(v)
 {
   return typeof v;
 }
 
 assertEq(t2(17), "number");
 assertEq(t2(0), "number");
 assertEq(t2(-0), "number");
 assertEq(t2(function(){}), "function");
 assertEq(t2({}), "object");
 assertEq(t2(null), "object");
-assertEq(t2(objectEmulatingUndefined()), "undefined");
-assertEq(t2(objectEmulatingUndefined()), "undefined");
-assertEq(t2(objectEmulatingUndefined()), "undefined");
+assertEq(t2(createIsHTMLDDA()), "undefined");
+assertEq(t2(createIsHTMLDDA()), "undefined");
+assertEq(t2(createIsHTMLDDA()), "undefined");
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -5143,26 +5143,56 @@ static bool
 GetMaxArgs(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setInt32(ARGS_LENGTH_MAX);
     return true;
 }
 
 static bool
-ObjectEmulatingUndefined(JSContext* cx, unsigned argc, Value* vp)
+IsHTMLDDA_Call(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
+    // These are the required conditions under which this object may be called
+    // by test262 tests, and the required behavior under those conditions.
+    if (args.length() == 0 ||
+        (args.length() == 1 && args[0].isString() && args[0].toString()->length() == 0))
+    {
+        args.rval().setNull();
+        return true;
+    }
+
+    JS_ReportErrorASCII(cx, "IsHTMLDDA object is being called in an impermissible manner");
+    return false;
+}
+
+static bool
+CreateIsHTMLDDA(JSContext* cx, unsigned argc, Value* vp)
+{
+    CallArgs args = CallArgsFromVp(argc, vp);
+
+    static const JSClassOps classOps = {
+        nullptr,
+        nullptr,
+        nullptr,
+        nullptr,
+        nullptr,
+        nullptr,
+        nullptr,
+        IsHTMLDDA_Call,
+    };
+
     static const JSClass cls = {
-        "ObjectEmulatingUndefined",
-        JSCLASS_EMULATES_UNDEFINED
+        "IsHTMLDDA",
+        JSCLASS_EMULATES_UNDEFINED,
+        &classOps,
     };
 
-    RootedObject obj(cx, JS_NewObject(cx, &cls));
+    JSObject* obj = JS_NewObject(cx, &cls);
     if (!obj)
         return false;
     args.rval().setObject(*obj);
     return true;
 }
 
 static bool
 GetSelfHostedValue(JSContext* cx, unsigned argc, Value* vp)
@@ -6798,20 +6828,25 @@ static const JSFunctionSpecWithHelp shel
     JS_FN_HELP("addPromiseReactions", AddPromiseReactions, 3, 0,
 "addPromiseReactions(promise, onResolve, onReject)",
 "  Calls the JS::AddPromiseReactions JSAPI function with the given arguments."),
 
     JS_FN_HELP("getMaxArgs", GetMaxArgs, 0, 0,
 "getMaxArgs()",
 "  Return the maximum number of supported args for a call."),
 
-    JS_FN_HELP("objectEmulatingUndefined", ObjectEmulatingUndefined, 0, 0,
-"objectEmulatingUndefined()",
-"  Return a new object obj for which typeof obj === \"undefined\", obj == null\n"
-"  and obj == undefined (and vice versa for !=), and ToBoolean(obj) === false.\n"),
+    JS_FN_HELP("createIsHTMLDDA", CreateIsHTMLDDA, 0, 0,
+"createIsHTMLDDA()",
+"  Return an object |obj| that \"looks like\" the |document.all| object in\n"
+"  browsers in certain ways: |typeof obj === \"undefined\"|, |obj == null|\n"
+"  and |obj == undefined| (vice versa for !=), |ToBoolean(obj) === false|,\n"
+"  and when called with no arguments or the single argument \"\" returns\n"
+"  null.  (Calling |obj| any other way crashes or throws an exception.)\n"
+"  This function implements the exact requirements of the $262.IsHTMLDDA\n"
+"  property in test262."),
 
     JS_FN_HELP("isCachingEnabled", IsCachingEnabled, 0, 0,
 "isCachingEnabled()",
 "  Return whether JS caching is enabled."),
 
     JS_FN_HELP("setCachingEnabled", SetCachingEnabled, 1, 0,
 "setCachingEnabled(b)",
 "  Enable or disable JS caching."),
--- a/js/src/tests/Intl/NumberFormat/options-emulate-undefined.js
+++ b/js/src/tests/Intl/NumberFormat/options-emulate-undefined.js
@@ -1,13 +1,13 @@
 // |reftest| skip-if(!this.hasOwnProperty("Intl"))
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-// objectEmulatingUndefined is only available when running tests in the shell,
+// createIsHTMLDDA is only available when running tests in the shell,
 // not the browser
-if (typeof objectEmulatingUndefined === "function") {
-  let nf = new Intl.NumberFormat('en-US', objectEmulatingUndefined());
+if (typeof createIsHTMLDDA === "function") {
+  let nf = new Intl.NumberFormat('en-US', createIsHTMLDDA());
 }
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
--- a/js/src/tests/Intl/extensions/options-value-emulates-undefined.js
+++ b/js/src/tests/Intl/extensions/options-value-emulates-undefined.js
@@ -15,17 +15,17 @@ if (typeof Intl !== 'object' && typeof q
   reportCompare(true, true);
   quit(0);
 }
 
 /**************
  * BEGIN TEST *
  **************/
 
-var opt = objectEmulatingUndefined();
+var opt = createIsHTMLDDA();
 opt.toString = function() { return "long"; };
 
 var str = new Date(2013, 12 - 1, 14).toLocaleString("en-US", { weekday: opt });
 
 // Because "weekday" was present and not undefined (stringifying to "long"),
 // this must be a string like "Saturday" (in this implementation, that is).
 assertEq(str, "Saturday");
 
--- a/js/src/tests/ecma_6/Object/assign.js
+++ b/js/src/tests/ecma_6/Object/assign.js
@@ -45,18 +45,18 @@ function testToObject() {
     assertThrowsInstanceOf(() => Object.assign(), TypeError);
     assertThrowsInstanceOf(() => Object.assign(null, {}), TypeError);
     assertEq(Object.assign({}, null) instanceof Object, true);
     assertEq(Object.assign({}, undefined) instanceof Object, true);
 
     // Technically an embedding could have this as extension acting differently
     // from ours, so a feature-test is inadequate.  We can move this subtest
     // into extensions/ if that ever matters.
-    if (typeof objectEmulatingUndefined === "function") {
-        var falsyObject = objectEmulatingUndefined();
+    if (typeof createIsHTMLDDA === "function") {
+        var falsyObject = createIsHTMLDDA();
         falsyObject.foo = 7;
 
         var obj = Object.assign({}, falsyObject);
         assertEq(obj instanceof Object, true);
         assertEq(obj.foo, 7);
     }
 
     assertEq(Object.assign(true, {}) instanceof Boolean, true);
--- a/js/src/tests/ecma_6/Reflect/defineProperty.js
+++ b/js/src/tests/ecma_6/Reflect/defineProperty.js
@@ -118,18 +118,18 @@ obj = {};
 Object.defineProperty(obj, "prop", {get: g, set: s, configurable: false});
 assertEq(Reflect.defineProperty(obj, "prop", {get: s}), false);
 assertEq(Reflect.defineProperty(obj, "prop", {get: g}), true);  // no-op
 assertEq(Reflect.defineProperty(obj, "prop", {set: g}), false);
 assertEq(Reflect.defineProperty(obj, "prop", {set: s}), true);  // no-op
 
 // Proxy defineProperty handler method that returns false
 var falseValues = [false, 0, -0, "", NaN, null, undefined];
-if (typeof objectEmulatingUndefined === "function")
-    falseValues.push(objectEmulatingUndefined());
+if (typeof createIsHTMLDDA === "function")
+    falseValues.push(createIsHTMLDDA());
 var value;
 proxy = new Proxy({}, {
     defineProperty(t, id, desc) {
         return value;
     }
 });
 for (value of falseValues) {
     assertEq(Reflect.defineProperty(proxy, "prop", {value: 1}), false);
--- a/js/src/tests/test262-host.js
+++ b/js/src/tests/test262-host.js
@@ -8,20 +8,31 @@
     var ReflectApply = global.Reflect.apply;
     var NewGlobal = global.newGlobal;
     var Atomics = global.Atomics;
     var SharedArrayBuffer = global.SharedArrayBuffer;
     var Int32Array = global.Int32Array;
     var setSharedArrayBuffer = global.setSharedArrayBuffer;
     var getSharedArrayBuffer = global.getSharedArrayBuffer;
     var evalInWorker = global.evalInWorker;
+
+    var hasCreateIsHTMLDDA = "createIsHTMLDDA" in global;
     var hasThreads = ("helperThreadCount" in global ? global.helperThreadCount() > 0 : true);
     var hasMailbox = typeof setSharedArrayBuffer == "function" && typeof getSharedArrayBuffer == "function";
     var hasEvalInWorker = typeof evalInWorker == "function";
 
+    if (!hasCreateIsHTMLDDA && !("document" in global && "all" in global.document))
+        throw new Error("no [[IsHTMLDDA]] object available for testing");
+
+    var IsHTMLDDA = hasCreateIsHTMLDDA
+                    ? global.createIsHTMLDDA()
+                    : global.document.all;
+
+
+
     // The $262.agent framework is not appropriate for browsers yet, and some
     // test cases can't work in browsers (they block the main thread).
 
     var shellCode = hasMailbox && hasEvalInWorker;
     var sabTestable = Atomics && SharedArrayBuffer && hasThreads && shellCode;
 
     global.$262 = {
         __proto__: null,
@@ -29,16 +40,17 @@
             var newGlobalObject = NewGlobal();
             var createHostObjectFn = ReflectApply(FunctionToString, createHostObject, []);
             newGlobalObject.Function(`${createHostObjectFn} createHostObject(this);`)();
             return newGlobalObject.$262;
         },
         detachArrayBuffer: global.detachArrayBuffer,
         evalScript: global.evaluateScript || global.evaluate,
         global,
+        IsHTMLDDA,
         agent: (function () {
 
             // SpiderMonkey complication: With run-time argument --no-threads
             // our test runner will not properly filter test cases that can't be
             // run because agents can't be started, and so we do a little
             // filtering here: We will quietly succeed and exit if an agent test
             // should not have been run because threads cannot be started.
             //
--- a/layout/reftests/forms/select/reftest.list
+++ b/layout/reftests/forms/select/reftest.list
@@ -1,14 +1,14 @@
 fuzzy-if(Android,4,12) == out-of-bounds-selectedindex.html out-of-bounds-selectedindex-ref.html # test for bug 471741
 == multiple.html multiple-ref.html
 == boguskids.html boguskids-ref.html
 == dynamic-boguskids.html boguskids-ref.html
 == option-children.html option-children-ref.html
 fuzzy(1,4) == padding-button-placement.html padding-button-placement-ref.html
-HTTP(../..) == vertical-centering.html vertical-centering-ref.html
+== vertical-centering.html vertical-centering-ref.html
 == 997709-2.html 997709-2-ref.html
 fuzzy-if(skiaContent,4,1) needs-focus == focusring-1.html focusring-1-ref.html
 needs-focus == focusring-2.html focusring-2-ref.html
 needs-focus == focusring-3.html focusring-3-ref.html
 == dynamic-text-indent-1.html dynamic-text-indent-1-ref.html
 == dynamic-text-overflow-1.html dynamic-text-overflow-1-ref.html
 == listbox-zero-row-initial.html listbox-zero-row-initial-ref.html
--- a/layout/reftests/svg/sizing/reftest.list
+++ b/layout/reftests/svg/sizing/reftest.list
@@ -254,24 +254,24 @@ fuzzy-if(d2d,1,400) == standalone--pct-p
 # The standalone tests provide a reasonable workout for replaced element
 # algorithm sizing, but we also want to test that SVG embedded inline is
 # positioned correctly when the properties 'display', 'float' and 'position'
 # are set to different values.
 #
 # We could certainly expand on these tests, but they provide reasonable base
 # coverage.
 
-HTTP(../..) == inline--display-block--01.xhtml inline--display-block--01-ref.xhtml
-fuzzy-if(OSX,1,10) HTTP(../..) == inline--display-inline--01.xhtml inline--display-inline--01-ref.xhtml
-HTTP(../..) == inline--display-inline-block--01.xhtml inline--display-inline-block--01-ref.xhtml
+== inline--display-block--01.xhtml inline--display-block--01-ref.xhtml
+fuzzy-if(OSX,1,10) == inline--display-inline--01.xhtml inline--display-inline--01-ref.xhtml
+== inline--display-inline-block--01.xhtml inline--display-inline-block--01-ref.xhtml
 == inline--float-left--01.xhtml            inline--float-left--01-ref.xhtml
 == inline--float-right--01.xhtml           inline--float-right--01-ref.xhtml
 == inline--position-absolute--01.xhtml     inline--position-absolute--01-ref.xhtml
 == inline--position-absolute--02.xhtml     pass.svg
-HTTP(../..) == inline--position-relative--01.xhtml    inline--position-relative--01-ref.xhtml
+== inline--position-relative--01.xhtml    inline--position-relative--01-ref.xhtml
 
 
 # Embedded by reference tests
 #
 # One issue when it comes to documents embedded by reference is whether
 # non-'auto' values for the CSS 'width' and 'height' properties on the
 # _embedded_ document's root element should be used as intrinsic values by
 # replaced elements like HTML <object>. For the sake of simplicity we will
--- a/layout/reftests/svg/text/reftest.list
+++ b/layout/reftests/svg/text/reftest.list
@@ -21,36 +21,36 @@ fuzzy-if(skiaContent,111,81) == simple-a
 == simple-dx-anchor-middle.svg simple-dx-anchor-middle-ref.svg
 == simple-dx-bidi.svg simple-dx-bidi-ref.svg
 == simple-dx-bidi-2.svg simple-dx-bidi-2-ref.svg
 == simple-dx-rtl.svg simple-dx-rtl-ref.svg
 == simple-dx-rtl-2.svg simple-dx-rtl-2-ref.svg
 
 == simple-fill-color-dynamic.svg simple-fill-color-dynamic-ref.svg
 == simple-fill-color.svg simple-fill-color-ref.html
-HTTP(../..) == simple-fill-gradient.svg simple-fill-gradient-ref.svg
+== simple-fill-gradient.svg simple-fill-gradient-ref.svg
 == simple-fill-none.svg simple.svg
 == simple-pointer-events.svg simple.svg
 
 == simple-multiple-dx.svg simple-multiple-dx-ref.html
 == simple-multiple-dx-2.svg simple-multiple-dx.svg
 == simple-multiple-dx-anchor-end-bidi.svg simple-multiple-dx-anchor-end-bidi-ref.svg
-HTTP(../..) == simple-multiple-dx-anchor-middle-bidi.svg simple-multiple-dx-anchor-middle-bidi-ref.svg
+== simple-multiple-dx-anchor-middle-bidi.svg simple-multiple-dx-anchor-middle-bidi-ref.svg
 == simple-multiple-dx-anchor-end-rtl.svg simple-multiple-dx-anchor-end-rtl-ref.svg
 == simple-multiple-dx-anchor-end.svg simple-multiple-dx-anchor-end-ref.svg
-fuzzy-if(skiaContent,1,2) HTTP(../..) == simple-multiple-dx-anchor-middle-rtl.svg simple-multiple-dx-anchor-middle-rtl-ref.svg
-HTTP(../..) == simple-multiple-dx-anchor-middle.svg simple-multiple-dx-anchor-middle-ref.svg
+fuzzy-if(skiaContent,1,2) == simple-multiple-dx-anchor-middle-rtl.svg simple-multiple-dx-anchor-middle-rtl-ref.svg
+== simple-multiple-dx-anchor-middle.svg simple-multiple-dx-anchor-middle-ref.svg
 == simple-multiple-dx-bidi.svg simple-multiple-dx-bidi-ref.svg
 == simple-multiple-dx-bidi-2.svg simple-multiple-dx-bidi.svg
 == simple-multiple-dx-rtl.svg simple-multiple-dx-rtl-ref.svg
 == simple-multiple-dx-rtl-2.svg simple-multiple-dx-rtl.svg
 
 == simple-rtl.svg simple-rtl-ref.html
 == simple-rtl-2.svg simple-rtl.svg
-fails-if(webrender) HTTP(../..) == simple-transform-rotate.svg simple-transform-rotate-ref.svg
+fails-if(webrender) == simple-transform-rotate.svg simple-transform-rotate-ref.svg
 
 == multiple-x.svg multiple-x-ref.svg
 == multiple-x-bidi.svg multiple-x-bidi-ref.svg
 == multiple-x-rtl.svg multiple-x-rtl-ref.svg
 == multiple-x-anchor-end-bidi.svg multiple-x-anchor-end-bidi-ref.svg
 == multiple-x-anchor-end-rtl.svg multiple-x-anchor-end-rtl-ref.svg
 == multiple-x-anchor-end.svg multiple-x-anchor-end-ref.svg
 == multiple-x-dx-bidi.svg multiple-x-dx-bidi-ref.svg
@@ -166,30 +166,30 @@ fuzzy-if(/^Windows\x20NT\x2010\.0/.test(
 == dynamic-font-size-3.svg dynamic-font-size-3-ref.svg
 == dynamic-font-size-4.svg dynamic-font-size-4-ref.svg
 == dynamic-dominant-baseline.svg dynamic-dominant-baseline-ref.svg
 == dynamic-multiple-x.svg dynamic-multiple-x-ref.svg
 fuzzy-if(!d2d,14,2) fuzzy-if(skiaContent,1,200) fails-if(webrender) == dynamic-non-scaling-stroke.svg dynamic-non-scaling-stroke-ref.svg #Bug 885316
 == dynamic-text-shadow.svg text-shadow-ref.svg
 
 # text and masks
-fuzzy-if(skiaContent&&winWidget,50,224) HTTP(../..)  == mask-applied.svg mask-applied-ref.svg
-fuzzy-if(skiaContent&&winWidget,105,112) HTTP(../..) == mask-content.svg mask-content-ref.svg
-fuzzy-if(skiaContent&&winWidget,53,112) HTTP(../..) == mask-content-2.svg mask-content-2-ref.svg
+fuzzy-if(skiaContent&&winWidget,50,224)  == mask-applied.svg mask-applied-ref.svg
+fuzzy-if(skiaContent&&winWidget,105,112) == mask-content.svg mask-content-ref.svg
+fuzzy-if(skiaContent&&winWidget,53,112) == mask-content-2.svg mask-content-2-ref.svg
 
 # text and clipPaths
-HTTP(../..) == clipPath-applied.svg clipPath-applied-ref.svg
-fuzzy-if(skiaContent&&winWidget,105,56) HTTP(../..) == clipPath-content.svg clipPath-content-ref.svg
-fuzzy-if(skiaContent&&winWidget,53,112) HTTP(../..) == clipPath-content-2.svg clipPath-content-2-ref.svg
+== clipPath-applied.svg clipPath-applied-ref.svg
+fuzzy-if(skiaContent&&winWidget,105,56) == clipPath-content.svg clipPath-content-ref.svg
+fuzzy-if(skiaContent&&winWidget,53,112) == clipPath-content-2.svg clipPath-content-2-ref.svg
 
 # text and patterns
 fuzzy-if(cocoaWidget,1,6) fuzzy-if(skiaContent,65,313)  fails-if(webrender) == pattern-content.svg pattern-content-ref.svg
 
 # text and filters
-fuzzy-if(skiaContent&&winWidget,126,336) HTTP(../..) == filter-applied.svg filter-applied-ref.svg
+fuzzy-if(skiaContent&&winWidget,126,336) == filter-applied.svg filter-applied-ref.svg
 
 # vertical text
 fuzzy-if(skiaContent,1,80) == textpath-vertical-dx.svg textpath-vertical-dx-ref.svg
 
 # selection
 needs-focus == deselectAll.svg deselectAll-ref.svg
 fuzzy-if(skiaContent,1,250) needs-focus == selectSubString.svg selectSubString-ref.svg
 fuzzy-if(skiaContent,1,600) needs-focus == selectSubString-2.svg selectSubString-2-ref.svg
--- a/layout/reftests/writing-mode/tables/reftest.list
+++ b/layout/reftests/writing-mode/tables/reftest.list
@@ -58,26 +58,26 @@ fuzzy-if(skiaContent,1,90) == fixed-tabl
 == fixed-table-layout-025-vrl.html fixed-table-layout-025-ref.html
 == fixed-table-layout-026-vrl.html fixed-table-layout-025-ref.html
 == fixed-table-layout-027-vrl.html fixed-table-layout-025-ref.html
 == fixed-table-layout-028-vrl.html fixed-table-layout-025-ref.html
 == fixed-table-layout-029-vrl.html fixed-table-layout-025-ref.html
 == fixed-table-layout-030-vrl.html fixed-table-layout-025-ref.html
 == fixed-table-layout-031-vrl.html fixed-table-layout-025-ref.html
 
-HTTP(../..) == s72-border-spacing-002.xht s72-border-spacing-002-ref.xht
-HTTP(../..) == s72-border-spacing-003.xht s72-border-spacing-002-ref.xht
-HTTP(../..) == s72-border-spacing-004.xht s72-border-spacing-002-ref.xht
-HTTP(../..) == s72-border-spacing-005.xht s72-border-spacing-002-ref.xht
-fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-002.xht multicol-count-002-ref.xht
-fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-003.xht multicol-count-002-ref.xht
-fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-004.xht multicol-count-002-ref.xht
-fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-005.xht multicol-count-002-ref.xht
-fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-006.xht multicol-count-002-ref.xht
-fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-007.xht multicol-count-002-ref.xht
+== s72-border-spacing-002.xht s72-border-spacing-002-ref.xht
+== s72-border-spacing-003.xht s72-border-spacing-002-ref.xht
+== s72-border-spacing-004.xht s72-border-spacing-002-ref.xht
+== s72-border-spacing-005.xht s72-border-spacing-002-ref.xht
+fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-002.xht multicol-count-002-ref.xht
+fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-003.xht multicol-count-002-ref.xht
+fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-004.xht multicol-count-002-ref.xht
+fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-005.xht multicol-count-002-ref.xht
+fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-006.xht multicol-count-002-ref.xht
+fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-007.xht multicol-count-002-ref.xht
 
 fuzzy-if(Android,255,38) == table-caption-top-1.html table-caption-top-1-ref.html
 fuzzy-if(Android,255,38) == table-caption-bottom-1.html table-caption-bottom-1-ref.html
 fuzzy-if(Android,244,27) == table-caption-left-1.html table-caption-left-1-ref.html
 fuzzy-if(Android,244,27) == table-caption-right-1.html table-caption-right-1-ref.html
 
 == border-collapse-bevels-1a.html border-collapse-bevels-1-ref.html
 fuzzy-if(cocoaWidget,23,162) fails-if(webrender) == border-collapse-bevels-1b.html border-collapse-bevels-1-ref.html # bug 1393907 for webrender
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -234,34 +234,38 @@ nsImageBoxFrame::UpdateImage()
   // get the new image src
   nsAutoString src;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::src, src);
   mUseSrcAttr = !src.IsEmpty();
   if (mUseSrcAttr) {
     nsIDocument* doc = mContent->GetComposedDoc();
     if (doc) {
       nsContentPolicyType contentPolicyType;
-      nsCOMPtr<nsIPrincipal> loadingPrincipal;
+      nsCOMPtr<nsIPrincipal> triggeringPrincipal;
       uint64_t requestContextID = 0;
       nsContentUtils::GetContentPolicyTypeForUIImageLoading(mContent,
-                                                            getter_AddRefs(loadingPrincipal),
+                                                            getter_AddRefs(triggeringPrincipal),
                                                             contentPolicyType,
                                                             &requestContextID);
 
       nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
       nsCOMPtr<nsIURI> uri;
       nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(uri),
                                                 src,
                                                 doc,
                                                 baseURI);
       if (uri) {
-        nsresult rv = nsContentUtils::LoadImage(uri, mContent, doc, loadingPrincipal, requestContextID,
-                                                doc->GetDocumentURI(), doc->GetReferrerPolicy(),
+        nsresult rv = nsContentUtils::LoadImage(uri, mContent, doc,
+                                                triggeringPrincipal,
+                                                requestContextID,
+                                                doc->GetDocumentURI(),
+                                                doc->GetReferrerPolicy(),
                                                 mListener, mLoadFlags,
-                                                EmptyString(), getter_AddRefs(mImageRequest),
+                                                EmptyString(),
+                                                getter_AddRefs(mImageRequest),
                                                 contentPolicyType);
 
         if (NS_SUCCEEDED(rv) && mImageRequest) {
           nsLayoutUtils::RegisterImageRequestIfAnimated(presContext,
                                                         mImageRequest,
                                                         &mRequestRegistered);
         }
       }
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -857,16 +857,20 @@ pref("dom.vr.enabled", true);
 #endif
 
 pref("browser.tabs.showAudioPlayingIcon", true);
 
 pref("dom.serviceWorkers.enabled", true);
 pref("dom.serviceWorkers.interception.enabled", true);
 pref("dom.serviceWorkers.openWindow.enabled", true);
 
+// Allow service workers to open windows for a longer period after a notification
+// click on mobile.  This is to account for some devices being quite slow.
+pref("dom.serviceWorkers.disable_open_click_delay", 5000);
+
 pref("dom.push.debug", false);
 // The upstream autopush endpoint must have the Google API key corresponding to
 // the App's sender ID; we bake this assumption directly into the URL.
 pref("dom.push.serverURL", "https://updates.push.services.mozilla.com/v1/gcm/@MOZ_ANDROID_GCM_SENDERID@");
 pref("dom.push.maxRecentMessageIDsPerSubscription", 0);
 
 #ifdef MOZ_ANDROID_GCM
 pref("dom.push.enabled", true);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1274,17 +1274,19 @@ pref("dom.disable_window_showModalDialog
 
 pref("dom.allow_scripts_to_close_windows",          false);
 
 pref("dom.require_user_interaction_for_beforeunload", true);
 
 pref("dom.disable_open_during_load",                false);
 pref("dom.popup_maximum",                           20);
 pref("dom.popup_allowed_events", "change click dblclick mouseup pointerup notificationclick reset submit touchend");
+
 pref("dom.disable_open_click_delay", 1000);
+pref("dom.serviceWorkers.disable_open_click_delay", 1000);
 
 pref("dom.storage.enabled", true);
 pref("dom.storage.default_quota",      5120);
 pref("dom.storage.testing", false);
 
 pref("dom.send_after_paint_to_content", false);
 
 // Timeout clamp in ms for timeouts we clamp
--- a/netwerk/test/TestCookie.cpp
+++ b/netwerk/test/TestCookie.cpp
@@ -81,40 +81,36 @@ SetACookieNoHttp(nsICookieService *aCook
 {
     nsCOMPtr<nsIURI> uri;
     NS_NewURI(getter_AddRefs(uri), aSpec);
 
     nsresult rv = aCookieService->SetCookieString(uri, nullptr, (char *)aCookieString, nullptr);
     EXPECT_TRUE(NS_SUCCEEDED(rv));
 }
 
-// returns true if cookie(s) for the given host were found; else false.
-// the cookie string is returned via aCookie.
-bool
-GetACookie(nsICookieService *aCookieService, const char *aSpec1, const char *aSpec2, char **aCookie)
+// The cookie string is returned via aCookie.
+void
+GetACookie(nsICookieService *aCookieService, const char *aSpec1, const char *aSpec2, nsACString& aCookie)
 {
     nsCOMPtr<nsIURI> uri1, uri2;
     NS_NewURI(getter_AddRefs(uri1), aSpec1);
     if (aSpec2)
         NS_NewURI(getter_AddRefs(uri2), aSpec2);
 
-    Unused << aCookieService->GetCookieStringFromHttp(uri1, uri2, nullptr, aCookie);
-    return *aCookie != nullptr;
+    Unused << aCookieService->GetCookieStringFromHttp(uri1, uri2, nullptr, getter_Copies(aCookie));
 }
 
-// returns true if cookie(s) for the given host were found; else false.
-// the cookie string is returned via aCookie.
-bool
-GetACookieNoHttp(nsICookieService *aCookieService, const char *aSpec, char **aCookie)
+// The cookie string is returned via aCookie.
+void
+GetACookieNoHttp(nsICookieService *aCookieService, const char *aSpec, nsACString& aCookie)
 {
     nsCOMPtr<nsIURI> uri;
     NS_NewURI(getter_AddRefs(uri), aSpec);
 
-    Unused << aCookieService->GetCookieString(uri, nullptr, aCookie);
-    return *aCookie != nullptr;
+    Unused << aCookieService->GetCookieString(uri, nullptr, getter_Copies(aCookie));
 }
 
 // some #defines for comparison rules
 #define MUST_BE_NULL     0
 #define MUST_EQUAL       1
 #define MUST_CONTAIN     2
 #define MUST_NOT_CONTAIN 3
 #define MUST_NOT_EQUAL   4
@@ -198,425 +194,425 @@ TEST(TestCookie,TestCookieMain)
      *    string contains them all, in some order.
      *
      * NOTE: this testsuite is not yet comprehensive or complete, and is
      * somewhat contrived - still under development, and needs improving!
      */
 
     // test some basic variations of the domain & path
     SetACookie(cookieService, "http://www.basic.com", nullptr, "test=basic", nullptr);
-    GetACookie(cookieService, "http://www.basic.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://www.basic.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=basic"));
-    GetACookie(cookieService, "http://www.basic.com/testPath/testfile.txt", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://www.basic.com/testPath/testfile.txt", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=basic"));
-    GetACookie(cookieService, "http://www.basic.com./", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://www.basic.com./", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
-    GetACookie(cookieService, "http://www.basic.com.", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://www.basic.com.", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
-    GetACookie(cookieService, "http://www.basic.com./testPath/testfile.txt", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://www.basic.com./testPath/testfile.txt", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
-    GetACookie(cookieService, "http://www.basic2.com/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://www.basic2.com/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "http://www.basic.com", nullptr, "test=basic; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://www.basic.com/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://www.basic.com/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     // *** domain tests
 
     // test some variations of the domain & path, for different domains of
     // a domain cookie
     SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=domain.com", nullptr);
-    GetACookie(cookieService, "http://domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
-    GetACookie(cookieService, "http://domain.com.", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://domain.com.", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
-    GetACookie(cookieService, "http://www.domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://www.domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
-    GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
     SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=domain.com; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=.domain.com", nullptr);
-    GetACookie(cookieService, "http://domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
-    GetACookie(cookieService, "http://www.domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://www.domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
-    GetACookie(cookieService, "http://bah.domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://bah.domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
     SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=.domain.com; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=.foo.domain.com", nullptr);
-    GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=moose.com", nullptr);
-    GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=domain.com.", nullptr);
-    GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=..domain.com", nullptr);
-    GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=..domain.com.", nullptr);
-    GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://path.net/path/file", nullptr, R"(test=taco; path="/bogus")", nullptr);
-    GetACookie(cookieService, "http://path.net/path/file", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path/file", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=taco"));
     SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=taco; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://path.net/path/file", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path/file", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     // *** path tests
 
     // test some variations of the domain & path, for different paths of
     // a path cookie
     SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/path", nullptr);
-    GetACookie(cookieService, "http://path.net/path", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
-    GetACookie(cookieService, "http://path.net/path/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
-    GetACookie(cookieService, "http://path.net/path/hithere.foo", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path/hithere.foo", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
-    GetACookie(cookieService, "http://path.net/path?hithere/foo", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path?hithere/foo", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
-    GetACookie(cookieService, "http://path.net/path2", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path2", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
-    GetACookie(cookieService, "http://path.net/path2/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path2/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/path; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://path.net/path/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/path/", nullptr);
-    GetACookie(cookieService, "http://path.net/path", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
-    GetACookie(cookieService, "http://path.net/path/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
     SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/path/; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://path.net/path/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     // note that a site can set a cookie for a path it's not on.
     // this is an intentional deviation from spec (see comments in
     // nsCookieService::CheckPath()), so we test this functionality too
     SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/foo/", nullptr);
-    GetACookie(cookieService, "http://path.net/path", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/path", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
-    GetACookie(cookieService, "http://path.net/foo", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/foo", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
     SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/foo/; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://path.net/foo/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/foo/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     // bug 373228: make sure cookies with paths longer than 1024 bytes,
     // and cookies with paths or names containing tabs, are rejected.
     // the following cookie has a path > 1024 bytes explicitly specified in the cookie
     SetACookie(cookieService, "http://path.net/", nullptr, "test=path; path=/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/", nullptr);
-    GetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // the following cookie has a path > 1024 bytes implicitly specified by the uri path
     SetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/", nullptr, "test=path", nullptr);
-    GetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // the following cookie includes a tab in the path
     SetACookie(cookieService, "http://path.net/", nullptr, "test=path; path=/foo\tbar/", nullptr);
-    GetACookie(cookieService, "http://path.net/foo\tbar/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/foo\tbar/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // the following cookie includes a tab in the name
     SetACookie(cookieService, "http://path.net/", nullptr, "test\ttabs=tab", nullptr);
-    GetACookie(cookieService, "http://path.net/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // the following cookie includes a tab in the value - allowed
     SetACookie(cookieService, "http://path.net/", nullptr, "test=tab\ttest", nullptr);
-    GetACookie(cookieService, "http://path.net/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=tab\ttest"));
     SetACookie(cookieService, "http://path.net/", nullptr, "test=tab\ttest; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://path.net/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://path.net/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
 
     // *** expiry & deletion tests
     // XXX add server time str parsing tests here
 
     // test some variations of the expiry time,
     // and test deletion of previously set cookies
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=0", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; expires=bad", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; expires=Thu, 10 Apr 1980 16:33:12 GMT", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "http://expireme.org/", nullptr, R"(test=expiry; expires="Thu, 10 Apr 1980 16:33:12 GMT)", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "http://expireme.org/", nullptr, R"(test=expiry; expires="Thu, 10 Apr 1980 16:33:12 GMT")", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=60", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=-20", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=60", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; expires=Thu, 10 Apr 1980 16:33:12 GMT", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=60", nullptr);
     SetACookie(cookieService, "http://expireme.org/", nullptr, "newtest=expiry; max-age=60", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=expiry"));
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "newtest=expiry"));
     SetACookie(cookieService, "http://expireme.org/", nullptr, "test=differentvalue; max-age=0", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "newtest=expiry"));
     SetACookie(cookieService, "http://expireme.org/", nullptr, "newtest=evendifferentvalue; max-age=0", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     SetACookie(cookieService, "http://foo.expireme.org/", nullptr, "test=expiry; domain=.expireme.org; max-age=60", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
     SetACookie(cookieService, "http://bar.expireme.org/", nullptr, "test=differentvalue; domain=.expireme.org; max-age=0", nullptr);
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     nsAutoCString ServerTime;
     nsAutoCString CookieString;
 
     SetTime(-OFFSET_ONE_WEEK, ServerTime, CookieString, true);
     SetACookie(cookieService, "http://expireme.org/", nullptr, CookieString.get(), ServerTime.get());
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // Set server time earlier than client time for one year + one day, and expirty time earlier than server time for one day.
     SetTime(-(OFFSET_ONE_DAY + OFFSET_ONE_WEEK), ServerTime, CookieString, false);
     SetACookie(cookieService, "http://expireme.org/", nullptr, CookieString.get(), ServerTime.get());
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // Set server time later than client time for one year, and expiry time later than server time for one day.
     SetTime(OFFSET_ONE_WEEK, ServerTime, CookieString, false);
     SetACookie(cookieService, "http://expireme.org/", nullptr, CookieString.get(), ServerTime.get());
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
     // Set server time later than client time for one year + one day, and expiry time earlier than server time for one day.
     SetTime((OFFSET_ONE_DAY + OFFSET_ONE_WEEK), ServerTime, CookieString, true);
     SetACookie(cookieService, "http://expireme.org/", nullptr, CookieString.get(), ServerTime.get());
-    GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
 
     // *** multiple cookie tests
 
     // test the setting of multiple cookies, and test the order of precedence
     // (a later cookie overwriting an earlier one, in the same header string)
     SetACookie(cookieService, "http://multiple.cookies/", nullptr, "test=multiple; domain=.multiple.cookies \n test=different \n test=same; domain=.multiple.cookies \n newtest=ciao \n newtest=foo; max-age=-6 \n newtest=reincarnated", nullptr);
-    GetACookie(cookieService, "http://multiple.cookies/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://multiple.cookies/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test=multiple"));
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=different"));
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=same"));
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "newtest=ciao"));
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "newtest=foo"));
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "newtest=reincarnated"));
     SetACookie(cookieService, "http://multiple.cookies/", nullptr, "test=expiry; domain=.multiple.cookies; max-age=0", nullptr);
-    GetACookie(cookieService, "http://multiple.cookies/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://multiple.cookies/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test=same"));
     SetACookie(cookieService, "http://multiple.cookies/", nullptr,  "\n test=different; max-age=0 \n", nullptr);
-    GetACookie(cookieService, "http://multiple.cookies/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://multiple.cookies/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test=different"));
     SetACookie(cookieService, "http://multiple.cookies/", nullptr,  "newtest=dead; max-age=0", nullptr);
-    GetACookie(cookieService, "http://multiple.cookies/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://multiple.cookies/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
 
     // *** parser tests
 
     // test the cookie header parser, under various circumstances.
     SetACookie(cookieService, "http://parser.test/", nullptr, "test=parser; domain=.parser.test; ;; ;=; ,,, ===,abc,=; abracadabra! max-age=20;=;;", nullptr);
-    GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=parser"));
     SetACookie(cookieService, "http://parser.test/", nullptr, "test=parser; domain=.parser.test; max-age=0", nullptr);
-    GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "http://parser.test/", nullptr, "test=\"fubar! = foo;bar\\\";\" parser; domain=.parser.test; max-age=6\nfive; max-age=2.63,", nullptr);
-    GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, R"(test="fubar! = foo)"));
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "five"));
     SetACookie(cookieService, "http://parser.test/", nullptr, "test=kill; domain=.parser.test; max-age=0 \n five; max-age=0", nullptr);
-    GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     // test the handling of VALUE-only cookies (see bug 169091),
     // i.e. "six" should assume an empty NAME, which allows other VALUE-only
     // cookies to overwrite it
     SetACookie(cookieService, "http://parser.test/", nullptr, "six", nullptr);
-    GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "six"));
     SetACookie(cookieService, "http://parser.test/", nullptr, "seven", nullptr);
-    GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "seven"));
     SetACookie(cookieService, "http://parser.test/", nullptr, " =eight", nullptr);
-    GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "eight"));
     SetACookie(cookieService, "http://parser.test/", nullptr, "test=six", nullptr);
-    GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=six"));
 
     // *** path ordering tests
 
     // test that cookies are returned in path order - longest to shortest.
     // if the header doesn't specify a path, it's taken from the host URI.
     SetACookie(cookieService, "http://multi.path.tests/", nullptr, "test1=path; path=/one/two/three", nullptr);
     SetACookie(cookieService, "http://multi.path.tests/", nullptr, "test2=path; path=/one \n test3=path; path=/one/two/three/four \n test4=path; path=/one/two \n test5=path; path=/one/two/", nullptr);
     SetACookie(cookieService, "http://multi.path.tests/one/two/three/four/five/", nullptr, "test6=path", nullptr);
     SetACookie(cookieService, "http://multi.path.tests/one/two/three/four/five/six/", nullptr, "test7=path; path=", nullptr);
     SetACookie(cookieService, "http://multi.path.tests/", nullptr, "test8=path; path=/", nullptr);
-    GetACookie(cookieService, "http://multi.path.tests/one/two/three/four/five/six/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://multi.path.tests/one/two/three/four/five/six/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test7=path; test6=path; test3=path; test1=path; test5=path; test4=path; test2=path; test8=path"));
 
 
     // *** httponly tests
 
     // Since this cookie is NOT set via http, setting it fails
     SetACookieNoHttp(cookieService, "http://httponly.test/", "test=httponly; httponly");
-    GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // Since this cookie is set via http, it can be retrieved
     SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly", nullptr);
-    GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=httponly"));
     // ... but not by web content
-    GetACookieNoHttp(cookieService, "http://httponly.test/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "http://httponly.test/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // Non-Http cookies should not replace HttpOnly cookies
     SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly", nullptr);
     SetACookieNoHttp(cookieService, "http://httponly.test/", "test=not-httponly");
-    GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=httponly"));
     // ... and, if an HttpOnly cookie already exists, should not be set at all
-    GetACookieNoHttp(cookieService, "http://httponly.test/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "http://httponly.test/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // Non-Http cookies should not delete HttpOnly cookies
     SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly", nullptr);
     SetACookieNoHttp(cookieService, "http://httponly.test/", "test=httponly; max-age=-1");
-    GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=httponly"));
     // ... but HttpOnly cookies should
     SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly; max-age=-1", nullptr);
-    GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     // Non-Httponly cookies can replace HttpOnly cookies when set over http
     SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly", nullptr);
     SetACookie(cookieService, "http://httponly.test/", nullptr, "test=not-httponly", nullptr);
-    GetACookieNoHttp(cookieService, "http://httponly.test/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "http://httponly.test/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=not-httponly"));
     // scripts should not be able to set httponly cookies by replacing an existing non-httponly cookie
     SetACookie(cookieService, "http://httponly.test/", nullptr, "test=not-httponly", nullptr);
     SetACookieNoHttp(cookieService, "http://httponly.test/", "test=httponly; httponly");
-    GetACookieNoHttp(cookieService, "http://httponly.test/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "http://httponly.test/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=not-httponly"));
 
     // *** Cookie prefix tests
 
     // prefixed cookies can't be set from insecure HTTP
     SetACookie(cookieService, "http://prefixed.test/", nullptr, "__Secure-test1=test", nullptr);
     SetACookie(cookieService, "http://prefixed.test/", nullptr, "__Secure-test2=test; secure", nullptr);
     SetACookie(cookieService, "http://prefixed.test/", nullptr, "__Host-test1=test", nullptr);
     SetACookie(cookieService, "http://prefixed.test/", nullptr, "__Host-test2=test; secure", nullptr);
-    GetACookie(cookieService, "http://prefixed.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://prefixed.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     // prefixed cookies won't be set without the secure flag
     SetACookie(cookieService, "https://prefixed.test/", nullptr, "__Secure-test=test", nullptr);
     SetACookie(cookieService, "https://prefixed.test/", nullptr, "__Host-test=test", nullptr);
-    GetACookie(cookieService, "https://prefixed.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "https://prefixed.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     // prefixed cookies can be set when done correctly
     SetACookie(cookieService, "https://prefixed.test/", nullptr, "__Secure-test=test; secure", nullptr);
     SetACookie(cookieService, "https://prefixed.test/", nullptr, "__Host-test=test; secure", nullptr);
-    GetACookie(cookieService, "https://prefixed.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "https://prefixed.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "__Secure-test=test"));
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "__Host-test=test"));
 
     // but when set must not be returned to the host insecurely
-    GetACookie(cookieService, "http://prefixed.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://prefixed.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     // Host-prefixed cookies cannot specify a domain
     SetACookie(cookieService, "https://host.prefixed.test/", nullptr, "__Host-a=test; secure; domain=prefixed.test", nullptr);
     SetACookie(cookieService, "https://host.prefixed.test/", nullptr, "__Host-b=test; secure; domain=.prefixed.test", nullptr);
     SetACookie(cookieService, "https://host.prefixed.test/", nullptr, "__Host-c=test; secure; domain=host.prefixed.test", nullptr);
     SetACookie(cookieService, "https://host.prefixed.test/", nullptr, "__Host-d=test; secure; domain=.host.prefixed.test", nullptr);
-    GetACookie(cookieService, "https://host.prefixed.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "https://host.prefixed.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
     // Host-prefixed cookies can only have a path of "/"
     SetACookie(cookieService, "https://host.prefixed.test/some/path", nullptr, "__Host-e=test; secure", nullptr);
     SetACookie(cookieService, "https://host.prefixed.test/some/path", nullptr, "__Host-f=test; secure; path=/", nullptr);
     SetACookie(cookieService, "https://host.prefixed.test/some/path", nullptr, "__Host-g=test; secure; path=/some", nullptr);
-    GetACookie(cookieService, "https://host.prefixed.test/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "https://host.prefixed.test/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "__Host-f=test"));
 
     // *** leave-secure-alone tests
 
     // testing items 0 & 1 for 3.1 of spec Deprecate modification of ’secure’
     // cookies from non-secure origins
     SetACookie(cookieService, "http://www.security.test/", nullptr, "test=non-security; secure", nullptr);
-    GetACookieNoHttp(cookieService, "https://www.security.test/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "https://www.security.test/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
     SetACookie(cookieService, "https://www.security.test/path/", nullptr, "test=security; secure; path=/path/", nullptr);
-    GetACookieNoHttp(cookieService, "https://www.security.test/path/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "https://www.security.test/path/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=security"));
     // testing items 2 & 3 & 4 for 3.2 of spec Deprecate modification of ’secure’
     // cookies from non-secure origins
     // Secure site can modify cookie value
     SetACookie(cookieService, "https://www.security.test/path/", nullptr, "test=security2; secure; path=/path/", nullptr);
-    GetACookieNoHttp(cookieService, "https://www.security.test/path/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "https://www.security.test/path/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=security2"));
     // If new cookie contains same name, same host and partially matching path with
     // an existing security cookie on non-security site, it can't modify an existing
     // security cookie.
     SetACookie(cookieService, "http://www.security.test/path/foo/", nullptr, "test=non-security; path=/path/foo", nullptr);
-    GetACookieNoHttp(cookieService, "https://www.security.test/path/foo/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "https://www.security.test/path/foo/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=security2"));
     // Non-secure cookie can set by same name, same host and non-matching path.
     SetACookie(cookieService, "http://www.security.test/bar/", nullptr, "test=non-security; path=/bar", nullptr);
-    GetACookieNoHttp(cookieService, "http://www.security.test/bar/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "http://www.security.test/bar/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=non-security"));
     // Modify value and downgrade secure level.
     SetACookie(cookieService, "https://www.security.test/", nullptr, "test_modify_cookie=security-cookie; secure; domain=.security.test", nullptr);
-    GetACookieNoHttp(cookieService, "https://www.security.test/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "https://www.security.test/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test_modify_cookie=security-cookie"));
     SetACookie(cookieService, "https://www.security.test/", nullptr, "test_modify_cookie=non-security-cookie; domain=.security.test", nullptr);
-    GetACookieNoHttp(cookieService, "https://www.security.test/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "https://www.security.test/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test_modify_cookie=non-security-cookie"));
     // Test the non-security cookie can set when domain or path not same to secure cookie of same name.
     SetACookie(cookieService, "https://www.security.test/", nullptr, "test=security3", nullptr);
-    GetACookieNoHttp(cookieService, "http://www.security.test/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "http://www.security.test/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=security3"));
     SetACookie(cookieService, "http://www.security.test/", nullptr, "test=non-security2; domain=security.test", nullptr);
-    GetACookieNoHttp(cookieService, "http://www.security.test/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "http://www.security.test/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=non-security2"));
 
     // *** nsICookieManager{2} interface tests
     nsCOMPtr<nsICookieManager> cookieMgr = do_GetService(NS_COOKIEMANAGER_CONTRACTID, &rv0);
     ASSERT_TRUE(NS_SUCCEEDED(rv0));
 
     nsCOMPtr<nsICookieManager2> cookieMgr2 = do_QueryInterface(cookieMgr);
     ASSERT_TRUE(cookieMgr2);
@@ -674,19 +670,19 @@ TEST(TestCookie,TestCookieMain)
         cookie2->GetName(name);
         if (name.EqualsLiteral("test2"))
             expiredCookie = cookie2;
         else if (name.EqualsLiteral("test3"))
             newDomainCookie = cookie2;
     }
     EXPECT_EQ(i, 3);
     // check the httpOnly attribute of the second cookie is honored
-    GetACookie(cookieService, "http://cookiemgr.test/foo/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://cookiemgr.test/foo/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test2=yes"));
-    GetACookieNoHttp(cookieService, "http://cookiemgr.test/foo/", getter_Copies(cookie));
+    GetACookieNoHttp(cookieService, "http://cookiemgr.test/foo/", cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test2=yes"));
     // check CountCookiesFromHost()
     uint32_t hostCookies = 0;
     EXPECT_TRUE(NS_SUCCEEDED(cookieMgr2->CountCookiesFromHost(NS_LITERAL_CSTRING("cookiemgr.test"), &hostCookies)));
     EXPECT_EQ(hostCookies, 2u);
     // check CookieExistsNative() using the third cookie
     bool found;
     EXPECT_TRUE(NS_SUCCEEDED(cookieMgr2->CookieExistsNative(newDomainCookie, &attrs,  &found)));
@@ -741,17 +737,17 @@ TEST(TestCookie,TestCookieMain)
         SetACookie(cookieService, "http://creation.ordering.tests/", nullptr, name.get(), nullptr);
 
         if (i >= 10) {
             expected += name;
             if (i < 59)
                 expected += NS_LITERAL_CSTRING("; ");
         }
     }
-    GetACookie(cookieService, "http://creation.ordering.tests/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://creation.ordering.tests/", nullptr, cookie);
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, expected.get()));
 
     // *** eviction and creation ordering tests after enable network.cookie.leave-secure-alone
     // reset cookie
     cookieMgr->RemoveAll();
 
     for (int32_t i = 0; i < 60; ++i) {
       name = NS_LITERAL_CSTRING("test");
@@ -762,17 +758,17 @@ TEST(TestCookie,TestCookieMain)
       if (i < 50) {
         name += NS_LITERAL_CSTRING("; secure");
         SetACookie(cookieService, "https://creation.ordering.tests/", nullptr, name.get(), nullptr);
       } else {
         // non-security cookies will be removed beside the latest cookie that be created.
         SetACookie(cookieService, "http://creation.ordering.tests/", nullptr, name.get(), nullptr);
       }
     }
-    GetACookie(cookieService, "http://creation.ordering.tests/", nullptr, getter_Copies(cookie));
+    GetACookie(cookieService, "http://creation.ordering.tests/", nullptr, cookie);
 
     EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
 
 
     // *** SameSite attribute - parsing and cookie storage tests
     // Clear the cookies
     EXPECT_TRUE(NS_SUCCEEDED(cookieMgr->RemoveAll()));
 
old mode 100644
new mode 100755
--- a/testing/web-platform/tests/pointerevents/pointerevent_support.js
+++ b/testing/web-platform/tests/pointerevents/pointerevent_support.js
@@ -156,20 +156,23 @@ function updateDescriptionComplete() {
 
 function updateDescriptionSecondStepTouchActionElement(target, scrollReturnInterval) {
     window.setTimeout(function() {
     objectScroller(target, 'up', 0);}
     , scrollReturnInterval);
     document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT moving your outside of the red border";
 }
 
-function updateDescriptionThirdStepTouchActionElement(target, scrollReturnInterval) {
+function updateDescriptionThirdStepTouchActionElement(target, scrollReturnInterval, callback = null) {
     window.setTimeout(function() {
-    objectScroller(target, 'left', 0);}
-    , scrollReturnInterval);
+        objectScroller(target, 'left', 0);
+        if (callback) {
+            callback();
+        }
+    }, scrollReturnInterval);
     document.getElementById('desc').innerHTML = "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the element. Then tap complete button";
 }
 
 function updateDescriptionFourthStepTouchActionElement(target, scrollReturnInterval) {
     document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT starting your touch inside of the element";
 }
 
 function objectScroller(target, direction, value) {
--- a/testing/web-platform/tests/pointerevents/pointerevent_touch-action-button-test_touch-manual.html
+++ b/testing/web-platform/tests/pointerevents/pointerevent_touch-action-button-test_touch-manual.html
@@ -83,20 +83,21 @@
                             test_touchaction_div.step(function () {
                                 yScrollIsReceived = true;
                             });
                             updateDescriptionSecondStepTouchActionElement(target0, scrollReturnInterval);
                         }
 
                         if(xScrollIsReceived && yScrollIsReceived) {
                             test_touchaction_div.done();
-                            updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval);
-                            setTimeout(function() {
-                                isFirstPart = false;
-                            }, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval, function () {
+                                setTimeout(function() {
+                                    isFirstPart = false;
+                                }, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            });
                         }
                     }
                     else {
                         test_touchaction_button.step(failOnScroll, "scroll received while shouldn't");
                     }
                 });
             }
         </script>
--- a/testing/web-platform/tests/pointerevents/pointerevent_touch-action-span-test_touch-manual.html
+++ b/testing/web-platform/tests/pointerevents/pointerevent_touch-action-span-test_touch-manual.html
@@ -86,24 +86,25 @@
                             test_touchaction_div.step(function () {
                                 yScrollIsReceived = true;
                             });
                             updateDescriptionSecondStepTouchActionElement(target0, scrollReturnInterval);
                         }
 
                         if(xScrollIsReceived && yScrollIsReceived) {
                             test_touchaction_div.done();
-                            updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval);
-                            setTimeout(function() {
-                                isFirstPart = false;
-                                xScr0 = target0.scrollLeft;
-                                xScr0 = target0.scrollLeft;
-                                xScrollIsReceived = false;
-                                yScrollIsReceived = false;
-                            }, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval, function () {
+                                setTimeout(function() {
+                                    isFirstPart = false;
+                                    xScr0 = target0.scrollLeft;
+                                    xScr0 = target0.scrollLeft;
+                                    xScrollIsReceived = false;
+                                    yScrollIsReceived = false;
+                                }, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            });
                         }
                     }
                 });
             }
         </script>
         <h1>touch-action: none</h1>
         <div id="complete-notice">
             <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
--- a/testing/web-platform/tests/pointerevents/pointerevent_touch-action-table-test_touch-manual.html
+++ b/testing/web-platform/tests/pointerevents/pointerevent_touch-action-table-test_touch-manual.html
@@ -98,39 +98,43 @@
                             test_touchaction_row.step(function () {
                                 yScrollIsReceived = true;
                             });
                             updateDescriptionSecondStepTable(target0, scrollReturnInterval);
                         }
 
                         if(xScrollIsReceived && yScrollIsReceived) {
                             test_touchaction_row.done();
-                            updateDescriptionThirdStepTable(target0, scrollReturnInterval);
-                            setTimeout(function() {
-                                isFirstPart = false;
-                            }, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            updateDescriptionThirdStepTable(target0, scrollReturnInterval, function() {
+                                setTimeout(function() {
+                                    isFirstPart = false;
+                                }, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
+                            });
                         }
                     }
                     else {
                         test_touchaction_cell.step(failOnScroll, "scroll received while shouldn't");
                     }
                 });
             }
 
             function updateDescriptionSecondStepTable(target, scrollReturnInterval, element) {
                 window.setTimeout(function() {
                     objectScroller(target, 'up', 0);
                 }
                 , scrollReturnInterval);
                 document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT staring your touch over the Row 1";
             }
 
-            function updateDescriptionThirdStepTable(target, scrollReturnInterval) {
+            function updateDescriptionThirdStepTable(target, scrollReturnInterval, callback = null) {
                 window.setTimeout(function() {
                     objectScroller(target, 'left', 0);
+                    if (callback) {
+                        callback();
+                    }
                 }
                 , scrollReturnInterval);
                 document.getElementById('desc').innerHTML = "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the Cell 3";
             }
 
         </script>
         <h1>touch-action: none</h1>
         <div id="complete-notice">
--- a/toolkit/components/commandlines/nsCommandLine.cpp
+++ b/toolkit/components/commandlines/nsCommandLine.cpp
@@ -449,36 +449,33 @@ nsCommandLine::Init(int32_t argc, const 
         appendArg(colon+1);
       } else {
         appendArg(dup);
       }
       PL_strfree(dup);
       continue;
     }
 #endif
-#ifdef XP_UNIX
-    if (*curarg == '-' &&
-        *(curarg+1) == '-') {
-      ++curarg;
+    if (*curarg == '-') {
+      if (*(curarg+1) == '-') ++curarg;
 
       char* dup = PL_strdup(curarg);
       if (!dup) return NS_ERROR_OUT_OF_MEMORY;
 
       char* eq = PL_strchr(dup, '=');
       if (eq) {
         *eq = '\0';
         appendArg(dup);
         appendArg(eq + 1);
       } else {
         appendArg(dup);
       }
       PL_strfree(dup);
       continue;
     }
-#endif
 
     appendArg(curarg);
   }
 
   mState = aState;
 
   return NS_OK;
 }
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -215,27 +215,29 @@ var Settings = {
     let status = bundle.GetStringFromName(enabled ? "telemetryEnabled" : "telemetryDisabled");
     return status;
   },
 
   /**
    * Updates the button & text at the top of the page to reflect Telemetry state.
    */
   render() {
-    let homeExplanation = document.getElementById("home-explanation");
-    let fhrEnabled = Preferences.get(this.SETTINGS[0].pref, this.SETTINGS[0].defaultPrefValue);
-    fhrEnabled = bundle.GetStringFromName(fhrEnabled ? "telemetryEnabled" : "telemetryDisabled");
-    let extendedEnabled = Preferences.get(this.SETTINGS[1].pref, this.SETTINGS[1].defaultPrefValue);
-    extendedEnabled = bundle.GetStringFromName(extendedEnabled ? "extendedTelemetryEnabled" : "extendedTelemetryDisabled");
-    let parameters = [fhrEnabled, extendedEnabled].map(this.convertStringToLink);
+    let settingsExplanation = document.getElementById("settings-explanation");
+    let uploadEnabled = this.getStatusStringForSetting(this.SETTINGS[0]);
+    let extendedEnabled = Services.telemetry.canRecordExtended;
+    let collectedData = bundle.GetStringFromName(extendedEnabled ? "prereleaseData" : "releaseData");
 
-    let explanation = bundle.formatStringFromName("homeExplanation", parameters, 2);
+    let parameters = [
+      collectedData,
+      this.convertStringToLink(uploadEnabled),
+    ];
+    let explanation = bundle.formatStringFromName("settingsExplanation", parameters, 2);
 
     // eslint-disable-next-line no-unsanitized/property
-    homeExplanation.innerHTML = explanation;
+    settingsExplanation.innerHTML = explanation;
     this.attachObservers();
   },
 
   convertStringToLink(string) {
     return "<a href=\"\" class=\"change-data-choices-link\">" + string + "</a>";
   },
 };
 
--- a/toolkit/content/aboutTelemetry.xhtml
+++ b/toolkit/content/aboutTelemetry.xhtml
@@ -140,17 +140,17 @@
 
       <div id="no-search-results" hidden="true" class="hidden">
         <span id="no-search-results-text"></span>
         <div class="no-search-results-image"></div>
       </div>
 
       <section id="home-section" class="active">
         <p id="page-subtitle"></p>
-        <p id="home-explanation"></p>
+        <p id="settings-explanation"></p>
         <p id="ping-explanation"></p>
         <p>&aboutTelemetry.moreInformations;</p>
         <ul>
           <li>&aboutTelemetry.firefoxDataDoc;</li>
           <li>&aboutTelemetry.telemetryClientDoc;</li>
           <li>&aboutTelemetry.telemetryDashboard;</li>
         </ul>
       </section>
--- a/toolkit/content/widgets/menu.xml
+++ b/toolkit/content/widgets/menu.xml
@@ -209,17 +209,17 @@
       <children includes="menupopup"/>
     </content>
   </binding>
 
   <binding id="menuitem-iconic" extends="chrome://global/content/bindings/menu.xml#menuitem">
     <content>
       <xul:hbox class="menu-iconic-left" align="center" pack="center"
                 xbl:inherits="selected,_moz-menuactive,disabled,checked">
-        <xul:image class="menu-iconic-icon" xbl:inherits="src=image,loadingprincipal=iconloadingprincipal,validate,src"/>
+        <xul:image class="menu-iconic-icon" xbl:inherits="src=image,triggeringprincipal=iconloadingprincipal,validate,src"/>
       </xul:hbox>
       <xul:label class="menu-iconic-text" flex="1" xbl:inherits="value=label,accesskey,crop,highlightable" crop="right"/>
       <xul:label class="menu-iconic-highlightable-text" xbl:inherits="xbl:text=label,crop,accesskey,highlightable" crop="right"/>
       <children/>
       <xul:hbox class="menu-accel-container" anonid="accel">
         <xul:label class="menu-iconic-accel" xbl:inherits="value=acceltext"/>
       </xul:hbox>
     </content>
--- a/toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
@@ -2,24 +2,24 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # LOCALIZATION NOTE(pageSubtitle):
 # - %1$S is replaced by the value of the toolkit.telemetry.server_owner preference
 # - %2$S is replaced by brandFullName
 pageSubtitle = This page shows the information about performance, hardware, usage and customizations collected by Telemetry. This information is submitted to %1$S to help improve %2$S.
 
-# LOCALIZATION NOTE(homeExplanation):
-# - %1$S is either telemetryEnabled or telemetryDisabled
-# - %2$S is either extendedTelemetryEnabled or extendedTelemetryDisabled
-homeExplanation = Telemetry is %1$S and extended telemetry is %2$S.
+# LOCALIZATION NOTE(settingsExplanation):
+# - %1$S is either releaseData or prereleaseData
+# - %2$S is either telemetryEnabled or telemetryDisabled
+settingsExplanation = Telemetry is collecting %1$S and upload is %2$S.
+releaseData = release data
+prereleaseData = pre-release data
 telemetryEnabled = enabled
 telemetryDisabled = disabled
-extendedTelemetryEnabled = enabled
-extendedTelemetryDisabled = disabled
 
 # LOCALIZATION NOTE(pingDetails):
 # - %1$S is replaced by a link with pingExplanationLink as text
 # - %2$S is replaced by namedPing
 pingDetails = Each piece of information is sent bundled into “%1$S”. You are looking at the %2$S ping.
 # LOCALIZATION NOTE(namedPing):
 # - %1$S is replaced by the ping localized timestamp, e.g. “2017/07/08 10:40:46”
 # - %2$S is replaced by the ping name, e.g. “saved-session”
--- a/widget/cocoa/nsMenuItemIconX.h
+++ b/widget/cocoa/nsMenuItemIconX.h
@@ -51,17 +51,17 @@ public:
   // Destroy() should be called from mMenuObject's destructor to prevent
   // this from happening.  See bug 499600.
   void Destroy();
 
 protected:
   nsresult OnFrameComplete(imgIRequest* aRequest);
 
   nsCOMPtr<nsIContent>      mContent;
-  nsCOMPtr<nsIPrincipal>    mLoadingPrincipal;
+  nsCOMPtr<nsIPrincipal>    mTriggeringPrincipal;
   nsContentPolicyType       mContentType;
   RefPtr<imgRequestProxy> mIconRequest;
   nsMenuObjectX*            mMenuObject; // [weak]
   nsIntRect                 mImageRegionRect;
   bool                      mLoadedIcon;
   bool                      mSetIcon;
   NSMenuItem*               mNativeMenuItem; // [weak]
 };
--- a/widget/cocoa/nsMenuItemIconX.mm
+++ b/widget/cocoa/nsMenuItemIconX.mm
@@ -53,17 +53,17 @@ static const uint32_t kIconHeight = 16;
 typedef decltype(&nsIDOMRect::GetBottom) GetRectSideMethod;
 
 NS_IMPL_ISUPPORTS(nsMenuItemIconX, imgINotificationObserver)
 
 nsMenuItemIconX::nsMenuItemIconX(nsMenuObjectX* aMenuItem,
                                  nsIContent*    aContent,
                                  NSMenuItem*    aNativeMenuItem)
 : mContent(aContent)
-, mLoadingPrincipal(aContent->NodePrincipal())
+, mTriggeringPrincipal(aContent->NodePrincipal())
 , mContentType(nsIContentPolicy::TYPE_INTERNAL_IMAGE)
 , mMenuObject(aMenuItem)
 , mLoadedIcon(false)
 , mSetIcon(false)
 , mNativeMenuItem(aNativeMenuItem)
 {
   //  printf("Creating icon for menu item %d, menu %d, native item is %d\n", aMenuItem, aMenu, aNativeMenuItem);
 }
@@ -208,17 +208,17 @@ nsMenuItemIconX::GetIconURI(nsIURI** aIc
     if (primitiveType != nsIDOMCSSPrimitiveValue::CSS_URI)
       return NS_ERROR_FAILURE;
 
     rv = primitiveValue->GetStringValue(imageURIString);
     if (NS_FAILED(rv)) return rv;
   } else {
     uint64_t dummy = 0;
     nsContentUtils::GetContentPolicyTypeForUIImageLoading(mContent,
-                                                          getter_AddRefs(mLoadingPrincipal),
+                                                          getter_AddRefs(mTriggeringPrincipal),
                                                           mContentType,
                                                           &dummy);
   }
 
   // Empty the mImageRegionRect initially as the image region CSS could
   // have been changed and now have an error or have been removed since the
   // last GetIconURI call.
   mImageRegionRect.SetEmpty();
@@ -313,17 +313,17 @@ nsMenuItemIconX::LoadIcon(nsIURI* aIconU
     if (!sPlaceholderIconImage) return NS_ERROR_FAILURE;
 
     if (mNativeMenuItem)
       [mNativeMenuItem setImage:sPlaceholderIconImage];
   }
 
   nsresult rv = loader->LoadImage(aIconURI, nullptr, nullptr,
                                   mozilla::net::RP_Unset,
-                                  mLoadingPrincipal, 0, loadGroup, this,
+                                  mTriggeringPrincipal, 0, loadGroup, this,
                                   mContent, document, nsIRequest::LOAD_NORMAL, nullptr,
                                   mContentType, EmptyString(),
                                   /* aUseUrgentStartForChannel */ false,
                                   getter_AddRefs(mIconRequest));
   if (NS_FAILED(rv)) return rv;
 
   return NS_OK;
 
--- a/xpcom/threads/InputEventStatistics.cpp
+++ b/xpcom/threads/InputEventStatistics.cpp
@@ -5,16 +5,27 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "InputEventStatistics.h"
 
 #include "nsRefreshDriver.h"
 
 namespace mozilla {
 
+/*static*/ InputEventStatistics&
+InputEventStatistics::Get()
+{
+  static UniquePtr<InputEventStatistics> sInstance;
+  if (!sInstance) {
+    sInstance = MakeUnique<InputEventStatistics>(ConstructorCookie());
+    ClearOnShutdown(&sInstance);
+  }
+  return *sInstance;
+}
+
 TimeDuration
 InputEventStatistics::TimeDurationCircularBuffer::GetMean()
 {
   return mTotal / (int64_t)mSize;
 }
 
 InputEventStatistics::InputEventStatistics(ConstructorCookie&&)
   : mEnable(false)
--- a/xpcom/threads/InputEventStatistics.h
+++ b/xpcom/threads/InputEventStatistics.h
@@ -74,25 +74,17 @@ class InputEventStatistics
   struct ConstructorCookie {};
 
 public:
   explicit InputEventStatistics(ConstructorCookie&&);
   ~InputEventStatistics()
   {
   }
 
-  static InputEventStatistics& Get()
-  {
-    static UniquePtr<InputEventStatistics> sInstance;
-    if (!sInstance) {
-      sInstance = MakeUnique<InputEventStatistics>(ConstructorCookie());
-      ClearOnShutdown(&sInstance);
-    }
-    return *sInstance;
-  }
+  static InputEventStatistics& Get();
 
   void UpdateInputDuration(TimeDuration aDuration)
   {
     if (!mEnable) {
       return;
     }
     mLastInputDurations->Insert(aDuration);
   }