Merge mozilla-central to mozilla-inbound. r=merge
authorDorel Luca <dluca@mozilla.com>
Wed, 07 Feb 2018 17:09:13 +0200
changeset 402780 f138690ccafddacd0de5c207f9c8f66be51001aa
parent 402779 fd15c14e5efb1874591f4e113c1ae1c49154804f (current diff)
parent 402722 65133e49fbfd5306632301f74be7cd15890bdf9f (diff)
child 402781 0a4f01f2bab716b21d343e1f197bb6031000ce64
push id33402
push useraciure@mozilla.com
push dateWed, 07 Feb 2018 22:06:27 +0000
treeherdermozilla-central@8cc2427a322c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to mozilla-inbound. r=merge
dom/interfaces/smil/moz.build
dom/interfaces/smil/nsIDOMTimeEvent.idl
dom/interfaces/svg/moz.build
dom/interfaces/svg/nsIDOMSVGElement.idl
dom/interfaces/xpath/moz.build
dom/interfaces/xpath/nsIDOMXPathEvaluator.idl
dom/interfaces/xpath/nsIDOMXPathResult.idl
mozglue/build/Authenticode.cpp
mozglue/build/Authenticode.h
toolkit/crashreporter/CertAnnotator.cpp
toolkit/crashreporter/CertAnnotator.h
toolkit/xre/WinDllServices.cpp
toolkit/xre/WinDllServices.h
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -23,24 +23,24 @@
 #include "nsIFile.h"
 
 #ifdef XP_WIN
 #define XRE_WANT_ENVIRON
 #define strcasecmp _stricmp
 #ifdef MOZ_SANDBOX
 #include "mozilla/sandboxing/SandboxInitialization.h"
 #endif
-#include "mozilla/WindowsDllBlocklist.h"
 #endif
 #include "BinaryPath.h"
 
 #include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
 
 #include "mozilla/Sprintf.h"
 #include "mozilla/StartupTimeline.h"
+#include "mozilla/WindowsDllBlocklist.h"
 
 #ifdef LIBFUZZER
 #include "FuzzerDefs.h"
 #endif
 
 #ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
 #include <cpuid.h>
 #include "mozilla/Unused.h"
--- a/browser/components/migration/FirefoxProfileMigrator.js
+++ b/browser/components/migration/FirefoxProfileMigrator.js
@@ -237,52 +237,32 @@ FirefoxProfileMigrator.prototype._getRes
       let createSubDir = (name) => {
         let dir = currentProfileDir.clone();
         dir.append(name);
         dir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
         return dir;
       };
 
       // If the 'datareporting' directory exists we migrate files from it.
-      let haveStateFile = false;
       let dataReportingDir = this._getFileObject(sourceProfileDir, "datareporting");
       if (dataReportingDir && dataReportingDir.isDirectory()) {
         // Copy only specific files.
         let toCopy = ["state.json", "session-state.json"];
 
         let dest = createSubDir("datareporting");
         let enumerator = dataReportingDir.directoryEntries;
         while (enumerator.hasMoreElements()) {
           let file = enumerator.getNext().QueryInterface(Ci.nsIFile);
           if (file.isDirectory() || !toCopy.includes(file.leafName)) {
             continue;
           }
-
-          if (file.leafName == "state.json") {
-            haveStateFile = true;
-          }
           file.copyTo(dest, "");
         }
       }
 
-      if (!haveStateFile) {
-        // Fall back to migrating the state file that contains the client id from healthreport/.
-        // We first moved the client id management from the FHR implementation to the datareporting
-        // service.
-        // Consequently, we try to migrate an existing FHR state file here as a fallback.
-        let healthReportDir = this._getFileObject(sourceProfileDir, "healthreport");
-        if (healthReportDir && healthReportDir.isDirectory()) {
-          let stateFile = this._getFileObject(healthReportDir, "state.json");
-          if (stateFile) {
-            let dest = createSubDir("healthreport");
-            stateFile.copyTo(dest, "");
-          }
-        }
-      }
-
       aCallback(true);
     },
   };
 
   return [places, cookies, passwords, formData, dictionary, bookmarksBackups,
           session, sync, times, telemetry, favicons].filter(r => r);
 };
 
--- a/browser/components/migration/tests/unit/test_fx_telemetry.js
+++ b/browser/components/migration/tests/unit/test_fx_telemetry.js
@@ -136,39 +136,16 @@ add_task(async function test_migrate_fil
   checkDirectoryContains(targetDir, {
     "datareporting": {
       "state.json": stateContent,
       "session-state.json": sessionStateContent,
     },
   });
 });
 
-add_task(async function test_fallback_fhr_state() {
-  let [srcDir, targetDir] = getTestDirs();
-
-  // Test that we fall back to migrating FHR state if the datareporting
-  // state file does not exist.
-  let stateContent = JSON.stringify({
-    clientId: "68d5474e-19dc-45c1-8e9a-81fca592707c",
-  });
-  let subDir = createSubDir(srcDir, "healthreport");
-  writeToFile(subDir, "state.json", stateContent);
-
-  // Perform migration.
-  let ok = await promiseTelemetryMigrator(srcDir, targetDir);
-  Assert.ok(ok, "callback should have been true");
-
-  checkDirectoryContains(targetDir, {
-    "healthreport": {
-      "state.json": stateContent,
-    },
-  });
-});
-
-
 add_task(async function test_datareporting_not_dir() {
   let [srcDir, targetDir] = getTestDirs();
 
   writeToFile(srcDir, "datareporting", "I'm a file but should be a directory");
 
   let ok = await promiseTelemetryMigrator(srcDir, targetDir);
   Assert.ok(ok, "callback should have been true even though the directory was a file");
 
--- a/browser/components/places/content/placesOverlay.xul
+++ b/browser/components/places/content/placesOverlay.xul
@@ -14,17 +14,18 @@
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <script type="application/javascript"
           src="chrome://global/content/globalOverlay.js"/>
   <script type="application/javascript"
           src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript"><![CDATA[
     ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-    ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
+    ChromeUtils.defineModuleGetter(window,
+      "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
     ChromeUtils.defineModuleGetter(window,
       "PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
     ChromeUtils.defineModuleGetter(window,
       "PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
   ]]></script>
   <script type="application/javascript"
           src="chrome://browser/content/places/controller.js"/>
   <script type="application/javascript"
--- a/browser/components/sessionstore/test/browser_248970_b_perwindowpb.js
+++ b/browser/components/sessionstore/test/browser_248970_b_perwindowpb.js
@@ -36,17 +36,17 @@ function test() {
     try {
       return aLambda() || true;
     } catch (ex) { }
     return false;
   }
 
   function getElementByXPath(aTab, aQuery) {
     let doc = aTab.linkedBrowser.contentDocument;
-    let xptype = Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE;
+    let xptype = doc.defaultView.XPathResult.FIRST_ORDERED_NODE_TYPE;
     return doc.evaluate(aQuery, doc, null, xptype, null).singleNodeValue;
   }
 
   function setFormValue(aTab, aQuery, aValue) {
     let node = getElementByXPath(aTab, aQuery);
     if (typeof aValue == "string")
       node.value = aValue;
     else if (typeof aValue == "boolean")
--- a/browser/components/sessionstore/test/content-forms.js
+++ b/browser/components/sessionstore/test/content-forms.js
@@ -24,17 +24,17 @@ function queryElement(data) {
     return doc.getElementById(data.id);
   }
 
   if (data.hasOwnProperty("selector")) {
     return doc.querySelector(data.selector);
   }
 
   if (data.hasOwnProperty("xpath")) {
-    let xptype = Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE;
+    let xptype = doc.defaultView.XPathResult.FIRST_ORDERED_NODE_TYPE;
     return doc.evaluate(data.xpath, doc, null, xptype, null).singleNodeValue;
   }
 
   throw new Error("couldn't query element");
 }
 
 function dispatchUIEvent(input, type) {
   let event = input.ownerDocument.createEvent("UIEvents");
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -218,17 +218,16 @@
 @RESPATH@/components/dom_sidebar.xpt
 @RESPATH@/components/dom_storage.xpt
 #ifdef MOZ_WEBSPEECH
 @RESPATH@/components/dom_webspeechrecognition.xpt
 #endif
 @RESPATH@/components/dom_workers.xpt
 @RESPATH@/components/dom_xbl.xpt
 @RESPATH@/components/dom_xhr.xpt
-@RESPATH@/components/dom_xpath.xpt
 @RESPATH@/components/dom_xul.xpt
 @RESPATH@/components/dom_presentation.xpt
 @RESPATH@/components/downloads.xpt
 @RESPATH@/components/editor.xpt
 @RESPATH@/components/enterprisepolicies.xpt
 @RESPATH@/components/extensions.xpt
 @RESPATH@/components/exthandler.xpt
 @RESPATH@/components/fastfind.xpt
@@ -698,18 +697,16 @@
 @RESPATH@/res/MainMenu.nib/
 #endif
 
 ; Content-accessible resources.
 @RESPATH@/contentaccessible/*
 
 ; svg
 @RESPATH@/res/svg.css
-@RESPATH@/components/dom_svg.xpt
-@RESPATH@/components/dom_smil.xpt
 
 ; [Personal Security Manager]
 ;
 ; NSS libraries are signed in the staging directory,
 ; meaning their .chk files are created there directly.
 ;
 #ifndef MOZ_SYSTEM_NSS
 #if defined(XP_LINUX) && !defined(ANDROID)
--- a/devtools/client/sourceeditor/tern/browser.js
+++ b/devtools/client/sourceeditor/tern/browser.js
@@ -1425,32 +1425,32 @@ module.exports = {
       "invalidIteratorState": {
         "!type": "bool",
         "!url": "https://developer.mozilla.org/en/docs/Introduction_to_using_XPath_in_JavaScript",
         "!doc": "This document describes the interface for using XPath in JavaScript internally, in extensions, and from websites. Mozilla implements a fair amount of the DOM 3 XPath. Which means that XPath expressions can be run against both HTML and XML documents."
       },
       "numberValue": {
         "!type": "number",
         "!url": "https://developer.mozilla.org/en/docs/XPathResult",
-        "!doc": "Refer to nsIDOMXPathResult for more detail."
+        "!doc": "Refer to XPathResult for more detail."
       },
       "resultType": {
         "!type": "number",
         "!url": "https://developer.mozilla.org/en/docs/DOM/document.evaluate",
         "!doc": "Returns an XPathResult based on an XPath expression and other given parameters."
       },
       "singleNodeValue": {
         "!type": "+Element",
         "!url": "https://developer.mozilla.org/en/docs/Introduction_to_using_XPath_in_JavaScript",
         "!doc": "This document describes the interface for using XPath in JavaScript internally, in extensions, and from websites. Mozilla implements a fair amount of the DOM 3 XPath. Which means that XPath expressions can be run against both HTML and XML documents."
       },
       "snapshotLength": {
         "!type": "number",
         "!url": "https://developer.mozilla.org/en/docs/XPathResult",
-        "!doc": "Refer to nsIDOMXPathResult for more detail."
+        "!doc": "Refer to XPathResult for more detail."
       },
       "stringValue": {
         "!type": "string",
         "!url": "https://developer.mozilla.org/en/docs/Introduction_to_using_XPath_in_JavaScript",
         "!doc": "This document describes the interface for using XPath in JavaScript internally, in extensions, and from websites. Mozilla implements a fair amount of the DOM 3 XPath. Which means that XPath expressions can be run against both HTML and XML documents."
       },
       "iterateNext": {
         "!type": "fn()",
@@ -1468,17 +1468,17 @@ module.exports = {
       "UNORDERED_NODE_ITERATOR_TYPE": "number",
       "ORDERED_NODE_ITERATOR_TYPE": "number",
       "UNORDERED_NODE_SNAPSHOT_TYPE": "number",
       "ORDERED_NODE_SNAPSHOT_TYPE": "number",
       "ANY_UNORDERED_NODE_TYPE": "number",
       "FIRST_ORDERED_NODE_TYPE": "number"
     },
     "!url": "https://developer.mozilla.org/en/docs/XPathResult",
-    "!doc": "Refer to nsIDOMXPathResult for more detail."
+    "!doc": "Refer to XPathResult for more detail."
   },
   "ClientRect": {
     "!type": "fn()",
     "prototype": {
       "top": {
         "!type": "number",
         "!url": "https://developer.mozilla.org/en/docs/DOM/element.getClientRects",
         "!doc": "Top of the box, in pixels, relative to the viewport."
--- a/devtools/client/webconsole/webconsole.js
+++ b/devtools/client/webconsole/webconsole.js
@@ -978,22 +978,19 @@ WebConsoleFrame.prototype = {
 
     // Look for message nodes (".message") with the given preference key
     // (filter="error", filter="cssparser", etc.) and add or remove the
     // "filtered-by-type" class, which turns on or off the display.
 
     let attribute = !WORKERTYPES_PREFKEYS.includes(prefKey)
                       ? "filter" : "workerType";
 
-    let xpath = ".//*[contains(@class, 'message') and " +
-      "@" + attribute + "='" + prefKey + "']";
-    let result = doc.evaluate(xpath, outputNode, null,
-      Ci.nsIDOMXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
-    for (let i = 0; i < result.snapshotLength; i++) {
-      let node = result.snapshotItem(i);
+    let selector = "[" + attribute + "='" + prefKey + "'].message";
+    let result = outputNode.querySelectorAll(selector);
+    for (let node of result) {
       if (state) {
         node.classList.remove("filtered-by-type");
       } else {
         node.classList.add("filtered-by-type");
       }
     }
   },
 
--- a/devtools/server/actors/webconsole/utils.js
+++ b/devtools/server/actors/webconsole/utils.js
@@ -367,17 +367,17 @@ WebConsoleCommands._registerOriginal("$x
   let nodes = new owner.window.Array();
 
   // Not waiving Xrays, since we want the original Document.evaluate function,
   // instead of anything that's been redefined.
   let doc = owner.window.document;
   context = context || doc;
 
   let results = doc.evaluate(xPath, context, null,
-                             Ci.nsIDOMXPathResult.ANY_TYPE, null);
+                             owner.window.XPathResult.ANY_TYPE, null);
   let node;
   while ((node = results.iterateNext())) {
     nodes.push(node);
   }
 
   return nodes;
 });
 
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1814,27 +1814,24 @@ nsDOMWindowUtils::GetIMEStatus(uint32_t 
     return NS_ERROR_FAILURE;
 
   InputContext context = widget->GetInputContext();
   *aState = static_cast<uint32_t>(context.mIMEState.mEnabled);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMWindowUtils::GetFocusedInputType(char** aType)
+nsDOMWindowUtils::GetFocusedInputType(nsAString& aType)
 {
-  NS_ENSURE_ARG_POINTER(aType);
-
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     return NS_ERROR_FAILURE;
   }
 
-  InputContext context = widget->GetInputContext();
-  *aType = ToNewCString(context.mHTMLInputType);
+  aType = widget->GetInputContext().mHTMLInputType;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::GetViewId(nsIDOMElement* aElement, nsViewID* aResult)
 {
   nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
   if (content && nsLayoutUtils::FindIDFor(content, aResult)) {
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1806,17 +1806,16 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentXBL)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIScriptObjectPrincipal)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, mozilla::dom::EventTarget)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsISupportsWeakReference)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIApplicationCacheContainer)
-    NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMXPathEvaluator)
   NS_INTERFACE_TABLE_END
   NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsDocument)
 NS_INTERFACE_MAP_END
 
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDocument)
 NS_IMETHODIMP_(MozExternalRefCountType)
 nsDocument::Release()
@@ -1967,17 +1966,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
       cb.NoteXPCOMChild(iter.UserData());
     }
   }
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChannel)
 #ifdef MOZ_OLD_STYLE
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleAttrStyleSheet)
 #endif
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mXPathEvaluator)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLayoutHistoryState)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOnloadBlocker)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFirstBaseNodeWithHref)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDOMImplementation)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImageMaps)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOrientationPendingPromise)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOriginalDocument)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCachedEncoder)
@@ -2060,17 +2058,16 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns
       }
       child->UnbindFromTree();
     }
   }
   tmp->mFirstChild = nullptr;
 
   tmp->UnlinkOriginalDocumentIfStatic();
 
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mXPathEvaluator)
   tmp->mCachedRootElement = nullptr; // Avoid a dangling pointer
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDisplayDocument)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mFirstBaseNodeWithHref)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mMaybeEndOutermostXBLUpdateRunner)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDOMImplementation)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mImageMaps)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mCachedEncoder)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocumentTimeline)
@@ -12157,25 +12154,16 @@ nsIDocument::Evaluate(JSContext* aCx, co
                       nsINode& aContextNode, XPathNSResolver* aResolver,
                       uint16_t aType, JS::Handle<JSObject*> aResult,
                       ErrorResult& rv)
 {
   return XPathEvaluator()->Evaluate(aCx, aExpression, aContextNode, aResolver,
                                     aType, aResult, rv);
 }
 
-NS_IMETHODIMP
-nsDocument::Evaluate(const nsAString& aExpression, nsIDOMNode* aContextNode,
-                     nsIDOMNode* aResolver, uint16_t aType,
-                     nsISupports* aInResult, nsISupports** aResult)
-{
-  return XPathEvaluator()->Evaluate(aExpression, aContextNode, aResolver, aType,
-                                    aInResult, aResult);
-}
-
 nsIDocument*
 nsIDocument::GetTopLevelContentDocument()
 {
   nsIDocument* parent;
 
   if (!mLoadedAsData) {
     parent = this;
   } else {
@@ -12509,19 +12497,19 @@ nsDocument::NotifyLayerManagerRecreated(
   EnumerateActivityObservers(NotifyActivityChanged, nullptr);
   EnumerateSubDocuments(NotifyLayerManagerRecreatedCallback, nullptr);
 }
 
 XPathEvaluator*
 nsIDocument::XPathEvaluator()
 {
   if (!mXPathEvaluator) {
-    mXPathEvaluator = new dom::XPathEvaluator(this);
-  }
-  return mXPathEvaluator;
+    mXPathEvaluator.reset(new dom::XPathEvaluator(this));
+  }
+  return mXPathEvaluator.get();
 }
 
 already_AddRefed<nsIDocumentEncoder>
 nsIDocument::GetCachedEncoder()
 {
   return mCachedEncoder.forget();
 }
 
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -61,17 +61,16 @@
 #include "mozilla/PendingAnimationTracker.h"
 #include "mozilla/dom/BoxObject.h"
 #include "mozilla/dom/DOMImplementation.h"
 #include "mozilla/dom/ScriptLoader.h"
 #include "mozilla/dom/StyleSheetList.h"
 #include "nsDataHashtable.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Attributes.h"
-#include "nsIDOMXPathEvaluator.h"
 #include "jsfriendapi.h"
 #include "mozilla/LinkedList.h"
 #include "CustomElementRegistry.h"
 #include "mozilla/dom/Performance.h"
 #include "mozilla/Maybe.h"
 #include "nsIURIClassifier.h"
 
 #define XML_DECLARATION_BITS_DECLARATION_EXISTS   (1 << 0)
@@ -323,18 +322,17 @@ class PrincipalFlashClassifier;
 // Base class for our document implementations.
 class nsDocument : public nsIDocument,
                    public nsIDOMDocument,
                    public nsIDOMDocumentXBL,
                    public nsSupportsWeakReference,
                    public nsIScriptObjectPrincipal,
                    public nsIRadioGroupContainer,
                    public nsIApplicationCacheContainer,
-                   public nsStubMutationObserver,
-                   public nsIDOMXPathEvaluator
+                   public nsStubMutationObserver
 {
   friend class nsIDocument;
 
 public:
   typedef mozilla::dom::Element Element;
   typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@@ -655,18 +653,16 @@ public:
     GetExistingListenerManager() const override;
 
   // nsIScriptObjectPrincipal
   virtual nsIPrincipal* GetPrincipal() override;
 
   // nsIApplicationCacheContainer
   NS_DECL_NSIAPPLICATIONCACHECONTAINER
 
-  NS_DECL_NSIDOMXPATHEVALUATOR
-
   virtual nsresult Init();
 
   virtual already_AddRefed<Element> CreateElem(const nsAString& aName,
                                                nsAtom* aPrefix,
                                                int32_t aNamespaceID,
                                                const nsAString* aIs = nullptr) override;
 
   virtual void Sanitize() override;
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -3706,17 +3706,17 @@ protected:
   // Our base target.
   nsString mBaseTarget;
 
   nsCOMPtr<nsIStructuredCloneContainer> mStateObjectContainer;
   nsCOMPtr<nsIVariant> mStateObjectCached;
 
   uint32_t mInSyncOperationCount;
 
-  RefPtr<mozilla::dom::XPathEvaluator> mXPathEvaluator;
+  mozilla::UniquePtr<mozilla::dom::XPathEvaluator> mXPathEvaluator;
 
   nsTArray<RefPtr<mozilla::dom::AnonymousContent>> mAnonymousContents;
 
   uint32_t mBlockDOMContentLoaded;
 
   // Our live MediaQueryLists
   mozilla::LinkedList<mozilla::dom::MediaQueryList> mDOMMediaQueryLists;
 
--- a/dom/base/test/unit/test_range.js
+++ b/dom/base/test/unit/test_range.js
@@ -1,17 +1,17 @@
 /* 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/. */
 
 Components.utils.importGlobalProperties(["NodeFilter"]);
 
 const C_i = Components.interfaces;
 
-const UNORDERED_TYPE = C_i.nsIDOMXPathResult.ANY_UNORDERED_NODE_TYPE;
+const UNORDERED_TYPE = 8; // XPathResult.ANY_UNORDERED_NODE_TYPE
 
 /**
  * Determine if the data node has only ignorable white-space.
  *
  * @return NodeFilter.FILTER_SKIP if it does.
  * @return NodeFilter.FILTER_ACCEPT otherwise.
  */
 function isWhitespace(aNode) {
@@ -174,17 +174,16 @@ function getRange(aSourceNode, aFragment
  * @param aPath The path to the local document.
  */
 function getParsedDocument(aPath) {
   return do_parse_document(aPath, "application/xml").then(processParsedDocument);
 }
 
 function processParsedDocument(doc) {
   Assert.ok(doc.documentElement.localName != "parsererror");
-  Assert.ok(doc instanceof C_i.nsIDOMXPathEvaluator);
   Assert.ok(doc instanceof C_i.nsIDOMDocument);
 
   // Clean out whitespace.
   var walker = doc.createTreeWalker(doc,
                                     NodeFilter.SHOW_TEXT |
                                     NodeFilter.SHOW_CDATA_SECTION,
                                     isWhitespace);
   while (walker.nextNode()) {
--- a/dom/events/Event.h
+++ b/dom/events/Event.h
@@ -29,16 +29,17 @@ class nsPresContext;
 namespace mozilla {
 namespace dom {
 
 class EventTarget;
 class EventMessageAutoOverride;
 // ExtendableEvent is a ServiceWorker event that is not
 // autogenerated since it has some extra methods.
 class ExtendableEvent;
+class TimeEvent;
 class WantsPopupControlCheck;
 #define GENERATED_EVENT(EventClass_) class EventClass_;
 #include "mozilla/dom/GeneratedEventList.h"
 #undef GENERATED_EVENT
 
 // Dummy class so we can cast through it to get from nsISupports to
 // Event subclasses with only two non-ambiguous static casts.
 class EventBase : public nsIDOMEvent
@@ -104,16 +105,18 @@ public:
 
   // ExtendableEvent is a ServiceWorker event that is not
   // autogenerated since it has some extra methods.
   virtual ExtendableEvent* AsExtendableEvent()
   {
     return nullptr;
   }
 
+  virtual TimeEvent* AsTimeEvent() { return nullptr; }
+
   // nsIDOMEvent Interface
   NS_DECL_NSIDOMEVENT
 
   void InitPresContextData(nsPresContext* aPresContext);
 
   // Returns true if the event should be trusted.
   bool Init(EventTarget* aGlobal);
 
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -1507,17 +1507,17 @@ interface nsIDOMWindowUtils : nsISupport
   AString getUnanimatedComputedStyle(in nsIDOMElement aElement,
                                      in AString aPseudoElement,
                                      in AString aProperty,
                                      in long aFlushType);
 
   /**
    * Get the type of the currently focused html input, if any.
    */
-  readonly attribute string focusedInputType;
+  readonly attribute AString focusedInputType;
 
   /**
    * Find the view ID for a given element. This is the reverse of
    * findElementWithViewId().
    */
   nsViewID getViewId(in nsIDOMElement aElement);
 
   /**
deleted file mode 100644
--- a/dom/interfaces/smil/moz.build
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-with Files("**"):
-    BUG_COMPONENT = ("Core", "SVG")
-
-XPIDL_SOURCES += [
-    'nsIDOMTimeEvent.idl',
-]
-
-XPIDL_MODULE = 'dom_smil'
-
deleted file mode 100644
--- a/dom/interfaces/smil/nsIDOMTimeEvent.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "nsIDOMEvent.idl"
-
-/**
- * The SMIL TimeEvent interface.
- *
- * For more information please refer to:
- * http://www.w3.org/TR/SMIL/smil-timing.html#Events-TimeEvent
- * http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent
- */
-
-[builtinclass, uuid(b5e7fbac-f572-426c-9320-0ef7630f03c1)]
-interface nsIDOMTimeEvent : nsIDOMEvent
-{
-  readonly attribute long detail;
-};
deleted file mode 100644
--- a/dom/interfaces/svg/moz.build
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-with Files("**"):
-    BUG_COMPONENT = ("Core", "SVG")
-
-XPIDL_SOURCES += [
-    'nsIDOMSVGElement.idl',
-]
-
-XPIDL_MODULE = 'dom_svg'
-
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMSVGElement.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "nsIDOMElement.idl"
-
-[uuid(c63517c5-8bab-4cd1-8694-bccafc32a195)]
-interface nsIDOMSVGElement : nsIDOMElement
-{
-            // raises DOMException on setting
-  readonly attribute nsIDOMSVGElement    ownerSVGElement;
-  readonly attribute nsIDOMSVGElement    viewportElement;
-
-  [binaryname(SVGClassName)]
-  readonly attribute nsISupports   className;
-};
deleted file mode 100644
--- a/dom/interfaces/xpath/moz.build
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-with Files("**"):
-    BUG_COMPONENT = ("Core", "XSLT")
-
-XPIDL_SOURCES += [
-    'nsIDOMXPathEvaluator.idl',
-    'nsIDOMXPathResult.idl',
-]
-
-XPIDL_MODULE = 'dom_xpath'
-
deleted file mode 100644
--- a/dom/interfaces/xpath/nsIDOMXPathEvaluator.idl
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-/**
- * Corresponds to http://www.w3.org/TR/2002/WD-DOM-Level-3-XPath-20020208
- */
-
-#include "domstubs.idl"
-
-interface XPathException;
-
-[uuid(92584002-d0e2-4b88-9af9-fa6ff59ee002)]
-interface nsIDOMXPathEvaluator : nsISupports
-{
-  nsISupports              evaluate(in DOMString expression, 
-                                    in nsIDOMNode contextNode, 
-                                    in nsIDOMNode resolver,
-                                    in unsigned short type, 
-                                    in nsISupports result)
-                                      raises(XPathException,
-                                             DOMException);
-};
deleted file mode 100644
--- a/dom/interfaces/xpath/nsIDOMXPathResult.idl
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-/**
- * Corresponds to http://www.w3.org/TR/2002/WD-DOM-Level-3-XPath-20020208
- */
-
-#include "nsISupports.idl"
-
-[uuid(75506f84-b504-11d5-a7f2-ca108ab8b6fc)]
-interface nsIDOMXPathResult : nsISupports
-{
-  // XPathResultType
-  const unsigned short      ANY_TYPE                       = 0;
-  const unsigned short      NUMBER_TYPE                    = 1;
-  const unsigned short      STRING_TYPE                    = 2;
-  const unsigned short      BOOLEAN_TYPE                   = 3;
-  const unsigned short      UNORDERED_NODE_ITERATOR_TYPE   = 4;
-  const unsigned short      ORDERED_NODE_ITERATOR_TYPE     = 5;
-  const unsigned short      UNORDERED_NODE_SNAPSHOT_TYPE   = 6;
-  const unsigned short      ORDERED_NODE_SNAPSHOT_TYPE     = 7;
-  const unsigned short      ANY_UNORDERED_NODE_TYPE        = 8;
-  const unsigned short      FIRST_ORDERED_NODE_TYPE        = 9;
-};
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -17,25 +17,22 @@ interfaces = [
     'base',
     'canvas',
     'core',
     'html',
     'events',
     'sidebar',
     'range',
     'xbl',
-    'xpath',
     'xul',
     'security',
     'storage',
     'offline',
     'geolocation',
     'notification',
-    'svg',
-    'smil',
     'push',
     'payments',
 ]
 
 DIRS += ['interfaces/' + i for i in interfaces]
 
 DIRS += [
     'abort',
--- a/dom/smil/TimeEvent.cpp
+++ b/dom/smil/TimeEvent.cpp
@@ -33,29 +33,17 @@ TimeEvent::TimeEvent(EventTarget* aOwner
       mView = docShell->GetWindow();
     }
   }
 }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(TimeEvent, Event,
                                    mView)
 
-NS_IMPL_ADDREF_INHERITED(TimeEvent, Event)
-NS_IMPL_RELEASE_INHERITED(TimeEvent, Event)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TimeEvent)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMTimeEvent)
-NS_INTERFACE_MAP_END_INHERITING(Event)
-
-NS_IMETHODIMP
-TimeEvent::GetDetail(int32_t* aDetail)
-{
-  *aDetail = mDetail;
-  return NS_OK;
-}
+NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(TimeEvent, Event)
 
 void
 TimeEvent::InitTimeEvent(const nsAString& aType, nsGlobalWindowInner* aView,
                          int32_t aDetail)
 {
   NS_ENSURE_TRUE_VOID(!mEvent->mFlags.mIsBeingDispatched);
 
   Event::InitEvent(aType, false /*doesn't bubble*/, false /*can't cancel*/);
--- a/dom/smil/TimeEvent.h
+++ b/dom/smil/TimeEvent.h
@@ -4,41 +4,33 @@
  * 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/. */
 
 #ifndef mozilla_dom_TimeEvent_h_
 #define mozilla_dom_TimeEvent_h_
 
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/TimeEventBinding.h"
-#include "nsIDOMTimeEvent.h"
 
 class nsGlobalWindowInner;
 
 namespace mozilla {
 namespace dom {
 
-class TimeEvent final : public Event,
-                        public nsIDOMTimeEvent
+class TimeEvent final : public Event
 {
 public:
   TimeEvent(EventTarget* aOwner,
             nsPresContext* aPresContext,
             InternalSMILTimeEvent* aEvent);
 
   // nsISupports interface:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TimeEvent, Event)
 
-  // nsIDOMTimeEvent interface:
-  NS_DECL_NSIDOMTIMEEVENT
-
-  // Forward to base class
-  NS_FORWARD_TO_EVENT
-
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
   {
     return TimeEventBinding::Wrap(aCx, this, aGivenProto);
   }
 
   void InitTimeEvent(const nsAString& aType, nsGlobalWindowInner* aView,
                      int32_t aDetail);
 
@@ -48,16 +40,18 @@ public:
     return mDetail;
   }
 
   nsPIDOMWindowOuter* GetView() const
   {
     return mView;
   }
 
+  TimeEvent* AsTimeEvent() final { return this; }
+
 private:
   ~TimeEvent() {}
 
   nsCOMPtr<nsPIDOMWindowOuter> mView;
   int32_t mDetail;
 };
 
 } // namespace dom
--- a/dom/smil/nsSMILTimeValueSpec.cpp
+++ b/dom/smil/nsSMILTimeValueSpec.cpp
@@ -1,25 +1,25 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/dom/SVGAnimationElement.h"
+#include "mozilla/dom/TimeEvent.h"
 #include "nsSMILTimeValueSpec.h"
 #include "nsSMILInterval.h"
 #include "nsSMILTimeContainer.h"
 #include "nsSMILTimeValue.h"
 #include "nsSMILTimedElement.h"
 #include "nsSMILInstanceTime.h"
 #include "nsSMILParserUtils.h"
 #include "nsIDOMKeyEvent.h"
-#include "nsIDOMTimeEvent.h"
 #include "nsString.h"
 #include <limits>
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 // Nested class: EventListener
@@ -367,24 +367,23 @@ nsSMILTimeValueSpec::HandleEvent(nsIDOME
   RefPtr<nsSMILInstanceTime> newInstance =
     new nsSMILInstanceTime(newTime, nsSMILInstanceTime::SOURCE_EVENT);
   mOwner->AddInstanceTime(newInstance, mIsBegin);
 }
 
 bool
 nsSMILTimeValueSpec::CheckRepeatEventDetail(nsIDOMEvent *aEvent)
 {
-  nsCOMPtr<nsIDOMTimeEvent> timeEvent = do_QueryInterface(aEvent);
+  TimeEvent* timeEvent = aEvent->InternalDOMEvent()->AsTimeEvent();
   if (!timeEvent) {
     NS_WARNING("Received a repeat event that was not a DOMTimeEvent");
     return false;
   }
 
-  int32_t detail;
-  timeEvent->GetDetail(&detail);
+  int32_t detail = timeEvent->Detail();
   return detail > 0 && (uint32_t)detail == mParams.mRepeatIteration;
 }
 
 nsSMILTimeValue
 nsSMILTimeValueSpec::ConvertBetweenTimeContainers(
     const nsSMILTimeValue& aSrcTime,
     const nsSMILTimeContainer* aSrcContainer)
 {
--- a/dom/svg/DOMSVGLength.h
+++ b/dom/svg/DOMSVGLength.h
@@ -178,17 +178,17 @@ public:
   void GetValueAsString(nsAString& aValue);
   void SetValueAsString(const nsAString& aValue, ErrorResult& aRv);
   void NewValueSpecifiedUnits(uint16_t aUnit, float aValue,
                               ErrorResult& aRv);
   void ConvertToSpecifiedUnits(uint16_t aUnit, ErrorResult& aRv);
 
   nsISupports* GetParentObject() const {
     auto svgElement = mList ? Element() : mSVGElement.get();
-    return static_cast<nsIDOMSVGElement*> (svgElement);
+    return static_cast<nsIDOMElement*>(svgElement);
   }
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 private:
 
   nsSVGElement* Element() const {
     return mList->Element();
--- a/dom/svg/SVGAElement.cpp
+++ b/dom/svg/SVGAElement.cpp
@@ -36,17 +36,16 @@ nsSVGElement::StringInfo SVGAElement::sS
 
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_INTERFACE_MAP_BEGIN(SVGAElement)
   NS_INTERFACE_MAP_ENTRY(nsIDOMNode)
   NS_INTERFACE_MAP_ENTRY(nsIDOMElement)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGElement)
   NS_INTERFACE_MAP_ENTRY(Link)
 NS_INTERFACE_MAP_END_INHERITING(SVGAElementBase)
 
 NS_IMPL_ADDREF_INHERITED(SVGAElement, SVGAElementBase)
 NS_IMPL_RELEASE_INHERITED(SVGAElement, SVGAElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
--- a/dom/svg/SVGAnimationElement.h
+++ b/dom/svg/SVGAnimationElement.h
@@ -84,17 +84,17 @@ public:
   float GetSimpleDuration(ErrorResult& rv);
   void BeginElement(ErrorResult& rv) { BeginElementAt(0.f, rv); }
   void BeginElementAt(float offset, ErrorResult& rv);
   void EndElement(ErrorResult& rv) { EndElementAt(0.f, rv); }
   void EndElementAt(float offset, ErrorResult& rv);
 
   // SVGTests
   virtual bool IsInChromeDoc() const override;
-
+  nsSVGElement* AsSVGElement() final { return this; }
 
  protected:
   // nsSVGElement overrides
 
   void UpdateHrefTarget(nsIContent* aNodeForContext,
                         const nsAString& aHrefStr);
   void AnimationTargetChanged();
 
--- a/dom/svg/SVGDocument.cpp
+++ b/dom/svg/SVGDocument.cpp
@@ -11,17 +11,16 @@
 #include "nsISimpleEnumerator.h"
 #include "nsIStyleSheetService.h"
 #include "nsISupportsPrimitives.h"
 #include "nsLayoutStylesheetCache.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsLiteralString.h"
-#include "nsIDOMSVGElement.h"
 #include "mozilla/dom/Element.h"
 #include "nsSVGElement.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 
 using namespace mozilla::css;
 using namespace mozilla::dom;
 
--- a/dom/svg/SVGFEImageElement.cpp
+++ b/dom/svg/SVGFEImageElement.cpp
@@ -38,17 +38,17 @@ nsSVGElement::StringInfo SVGFEImageEleme
   { &nsGkAtoms::href, kNameSpaceID_None, true },
   { &nsGkAtoms::href, kNameSpaceID_XLink, true }
 };
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ISUPPORTS_INHERITED(SVGFEImageElement, SVGFEImageElementBase,
-                            nsIDOMNode, nsIDOMElement, nsIDOMSVGElement,
+                            nsIDOMNode, nsIDOMElement,
                             imgINotificationObserver, nsIImageLoadingContent)
 
 //----------------------------------------------------------------------
 // Implementation
 
 SVGFEImageElement::SVGFEImageElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGFEImageElementBase(aNodeInfo)
 {
--- a/dom/svg/SVGGraphicsElement.h
+++ b/dom/svg/SVGGraphicsElement.h
@@ -22,14 +22,15 @@ protected:
   explicit SVGGraphicsElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
   ~SVGGraphicsElement();
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
 
   bool IsInChromeDoc() const override;
+  nsSVGElement* AsSVGElement() final { return this; }
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_SVGGraphicsElement_h
--- a/dom/svg/SVGImageElement.cpp
+++ b/dom/svg/SVGImageElement.cpp
@@ -45,17 +45,16 @@ nsSVGElement::StringInfo SVGImageElement
   { &nsGkAtoms::href, kNameSpaceID_XLink, true }
 };
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ISUPPORTS_INHERITED(SVGImageElement, SVGImageElementBase,
                             nsIDOMNode, nsIDOMElement,
-                            nsIDOMSVGElement,
                             imgINotificationObserver,
                             nsIImageLoadingContent)
 
 //----------------------------------------------------------------------
 // Implementation
 
 SVGImageElement::SVGImageElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGImageElementBase(aNodeInfo)
--- a/dom/svg/SVGMPathElement.cpp
+++ b/dom/svg/SVGMPathElement.cpp
@@ -46,17 +46,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(SVGMPathElement,
                                              SVGMPathElementBase,
                                              nsIDOMNode,
                                              nsIDOMElement,
-                                             nsIDOMSVGElement,
                                              nsIMutationObserver)
 
 // Constructor
 SVGMPathElement::SVGMPathElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGMPathElementBase(aNodeInfo)
   , mPathTracker(this)
 {
 }
--- a/dom/svg/SVGSVGElement.cpp
+++ b/dom/svg/SVGSVGElement.cpp
@@ -64,17 +64,17 @@ DOMSVGPoint*
 DOMSVGTranslatePoint::Copy()
 {
   return new DOMSVGPoint(mPt.GetX(), mPt.GetY());
 }
 
 nsISupports*
 DOMSVGTranslatePoint::GetParentObject()
 {
-  return static_cast<nsIDOMSVGElement*>(mElement);
+  return static_cast<nsIDOMElement*>(mElement);
 }
 
 void
 DOMSVGTranslatePoint::SetX(float aValue, ErrorResult& rv)
 {
   mElement->SetCurrentTranslate(aValue, mPt.GetY());
 }
 
@@ -118,18 +118,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
   if (tmp->mTimedDocumentRoot) {
     tmp->mTimedDocumentRoot->Traverse(&cb);
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(SVGSVGElement,
                                              SVGSVGElementBase,
                                              nsIDOMNode,
-                                             nsIDOMElement,
-                                             nsIDOMSVGElement)
+                                             nsIDOMElement)
 
 SVGView::SVGView()
 {
   mZoomAndPan.Init(SVGSVGElement::ZOOMANDPAN,
                    SVG_ZOOMANDPAN_MAGNIFY);
   mViewBox.Init();
   mPreserveAspectRatio.Init();
 }
--- a/dom/svg/SVGScriptElement.cpp
+++ b/dom/svg/SVGScriptElement.cpp
@@ -28,17 +28,16 @@ nsSVGElement::StringInfo SVGScriptElemen
   { &nsGkAtoms::href, kNameSpaceID_XLink, false }
 };
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ISUPPORTS_INHERITED(SVGScriptElement, SVGScriptElementBase,
                             nsIDOMNode, nsIDOMElement,
-                            nsIDOMSVGElement,
                             nsIScriptLoaderObserver,
                             nsIScriptElement, nsIMutationObserver)
 
 //----------------------------------------------------------------------
 // Implementation
 
 SVGScriptElement::SVGScriptElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
                                    FromParser aFromParser)
--- a/dom/svg/SVGSymbolElement.cpp
+++ b/dom/svg/SVGSymbolElement.cpp
@@ -18,17 +18,17 @@ SVGSymbolElement::WrapNode(JSContext *aC
   return SVGSymbolElementBinding::Wrap(aCx, this, aGivenProto);
 }
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ISUPPORTS_INHERITED(SVGSymbolElement, SVGSymbolElementBase,
                             nsIDOMNode, nsIDOMElement,
-                            nsIDOMSVGElement, mozilla::dom::SVGTests)
+                            mozilla::dom::SVGTests)
 
 //----------------------------------------------------------------------
 // Implementation
 
 SVGSymbolElement::SVGSymbolElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGSymbolElementBase(aNodeInfo)
 {
 }
--- a/dom/svg/SVGTests.cpp
+++ b/dom/svg/SVGTests.cpp
@@ -25,38 +25,32 @@ nsStaticAtom** SVGTests::sStringListName
 SVGTests::SVGTests()
 {
   mStringListAttributes[LANGUAGE].SetIsCommaSeparated(true);
 }
 
 already_AddRefed<DOMSVGStringList>
 SVGTests::RequiredFeatures()
 {
-  nsCOMPtr<nsIDOMSVGElement> elem = do_QueryInterface(this);
-  nsSVGElement* element = static_cast<nsSVGElement*>(elem.get());
   return DOMSVGStringList::GetDOMWrapper(
-           &mStringListAttributes[FEATURES], element, true, FEATURES);
+           &mStringListAttributes[FEATURES], AsSVGElement(), true, FEATURES);
 }
 
 already_AddRefed<DOMSVGStringList>
 SVGTests::RequiredExtensions()
 {
-  nsCOMPtr<nsIDOMSVGElement> elem = do_QueryInterface(this);
-  nsSVGElement* element = static_cast<nsSVGElement*>(elem.get());
   return DOMSVGStringList::GetDOMWrapper(
-           &mStringListAttributes[EXTENSIONS], element, true, EXTENSIONS);
+           &mStringListAttributes[EXTENSIONS], AsSVGElement(), true, EXTENSIONS);
 }
 
 already_AddRefed<DOMSVGStringList>
 SVGTests::SystemLanguage()
 {
-  nsCOMPtr<nsIDOMSVGElement> elem = do_QueryInterface(this);
-  nsSVGElement* element = static_cast<nsSVGElement*>(elem.get());
   return DOMSVGStringList::GetDOMWrapper(
-           &mStringListAttributes[LANGUAGE], element, true, LANGUAGE);
+           &mStringListAttributes[LANGUAGE], AsSVGElement(), true, LANGUAGE);
 }
 
 bool
 SVGTests::HasExtension(const nsAString& aExtension)
 {
   return nsSVGFeatures::HasExtension(aExtension, IsInChromeDoc());
 }
 
@@ -219,20 +213,17 @@ SVGTests::GetAttrValue(uint8_t aAttrEnum
   MOZ_ASSERT(aAttrEnum < ArrayLength(sStringListNames),
              "aAttrEnum out of range");
   aValue.SetTo(mStringListAttributes[aAttrEnum], nullptr);
 }
 
 void
 SVGTests::MaybeInvalidate()
 {
-  nsCOMPtr<nsIDOMSVGElement> elem = do_QueryInterface(this);
-  nsSVGElement* element = static_cast<nsSVGElement*>(elem.get());
-
-  nsIContent* parent = element->GetFlattenedTreeParent();
+  nsIContent* parent = AsSVGElement()->GetFlattenedTreeParent();
 
   if (parent &&
       parent->NodeInfo()->Equals(nsGkAtoms::svgSwitch, kNameSpaceID_SVG)) {
     static_cast<dom::SVGSwitchElement*>(parent)->MaybeInvalidate();
   }
 }
 
 } // namespace dom
--- a/dom/svg/SVGTests.h
+++ b/dom/svg/SVGTests.h
@@ -9,16 +9,17 @@
 
 #include "nsStringFwd.h"
 #include "SVGStringList.h"
 #include "nsCOMPtr.h"
 
 class nsAttrValue;
 class nsAtom;
 class nsStaticAtom;
+class nsSVGElement;
 
 namespace mozilla {
 class DOMSVGStringList;
 
 #define MOZILLA_DOMSVGTESTS_IID \
    { 0x92370da8, 0xda28, 0x4895, \
      {0x9b, 0x1b, 0xe0, 0x06, 0x0d, 0xb7, 0x3f, 0xc3 } }
 
@@ -91,16 +92,17 @@ public:
 
   // WebIDL
   already_AddRefed<DOMSVGStringList> RequiredFeatures();
   already_AddRefed<DOMSVGStringList> RequiredExtensions();
   already_AddRefed<DOMSVGStringList> SystemLanguage();
   bool HasExtension(const nsAString& aExtension);
 
   virtual bool IsInChromeDoc() const = 0;
+  virtual nsSVGElement* AsSVGElement() = 0;
 
 protected:
   virtual ~SVGTests() {}
 
 private:
   enum { FEATURES, EXTENSIONS, LANGUAGE };
   SVGStringList mStringListAttributes[3];
   static nsStaticAtom** sStringListNames[3];
--- a/dom/svg/SVGTitleElement.cpp
+++ b/dom/svg/SVGTitleElement.cpp
@@ -18,17 +18,16 @@ SVGTitleElement::WrapNode(JSContext *aCx
   return SVGTitleElementBinding::Wrap(aCx, this, aGivenProto);
 }
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ISUPPORTS_INHERITED(SVGTitleElement, SVGTitleElementBase,
                             nsIDOMNode, nsIDOMElement,
-                            nsIDOMSVGElement,
                             nsIMutationObserver)
 
 //----------------------------------------------------------------------
 // Implementation
 
 SVGTitleElement::SVGTitleElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGTitleElementBase(aNodeInfo)
 {
--- a/dom/svg/nsSVGElement.cpp
+++ b/dom/svg/nsSVGElement.cpp
@@ -106,25 +106,16 @@ nsSVGElement::~nsSVGElement()
 
 JSObject*
 nsSVGElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return SVGElementBinding::Wrap(aCx, this, aGivenProto);
 }
 
 //----------------------------------------------------------------------
-
-NS_IMETHODIMP
-nsSVGElement::GetSVGClassName(nsISupports** aClassName)
-{
-  *aClassName = ClassName().take();
-  return NS_OK;
-}
-
-//----------------------------------------------------------------------
 // nsSVGElement methods
 
 void
 nsSVGElement::DidAnimateClass()
 {
   // For Servo, snapshot the element before we change it.
   nsIPresShell* shell = OwnerDoc()->GetShell();
   if (shell) {
@@ -242,18 +233,17 @@ nsSVGElement::Init()
 
   return NS_OK;
 }
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ISUPPORTS_INHERITED(nsSVGElement, nsSVGElementBase,
-                            nsIDOMNode, nsIDOMElement,
-                            nsIDOMSVGElement)
+                            nsIDOMNode, nsIDOMElement)
 
 //----------------------------------------------------------------------
 // Implementation
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
 nsresult
@@ -1094,24 +1084,16 @@ nsSVGElement::sMaskMap[] = {
 
 //----------------------------------------------------------------------
 // nsIDOMElement methods
 
 // forwarded to Element implementations
 
 
 //----------------------------------------------------------------------
-// nsIDOMSVGElement methods
-
-NS_IMETHODIMP
-nsSVGElement::GetOwnerSVGElement(nsIDOMSVGElement * *aOwnerSVGElement)
-{
-  NS_IF_ADDREF(*aOwnerSVGElement = GetOwnerSVGElement());
-  return NS_OK;
-}
 
 SVGSVGElement*
 nsSVGElement::GetOwnerSVGElement()
 {
   nsIContent* ancestor = GetFlattenedTreeParent();
 
   while (ancestor && ancestor->IsSVGElement()) {
     if (ancestor->IsSVGElement(nsGkAtoms::foreignObject)) {
@@ -1122,24 +1104,16 @@ nsSVGElement::GetOwnerSVGElement()
     }
     ancestor = ancestor->GetFlattenedTreeParent();
   }
 
   // we don't have an ancestor <svg> element...
   return nullptr;
 }
 
-NS_IMETHODIMP
-nsSVGElement::GetViewportElement(nsIDOMSVGElement * *aViewportElement)
-{
-  nsSVGElement* elem = GetViewportElement();
-  NS_ADDREF(*aViewportElement = elem);
-  return NS_OK;
-}
-
 nsSVGElement*
 nsSVGElement::GetViewportElement()
 {
   return SVGContentUtils::GetNearestViewportElement(this);
 }
 
 already_AddRefed<SVGAnimatedString>
 nsSVGElement::ClassName()
@@ -2474,17 +2448,17 @@ nsSVGElement::GetStringListInfo()
 }
 
 nsAttrValue
 nsSVGElement::WillChangeStringList(bool aIsConditionalProcessingAttribute,
                                    uint8_t aAttrEnum)
 {
   nsAtom* name;
   if (aIsConditionalProcessingAttribute) {
-    nsCOMPtr<SVGTests> tests(do_QueryInterface(static_cast<nsIDOMSVGElement*>(this)));
+    nsCOMPtr<SVGTests> tests(do_QueryInterface(static_cast<nsIDOMElement*>(this)));
     name = tests->GetAttrName(aAttrEnum);
   } else {
     name = *GetStringListInfo().mStringListInfo[aAttrEnum].mName;
   }
   return WillChangeValue(name);
 }
 
 void
--- a/dom/svg/nsSVGElement.h
+++ b/dom/svg/nsSVGElement.h
@@ -19,17 +19,17 @@
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "mozilla/dom/DOMRect.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/gfx/MatrixFwd.h"
 #include "nsISupportsImpl.h"
 #include "nsStyledElement.h"
 #include "nsSVGClass.h"
-#include "nsIDOMSVGElement.h"
+#include "nsIDOMElement.h"
 #include "SVGContentUtils.h"
 #include "gfxMatrix.h"
 
 class nsSVGAngle;
 class nsSVGBoolean;
 class nsSVGEnum;
 class nsSVGInteger;
 class nsSVGIntegerPair;
@@ -65,17 +65,17 @@ class DOMSVGStringList;
 
 } // namespace mozilla
 
 struct nsSVGEnumMapping;
 
 typedef nsStyledElement nsSVGElementBase;
 
 class nsSVGElement : public nsSVGElementBase    // nsIContent
-                   , public nsIDOMSVGElement
+                   , public nsIDOMElement
 {
 protected:
   explicit nsSVGElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
   friend nsresult NS_NewSVGElement(mozilla::dom::Element **aResult,
                                    already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
   nsresult Init();
   virtual ~nsSVGElement();
 
@@ -131,17 +131,17 @@ public:
   static const MappedAttributeEntry sViewportsMap[];
   static const MappedAttributeEntry sMarkersMap[];
   static const MappedAttributeEntry sColorMap[];
   static const MappedAttributeEntry sFiltersMap[];
   static const MappedAttributeEntry sFEFloodMap[];
   static const MappedAttributeEntry sLightingEffectsMap[];
   static const MappedAttributeEntry sMaskMap[];
 
-  NS_DECL_NSIDOMSVGELEMENT
+  NS_DECL_NSIDOMELEMENT
 
   NS_IMPL_FROMCONTENT(nsSVGElement, kNameSpaceID_SVG)
 
   // Gets the element that establishes the rectangular viewport against which
   // we should resolve percentage lengths (our "coordinate context"). Returns
   // nullptr for outer <svg> or SVG without an <svg> parent (invalid SVG).
   mozilla::dom::SVGViewportElement* GetCtx() const;
 
--- a/dom/svg/nsSVGFilters.h
+++ b/dom/svg/nsSVGFilters.h
@@ -184,17 +184,17 @@ protected:
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
 
   virtual bool AttributeAffectsRendering(
           int32_t aNameSpaceID, nsAtom* aAttribute) const override;
   virtual nsSVGString& GetResultImageName() override { return mStringAttributes[RESULT]; }
   virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) override;
-  NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFELightingElementBase::)
+  NS_FORWARD_NSIDOMELEMENT(nsSVGFELightingElementBase::)
 
   NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
 
 protected:
   virtual bool OperatesOnSRGB(int32_t aInputIndex,
                               bool aInputIsAlreadySRGB) override { return true; }
 
   virtual NumberAttributesInfo GetNumberInfo() override;
--- a/dom/webidl/LegacyQueryInterface.webidl
+++ b/dom/webidl/LegacyQueryInterface.webidl
@@ -86,9 +86,8 @@ TreeColumns implements LegacyQueryInterf
 TreeContentView implements LegacyQueryInterface;
 TreeWalker implements LegacyQueryInterface;
 ValidityState implements LegacyQueryInterface;
 WebSocket implements LegacyQueryInterface;
 Window implements LegacyQueryInterface;
 XMLHttpRequest implements LegacyQueryInterface;
 XMLHttpRequestUpload implements LegacyQueryInterface;
 XMLSerializer implements LegacyQueryInterface;
-XPathEvaluator implements LegacyQueryInterface;
--- a/dom/webidl/XPathEvaluator.webidl
+++ b/dom/webidl/XPathEvaluator.webidl
@@ -1,17 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
 [Constructor]
 interface XPathEvaluator {
-  // Based on nsIDOMXPathEvaluator
   [NewObject, Throws]
   XPathExpression createExpression(DOMString expression,
                                    optional XPathNSResolver? resolver = null);
   [Pure]
   Node createNSResolver(Node nodeResolver);
   [Throws]
   XPathResult evaluate(DOMString expression,
                        Node contextNode,
--- a/dom/xslt/xpath/XPathEvaluator.cpp
+++ b/dom/xslt/xpath/XPathEvaluator.cpp
@@ -61,61 +61,25 @@ public:
 
 private:
     XPathNSResolver* mResolver;
     nsINode* mResolverNode;
     nsresult mLastError;
     bool mIsCaseSensitive;
 };
 
-NS_IMPL_ISUPPORTS(XPathEvaluator, nsIDOMXPathEvaluator)
-
 XPathEvaluator::XPathEvaluator(nsIDocument* aDocument)
     : mDocument(do_GetWeakReference(aDocument))
 {
 }
 
 XPathEvaluator::~XPathEvaluator()
 {
 }
 
-NS_IMETHODIMP
-XPathEvaluator::Evaluate(const nsAString & aExpression,
-                         nsIDOMNode *aContextNode,
-                         nsIDOMNode *aResolver,
-                         uint16_t aType,
-                         nsISupports *aInResult,
-                         nsISupports **aResult)
-{
-    nsCOMPtr<nsINode> resolver = do_QueryInterface(aResolver);
-    ErrorResult rv;
-    nsAutoPtr<XPathExpression> expression(CreateExpression(aExpression,
-                                                           resolver, rv));
-    if (rv.Failed()) {
-        return rv.StealNSResult();
-    }
-
-    nsCOMPtr<nsINode> node = do_QueryInterface(aContextNode);
-    if (!node) {
-        return NS_ERROR_FAILURE;
-    }
-
-    nsCOMPtr<nsIXPathResult> inResult = do_QueryInterface(aInResult);
-    RefPtr<XPathResult> result =
-        expression->Evaluate(*node, aType,
-                             static_cast<XPathResult*>(inResult.get()), rv);
-    if (rv.Failed()) {
-        return rv.StealNSResult();
-    }
-
-    *aResult = ToSupports(result.forget().take());
-
-    return NS_OK;
-}
-
 XPathExpression*
 XPathEvaluator::CreateExpression(const nsAString& aExpression,
                                  XPathNSResolver* aResolver, ErrorResult& aRv)
 {
     nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
     XPathEvaluatorParseContext pContext(aResolver,
                                         !(doc && doc->IsHTMLDocument()));
     return CreateExpression(aExpression, &pContext, doc, aRv);
@@ -159,23 +123,21 @@ XPathEvaluator::CreateExpression(const n
 bool
 XPathEvaluator::WrapObject(JSContext* aCx,
                            JS::Handle<JSObject*> aGivenProto,
                            JS::MutableHandle<JSObject*> aReflector)
 {
     return dom::XPathEvaluatorBinding::Wrap(aCx, this, aGivenProto, aReflector);
 }
 
-/* static */
-already_AddRefed<XPathEvaluator>
+/* static */ XPathEvaluator*
 XPathEvaluator::Constructor(const GlobalObject& aGlobal,
                             ErrorResult& rv)
 {
-    RefPtr<XPathEvaluator> newObj = new XPathEvaluator(nullptr);
-    return newObj.forget();
+    return new XPathEvaluator(nullptr);
 }
 
 already_AddRefed<XPathResult>
 XPathEvaluator::Evaluate(JSContext* aCx, const nsAString& aExpression,
                          nsINode& aContextNode, XPathNSResolver* aResolver,
                          uint16_t aType, JS::Handle<JSObject*> aResult,
                          ErrorResult& rv)
 {
--- a/dom/xslt/xpath/XPathEvaluator.h
+++ b/dom/xslt/xpath/XPathEvaluator.h
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 #ifndef mozilla_dom_XPathEvaluator_h
 #define mozilla_dom_XPathEvaluator_h
 
-#include "nsIDOMXPathEvaluator.h"
+#include "mozilla/dom/NonRefcountedDOMObject.h"
 #include "nsIWeakReference.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ErrorResult.h"
 #include "nsIDocument.h"
 
 class nsINode;
@@ -24,36 +24,30 @@ namespace dom {
 class GlobalObject;
 class XPathExpression;
 class XPathNSResolver;
 class XPathResult;
 
 /**
  * A class for evaluating an XPath expression string
  */
-class XPathEvaluator final : public nsIDOMXPathEvaluator
+class XPathEvaluator final : public NonRefcountedDOMObject
 {
-    ~XPathEvaluator();
-
 public:
     explicit XPathEvaluator(nsIDocument* aDocument = nullptr);
-
-    NS_DECL_ISUPPORTS
-
-    // nsIDOMXPathEvaluator interface
-    NS_DECL_NSIDOMXPATHEVALUATOR
+    ~XPathEvaluator();
 
     // WebIDL API
     bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
     nsIDocument* GetParentObject()
     {
         nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
         return doc;
     }
-    static already_AddRefed<XPathEvaluator>
+    static XPathEvaluator*
         Constructor(const GlobalObject& aGlobal, ErrorResult& rv);
     XPathExpression*
         CreateExpression(const nsAString& aExpression,
                          XPathNSResolver* aResolver,
                          ErrorResult& rv);
     XPathExpression*
         CreateExpression(const nsAString& aExpression,
                          nsINode* aResolver,
@@ -73,22 +67,12 @@ private:
                          txIParseContext* aContext,
                          nsIDocument* aDocument,
                          ErrorResult& aRv);
 
     nsWeakPtr mDocument;
     RefPtr<txResultRecycler> mRecycler;
 };
 
-inline nsISupports*
-ToSupports(XPathEvaluator* e)
-{
-    return static_cast<nsIDOMXPathEvaluator*>(e);
-}
-
-/* d0a75e02-b5e7-11d5-a7f2-df109fb8a1fc */
-#define TRANSFORMIIX_XPATH_EVALUATOR_CID   \
-{ 0xd0a75e02, 0xb5e7, 0x11d5, { 0xa7, 0xf2, 0xdf, 0x10, 0x9f, 0xb8, 0xa1, 0xfc } }
-
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_XPathEvaluator_h */
--- a/ipc/app/MozillaRuntimeMain.cpp
+++ b/ipc/app/MozillaRuntimeMain.cpp
@@ -2,20 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "../contentproc/plugin-container.cpp"
 
 #include "mozilla/Bootstrap.h"
-
-#if defined(XP_WIN)
 #include "mozilla/WindowsDllBlocklist.h"
-#endif // defined(XP_WIN)
 
 using namespace mozilla;
 
 int
 main(int argc, char *argv[])
 {
 #ifdef HAS_DLL_BLOCKLIST
   DllBlocklist_Initialize(eDllBlocklistInitFlagIsChildProcess);
--- a/js/xpconnect/shell/xpcshell.cpp
+++ b/js/xpconnect/shell/xpcshell.cpp
@@ -3,16 +3,17 @@
 /* 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/. */
 
 /* XPConnect JavaScript interactive shell. */
 
 #include <stdio.h>
 
+#include "mozilla/WindowsDllBlocklist.h"
 #include "mozilla/Bootstrap.h"
 
 #include "nsXULAppAPI.h"
 #ifdef XP_MACOSX
 #include "xpcshellMacUtils.h"
 #endif
 #ifdef XP_WIN
 #include <windows.h>
@@ -20,17 +21,16 @@
 
 // we want a wmain entry point
 #define XRE_DONT_PROTECT_DLL_LOAD
 #define XRE_WANT_ENVIRON
 #include "nsWindowsWMain.cpp"
 #ifdef MOZ_SANDBOX
 #include "mozilla/sandboxing/SandboxInitialization.h"
 #endif
-#include "mozilla/WindowsDllBlocklist.h"
 #endif
 
 #ifdef MOZ_WIDGET_GTK
 #include <gtk/gtk.h>
 #endif
 
 int
 main(int argc, char** argv, char** envp)
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -218,17 +218,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(HTMLEdito
 { 0xe1e79dec, 0x4085, 0x4994, { 0xac, 0x5b, 0x74, 0x4b, 0x01, 0x66, 0x97, 0xe6 } }
 
 #define PRESENTATION_TCP_SESSION_TRANSPORT_CID \
 { 0xc9d023f4, 0x6228, 0x4c07, { 0x8b, 0x1d, 0x9c, 0x19, 0x57, 0x3f, 0xaa, 0x27 } }
 
 already_AddRefed<nsIPresentationService> NS_CreatePresentationService();
 
 // Factory Constructor
-NS_GENERIC_FACTORY_CONSTRUCTOR(XPathEvaluator)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(txNodeSetAdaptor, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMSerializer)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(XMLHttpRequestMainThread, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(FormData)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHostObjectURI)
 NS_GENERIC_FACTORY_CONSTRUCTOR(DOMParser)
 NS_GENERIC_FACTORY_CONSTRUCTOR(LocalStorageManager)
 NS_GENERIC_FACTORY_CONSTRUCTOR(SessionStorageManager)
@@ -588,17 +587,16 @@ NS_DEFINE_NAMED_CID(NS_CONTENT_DOCUMENT_
 NS_DEFINE_NAMED_CID(NS_JSPROTOCOLHANDLER_CID);
 NS_DEFINE_NAMED_CID(NS_JSURI_CID);
 NS_DEFINE_NAMED_CID(NS_WINDOWCOMMANDTABLE_CID);
 NS_DEFINE_NAMED_CID(NS_WINDOWCONTROLLER_CID);
 NS_DEFINE_NAMED_CID(NS_PLUGINDOCLOADERFACTORY_CID);
 NS_DEFINE_NAMED_CID(NS_PLUGINDOCUMENT_CID);
 NS_DEFINE_NAMED_CID(NS_VIDEODOCUMENT_CID);
 NS_DEFINE_NAMED_CID(NS_STYLESHEETSERVICE_CID);
-NS_DEFINE_NAMED_CID(TRANSFORMIIX_XPATH_EVALUATOR_CID);
 NS_DEFINE_NAMED_CID(TRANSFORMIIX_NODESET_CID);
 NS_DEFINE_NAMED_CID(NS_XMLSERIALIZER_CID);
 NS_DEFINE_NAMED_CID(NS_FORMDATA_CID);
 NS_DEFINE_NAMED_CID(NS_HOSTOBJECTURI_CID);
 NS_DEFINE_NAMED_CID(NS_XMLHTTPREQUEST_CID);
 NS_DEFINE_NAMED_CID(NS_DOMPARSER_CID);
 NS_DEFINE_NAMED_CID(NS_DOMSESSIONSTORAGEMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_DOMLOCALSTORAGEMANAGER_CID);
@@ -839,17 +837,16 @@ static const mozilla::Module::CIDEntry k
   { &kNS_JSPROTOCOLHANDLER_CID, false, nullptr, nsJSProtocolHandler::Create },
   { &kNS_JSURI_CID, false, nullptr, nsJSURIConstructor },
   { &kNS_WINDOWCOMMANDTABLE_CID, false, nullptr, CreateWindowCommandTableConstructor },
   { &kNS_WINDOWCONTROLLER_CID, false, nullptr, CreateWindowControllerWithSingletonCommandTable },
   { &kNS_PLUGINDOCLOADERFACTORY_CID, false, nullptr, CreateContentDLF },
   { &kNS_PLUGINDOCUMENT_CID, false, nullptr, CreatePluginDocument },
   { &kNS_VIDEODOCUMENT_CID, false, nullptr, CreateVideoDocument },
   { &kNS_STYLESHEETSERVICE_CID, false, nullptr, nsStyleSheetServiceConstructor },
-  { &kTRANSFORMIIX_XPATH_EVALUATOR_CID, false, nullptr, XPathEvaluatorConstructor },
   { &kTRANSFORMIIX_NODESET_CID, false, nullptr, txNodeSetAdaptorConstructor },
   { &kNS_XMLSERIALIZER_CID, false, nullptr, nsDOMSerializerConstructor },
   { &kNS_FORMDATA_CID, false, nullptr, FormDataConstructor },
   { &kNS_HOSTOBJECTURI_CID, false, nullptr, nsHostObjectURIConstructor },
   { &kNS_XMLHTTPREQUEST_CID, false, nullptr, XMLHttpRequestMainThreadConstructor },
   { &kNS_DOMPARSER_CID, false, nullptr, DOMParserConstructor },
   { &kNS_DOMSESSIONSTORAGEMANAGER_CID, false, nullptr, SessionStorageManagerConstructor },
   { &kNS_DOMLOCALSTORAGEMANAGER_CID, false, nullptr, LocalStorageManagerConstructor },
@@ -956,17 +953,16 @@ static const mozilla::Module::ContractID
 #ifdef MOZ_XUL
   { "@mozilla.org/xul/xul-sort-service;1", &kNS_XULSORTSERVICE_CID },
 #endif
   { CONTENT_DLF_CONTRACTID, &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID },
   { NS_JSPROTOCOLHANDLER_CONTRACTID, &kNS_JSPROTOCOLHANDLER_CID },
   { NS_WINDOWCONTROLLER_CONTRACTID, &kNS_WINDOWCONTROLLER_CID },
   { PLUGIN_DLF_CONTRACTID, &kNS_PLUGINDOCLOADERFACTORY_CID },
   { NS_STYLESHEETSERVICE_CONTRACTID, &kNS_STYLESHEETSERVICE_CID },
-  { NS_XPATH_EVALUATOR_CONTRACTID, &kTRANSFORMIIX_XPATH_EVALUATOR_CID },
   { TRANSFORMIIX_NODESET_CONTRACTID, &kTRANSFORMIIX_NODESET_CID },
   { NS_XMLSERIALIZER_CONTRACTID, &kNS_XMLSERIALIZER_CID },
   { NS_FORMDATA_CONTRACTID, &kNS_FORMDATA_CID },
   { NS_XMLHTTPREQUEST_CONTRACTID, &kNS_XMLHTTPREQUEST_CID },
   { NS_DOMPARSER_CONTRACTID, &kNS_DOMPARSER_CID },
   { "@mozilla.org/dom/localStorage-manager;1", &kNS_DOMLOCALSTORAGEMANAGER_CID },
   // Keeping the old ContractID for backward compatibility
   { "@mozilla.org/dom/storagemanager;1", &kNS_DOMLOCALSTORAGEMANAGER_CID },
--- a/layout/style/MediaQueryList.cpp
+++ b/layout/style/MediaQueryList.cpp
@@ -19,16 +19,17 @@
 
 namespace mozilla {
 namespace dom {
 
 MediaQueryList::MediaQueryList(nsIDocument* aDocument,
                                const nsAString& aMediaQueryList,
                                CallerType aCallerType)
   : mDocument(aDocument)
+  , mMatches(false)
   , mMatchesValid(false)
 {
   mMediaList =
     MediaList::Create(aDocument->GetStyleBackendType(),
                       aMediaQueryList,
                       aCallerType);
 
   KeepAliveIfHasListenersFor(ONCHANGE_STRING);
@@ -133,16 +134,18 @@ MediaQueryList::Disconnect()
   DisconnectFromOwner();
 
   IgnoreKeepAliveIfHasListenersFor(ONCHANGE_STRING);
 }
 
 void
 MediaQueryList::RecomputeMatches()
 {
+  mMatches = false;
+
   if (!mDocument) {
     return;
   }
 
   if (mDocument->GetParentDocument()) {
     // Flush frames on the parent so our prescontext will get
     // recreated as needed.
     mDocument->GetParentDocument()->FlushPendingNotifications(FlushType::Frames);
--- a/mobile/android/app/src/test/java/org/mozilla/gecko/TestGeckoProfile.java
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/TestGeckoProfile.java
@@ -82,36 +82,16 @@ public class TestGeckoProfile {
         assertTrue("Created the parent dirs of the client ID file", clientIdFile.getParentFile().mkdirs());
         writeClientIdToFile(clientIdFile, validClientId);
 
         final String clientIdFromProfile = profile.getClientId();
         assertEquals("Client ID from method matches ID written to disk", validClientId, clientIdFromProfile);
     }
 
     @Test
-    public void testGetClientIdMigrateFromFHR() throws Exception {
-        final File fhrClientIdFile = new File(profileDir, "healthreport/state.json");
-        final String fhrClientId = "905de1c0-0ea6-4a43-95f9-6170035f5a82";
-
-        assertFalse("client ID file does not exist", clientIdFile.exists());
-        assertTrue("Created FHR data directory", new File(profileDir, "healthreport").mkdirs());
-        writeClientIdToFile(fhrClientIdFile, fhrClientId);
-        assertEquals("Migrated Client ID equals FHR client ID", fhrClientId, profile.getClientId());
-
-        // Verify migration wrote to contemporary client ID file.
-        assertTrue("Client ID file created during migration", clientIdFile.exists());
-        assertEquals("Migrated client ID on disk equals value returned from method",
-                fhrClientId, readClientIdFromFile(clientIdFile));
-
-        assertTrue("Deleted FHR clientID file", fhrClientIdFile.delete());
-        assertEquals("Ensure method calls read from newly created client ID file & not FHR client ID file",
-                fhrClientId, profile.getClientId());
-    }
-
-    @Test
     public void testGetClientIdInvalidIdOnDisk() throws Exception {
         assertTrue("Created the parent dirs of the client ID file", clientIdFile.getParentFile().mkdirs());
         writeClientIdToFile(clientIdFile, "");
         final String clientIdForEmptyString = profile.getClientId();
         assertValidClientId(clientIdForEmptyString);
         assertNotEquals("A new client ID was created when the empty String was written to disk", "", clientIdForEmptyString);
 
         writeClientIdToFile(clientIdFile, "invalidClientId");
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfile.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfile.java
@@ -39,17 +39,16 @@ import java.util.concurrent.ConcurrentHa
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 public final class GeckoProfile {
     private static final String LOGTAG = "GeckoProfile";
 
     // The path in the profile to the file containing the client ID.
     private static final String CLIENT_ID_FILE_PATH = "datareporting/state.json";
-    private static final String FHR_CLIENT_ID_FILE_PATH = "healthreport/state.json";
     // In the client ID file, the attribute title in the JSON object containing the client ID value.
     private static final String CLIENT_ID_JSON_ATTR = "clientID";
 
     private static final String TIMES_PATH = "times.json";
     private static final String PROFILE_CREATION_DATE_JSON_ATTR = "created";
 
     // Only tests should need to do this.  We can remove this entirely once we
     // fix Bug 1069687.
@@ -425,18 +424,18 @@ public final class GeckoProfile {
         File f = getDir();
         if (f == null)
             return null;
 
         return new File(f, aFile);
     }
 
     /**
-     * Retrieves the Gecko client ID from the filesystem. If the client ID does not exist, we attempt to migrate and
-     * persist it from FHR and, if that fails, we attempt to create a new one ourselves.
+     * Retrieves the Gecko client ID from the filesystem. If the client ID does not exist,
+     * we attempt to create a new one ourselves.
      *
      * This method assumes the client ID is located in a file at a hard-coded path within the profile. The format of
      * this file is a JSONObject which at the bottom level contains a String -&gt; String mapping containing the client ID.
      *
      * WARNING: the platform provides a JSM to retrieve the client ID [1] and this would be a
      * robust way to access it. However, we don't want to rely on Gecko running in order to get
      * the client ID so instead we access the file this module accesses directly. However, it's
      * possible the format of this file (and the access calls in the jsm) will change, leaving
@@ -449,27 +448,20 @@ public final class GeckoProfile {
      */
     // Mimics ClientID.jsm - _doLoadClientID.
     @WorkerThread
     public String getClientId() throws IOException {
         try {
             return getValidClientIdFromDisk(CLIENT_ID_FILE_PATH);
         } catch (final IOException e) {
             // Avoid log spam: don't log the full Exception w/ the stack trace.
-            Log.d(LOGTAG, "Could not get client ID - attempting to migrate ID from FHR: " + e.getLocalizedMessage());
+            Log.d(LOGTAG, "Could not get client ID - creating a new one: " + e.getLocalizedMessage());
         }
 
-        String clientIdToWrite;
-        try {
-            clientIdToWrite = getValidClientIdFromDisk(FHR_CLIENT_ID_FILE_PATH);
-        } catch (final IOException e) {
-            // Avoid log spam: don't log the full Exception w/ the stack trace.
-            Log.d(LOGTAG, "Could not migrate client ID from FHR - creating a new one: " + e.getLocalizedMessage());
-            clientIdToWrite = generateNewClientId();
-        }
+        String clientIdToWrite = generateNewClientId();
 
         // There is a possibility Gecko is running and the Gecko telemetry implementation decided it's time to generate
         // the client ID, writing client ID underneath us. Since it's highly unlikely (e.g. we run in onStart before
         // Gecko is started), we don't handle that possibility besides writing the ID and then reading from the file
         // again (rather than just returning the value we generated before writing).
         //
         // In the event it does happen, any discrepancy will be resolved after a restart. In the mean time, both this
         // implementation and the Gecko implementation could upload documents with inconsistent IDs.
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -142,17 +142,16 @@
 @BINPATH@/components/dom_sidebar.xpt
 @BINPATH@/components/dom_storage.xpt
 @BINPATH@/components/dom_system.xpt
 #ifdef MOZ_WEBSPEECH
 @BINPATH@/components/dom_webspeechrecognition.xpt
 #endif
 @BINPATH@/components/dom_xbl.xpt
 @BINPATH@/components/dom_xhr.xpt
-@BINPATH@/components/dom_xpath.xpt
 @BINPATH@/components/dom_xul.xpt
 @BINPATH@/components/dom_presentation.xpt
 @BINPATH@/components/downloads.xpt
 @BINPATH@/components/editor.xpt
 @BINPATH@/components/extensions.xpt
 @BINPATH@/components/exthandler.xpt
 @BINPATH@/components/fastfind.xpt
 @BINPATH@/components/feeds.xpt
@@ -475,18 +474,16 @@
 @BINPATH@/res/fonts/*.properties
 #endif
 
 ; Content-accessible resources.
 @BINPATH@/contentaccessible/*
 
 ; svg
 @BINPATH@/res/svg.css
-@BINPATH@/components/dom_svg.xpt
-@BINPATH@/components/dom_smil.xpt
 
 ; [Personal Security Manager]
 ;
 @BINPATH@/components/pipnss.xpt
 
 ; For process sandboxing
 #if defined(MOZ_SANDBOX)
 @BINPATH@/@DLL_PREFIX@mozsandbox@DLL_SUFFIX@
--- a/mobile/android/tests/browser/chrome/test_session_form_data.html
+++ b/mobile/android/tests/browser/chrome/test_session_form_data.html
@@ -41,17 +41,17 @@ function queryElement(contentWindow, dat
     return doc.getElementById(data.id);
   }
 
   if (data.hasOwnProperty("selector")) {
     return doc.querySelector(data.selector);
   }
 
   if (data.hasOwnProperty("xpath")) {
-    let xptype = Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE;
+    let xptype = XPathResult.FIRST_ORDERED_NODE_TYPE;
     return doc.evaluate(data.xpath, doc, null, xptype, null).singleNodeValue;
   }
 
   throw new Error("couldn't query element");
 }
 
 function dispatchUIEvent(input, type) {
   let event = input.ownerDocument.createEvent("UIEvents");
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testUnifiedTelemetryClientId.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testUnifiedTelemetryClientId.java
@@ -2,43 +2,35 @@
  * 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/. */
 
 package org.mozilla.gecko.tests;
 
 import static org.mozilla.gecko.tests.helpers.AssertionHelper.*;
 
 import android.util.Log;
-import org.json.JSONException;
-import org.json.JSONObject;
 import org.mozilla.gecko.GeckoProfile;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.UUID;
 
 public class testUnifiedTelemetryClientId extends JavascriptBridgeTest {
     private static final String TEST_JS = "testUnifiedTelemetryClientId.js";
-
     private static final String CLIENT_ID_PATH = "datareporting/state.json";
-    private static final String FHR_DIR_PATH = "healthreport/";
-    private static final String FHR_CLIENT_ID_PATH = FHR_DIR_PATH + "state.json";
 
     private GeckoProfile profile;
     private File profileDir;
     private File[] filesToDeleteOnReset;
 
     public void setUp() throws Exception {
         super.setUp();
         profile = getTestProfile();
         profileDir = profile.getDir(); // Assumes getDir is tested.
         filesToDeleteOnReset = new File[] {
                 getClientIdFile(),
-                getFHRClientIdFile(),
-                getFHRClientIdParentDir(),
         };
     }
 
     public void tearDown() throws Exception {
         // Don't clear cache because who knows what state Gecko is in.
         deleteClientIDFiles();
         super.tearDown();
     }
@@ -78,19 +70,16 @@ public class testUnifiedTelemetryClientI
         deleteClientIDFiles();
 
         // TODO: If these tests weren't so expensive to run in automation,
         // this should be two separate tests to avoid storing state between tests.
         testJavaCreatesClientId(); // leaves cache filled.
         deleteClientIDFiles();
         testJsCreatesClientId(); // leaves cache filled.
         deleteClientIDFiles();
-        testJavaMigratesFromHealthReport(); // leaves cache filled.
-        deleteClientIDFiles();
-        testJsMigratesFromHealthReport(); // leaves cache filled.
 
         getJS().syncCall("endTest");
     }
 
     /**
      * Scenario: Java creates client ID:
      *   * Fennec starts on fresh profile
      *   * Java code creates the client ID in datareporting/state.json
@@ -139,80 +128,16 @@ public class testUnifiedTelemetryClientI
         final String clientIdFromJavaAgain = getClientIdFromJava();
         resetJSCache();
         final String clientIdFromJSFileAgain = getClientIdFromJS();
         fAssertEquals("Same client ID retrieved from JS cache", clientIdFromJS, clientIdFromJSCache);
         fAssertEquals("Same client ID retrieved from JS file", clientIdFromJS, clientIdFromJSFileAgain);
         fAssertEquals("Same client ID retrieved from Java", clientIdFromJS, clientIdFromJavaAgain);
     }
 
-    /**
-     * Scenario: Java migrates client ID from FHR client ID file.
-     *   * FHR file already exists.
-     *   * Fennec starts on fresh profile
-     *   * Java code merges client ID to datareporting/state.json from healthreport/state.json
-     *   * Js accesses client ID from the same file
-     *   * Assert the client IDs are the same
-     */
-    private void testJavaMigratesFromHealthReport() throws Exception {
-        Log.d(LOGTAG, "testJavaMigratesFromHealthReport: start");
-
-        fAssertFalse("Client id file does not exist yet", getClientIdFile().exists());
-        fAssertFalse("Health report file does not exist yet", getFHRClientIdFile().exists());
-
-        final String expectedClientId = UUID.randomUUID().toString();
-        createFHRClientIdFile(expectedClientId);
-
-        final String clientIdFromJava = getClientIdFromJava();
-        fAssertEquals("Health report client ID merged by Java", expectedClientId, clientIdFromJava);
-        resetJSCache();
-        final String clientIdFromJS = getClientIdFromJS();
-        fAssertEquals("Merged client ID read by JS", expectedClientId, clientIdFromJS);
-
-        final String clientIdFromJavaAgain = getClientIdFromJava();
-        final String clientIdFromJSCache = getClientIdFromJS();
-        resetJSCache();
-        final String clientIdFromJSFileAgain = getClientIdFromJS();
-        fAssertEquals("Same client ID retrieved from Java", expectedClientId, clientIdFromJavaAgain);
-        fAssertEquals("Same client ID retrieved from JS cache", expectedClientId, clientIdFromJSCache);
-        fAssertEquals("Same client ID retrieved from JS file", expectedClientId, clientIdFromJSFileAgain);
-    }
-
-    /**
-     * Scenario: JS merges client ID from FHR client ID file.
-     *   * FHR file already exists.
-     *   * Fennec starts on a fresh profile
-     *   * Js merges the client ID to datareporting/state.json from healthreport/state.json
-     *   * Java access the client ID from the same file
-     *   * Assert the client IDs are the same
-     */
-    private void testJsMigratesFromHealthReport() throws Exception {
-        Log.d(LOGTAG, "testJsMigratesFromHealthReport: start");
-
-        fAssertFalse("Client id file does not exist yet", getClientIdFile().exists());
-        fAssertFalse("Health report file does not exist yet", getFHRClientIdFile().exists());
-
-        final String expectedClientId = UUID.randomUUID().toString();
-        createFHRClientIdFile(expectedClientId);
-
-        resetJSCache();
-        final String clientIdFromJS = getClientIdFromJS();
-        fAssertEquals("Health report client ID merged by JS", expectedClientId, clientIdFromJS);
-        final String clientIdFromJava = getClientIdFromJava();
-        fAssertEquals("Merged client ID read by Java", expectedClientId, clientIdFromJava);
-
-        final String clientIdFromJavaAgain = getClientIdFromJava();
-        final String clientIdFromJSCache = getClientIdFromJS();
-        resetJSCache();
-        final String clientIdFromJSFileAgain = getClientIdFromJS();
-        fAssertEquals("Same client ID retrieved from Java", expectedClientId, clientIdFromJavaAgain);
-        fAssertEquals("Same client ID retrieved from JS cache", expectedClientId, clientIdFromJSCache);
-        fAssertEquals("Same client ID retrieved from JS file", expectedClientId, clientIdFromJSFileAgain);
-    }
-
     private String getClientIdFromJava() throws IOException {
         // This assumes implementation details: it assumes the client ID
         // file is created when Java attempts to retrieve it if it does not exist.
         final String clientId = profile.getClientId();
         fAssertNotNull("Returned client ID is not null", clientId);
         fAssertTrue("Client ID file exists after getClientId call", getClientIdFile().exists());
         return clientId;
     }
@@ -240,26 +165,9 @@ public class testUnifiedTelemetryClientI
         // HACK: the backing JS method is a promise with no return value. Rather than writing a method
         // to handle this (for time reasons), I call the get String method and don't access the return value.
         getBlockingFromJsString("reset");
     }
 
     private File getClientIdFile() {
         return new File(profileDir, CLIENT_ID_PATH);
     }
-
-    private File getFHRClientIdParentDir() {
-        return new File(profileDir, FHR_DIR_PATH);
-    }
-
-    private File getFHRClientIdFile() {
-        return new File(profileDir, FHR_CLIENT_ID_PATH);
-    }
-
-    private void createFHRClientIdFile(final String clientId) throws JSONException {
-        fAssertTrue("FHR directory created", getFHRClientIdParentDir().mkdirs());
-
-        final JSONObject obj = new JSONObject();
-        obj.put("clientID", clientId);
-        profile.writeFile(FHR_CLIENT_ID_PATH, obj.toString());
-        fAssertTrue("FHR client ID file exists after writing", getFHRClientIdFile().exists());
-    }
 }
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3960,21 +3960,26 @@ pref("intl.tsf.support_imm", true);
 // only when active keyboard layout is a legacy IMM-IME.
 pref("intl.tsf.associate_imc_only_when_imm_ime_is_active", false);
 
 // Enables/Disables hack for specific TIP.
 
 // Whether creates native caret for ATOK or not.
 pref("intl.tsf.hack.atok.create_native_caret", true);
 // Whether use available composition string rect for result of
-// ITfContextView::GetTextExt() even if the specified range is same as the
+// ITextStoreACP::GetTextExt() even if the specified range is same as the
 // range of composition string but some character rects of them are not
 // available.  Note that this is ignored if active ATOK is or older than 2016
 // and create_native_caret is true.
 pref("intl.tsf.hack.atok.do_not_return_no_layout_error_of_composition_string", true);
+// Whether use available composition string rect for result of
+// ITextStoreACP::GetTextExt() even if the specified range is same as or is in
+// the range of composition string but some character rects of them are not
+// available.
+pref("intl.tsf.hack.japanist10.do_not_return_no_layout_error_of_composition_string", true);
 // Whether use composition start position for the result of
 // ITfContextView::GetTextExt() if the specified range is larger than
 // composition start offset.
 // For Free ChangJie 2010
 pref("intl.tsf.hack.free_chang_jie.do_not_return_no_layout_error", true);
 // For Microsoft Pinyin and Microsoft Wubi
 pref("intl.tsf.hack.ms_simplified_chinese.do_not_return_no_layout_error", true);
 // For Microsoft ChangJie and Microsoft Quick
deleted file mode 100644
--- a/mozglue/build/Authenticode.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifdef MOZ_MEMORY
-#define MOZ_MEMORY_IMPL
-#include "mozmemory_wrap.h"
-#define MALLOC_FUNCS MALLOC_FUNCS_MALLOC
-// See mozmemory_wrap.h for more details. This file is part of libmozglue, so
-// it needs to use _impl suffixes.
-#define MALLOC_DECL(name, return_type, ...) \
-  extern "C" MOZ_MEMORY_API return_type name ## _impl(__VA_ARGS__);
-#include "malloc_decls.h"
-#endif
-
-#include "Authenticode.h"
-
-#include "mozilla/ArrayUtils.h"
-#include "mozilla/TypeTraits.h"
-#include "mozilla/UniquePtr.h"
-
-#include <windows.h>
-#include <softpub.h>
-#include <wincrypt.h>
-#include <wintrust.h>
-
-namespace {
-
-struct CertStoreDeleter
-{
-  typedef HCERTSTORE pointer;
-  void operator()(pointer aStore)
-  {
-    ::CertCloseStore(aStore, 0);
-  }
-};
-
-struct CryptMsgDeleter
-{
-  typedef HCRYPTMSG pointer;
-  void operator()(pointer aMsg)
-  {
-    ::CryptMsgClose(aMsg);
-  }
-};
-
-struct CertContextDeleter
-{
-  void operator()(PCCERT_CONTEXT aCertContext)
-  {
-    ::CertFreeCertificateContext(aCertContext);
-  }
-};
-
-typedef mozilla::UniquePtr<HCERTSTORE, CertStoreDeleter> CertStoreUniquePtr;
-typedef mozilla::UniquePtr<HCRYPTMSG, CryptMsgDeleter> CryptMsgUniquePtr;
-typedef mozilla::UniquePtr<const CERT_CONTEXT, CertContextDeleter> CertContextUniquePtr;
-
-static const DWORD kEncodingTypes = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING;
-
-class SignedBinary
-{
-public:
-  explicit SignedBinary(const wchar_t* aFilePath);
-
-  explicit operator bool() const
-  {
-    return mCertStore && mCryptMsg && mCertCtx;
-  }
-
-  mozilla::UniquePtr<wchar_t[]> GetOrgName();
-
-  SignedBinary(const SignedBinary&) = delete;
-  SignedBinary(SignedBinary&&) = delete;
-  SignedBinary& operator=(const SignedBinary&) = delete;
-  SignedBinary& operator=(SignedBinary&&) = delete;
-
-private:
-  bool VerifySignature(const wchar_t* aFilePath);
-
-private:
-  CertStoreUniquePtr    mCertStore;
-  CryptMsgUniquePtr     mCryptMsg;
-  CertContextUniquePtr  mCertCtx;
-};
-
-SignedBinary::SignedBinary(const wchar_t* aFilePath)
-{
-  if (!VerifySignature(aFilePath)) {
-    return;
-  }
-
-  DWORD encodingType, contentType, formatType;
-  HCERTSTORE rawCertStore;
-  HCRYPTMSG rawCryptMsg;
-  BOOL result = CryptQueryObject(CERT_QUERY_OBJECT_FILE, aFilePath,
-                                 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED,
-                                 CERT_QUERY_FORMAT_FLAG_BINARY, 0,
-                                 &encodingType, &contentType, &formatType,
-                                 &rawCertStore, &rawCryptMsg, nullptr);
-  if (!result) {
-    return;
-  }
-
-  mCertStore.reset(rawCertStore);
-  mCryptMsg.reset(rawCryptMsg);
-
-  DWORD certInfoLen = 0;
-  BOOL ok = CryptMsgGetParam(mCryptMsg.get(), CMSG_SIGNER_CERT_INFO_PARAM, 0,
-                             nullptr, &certInfoLen);
-  if (!ok) {
-    return;
-  }
-
-  auto certInfoBuf = mozilla::MakeUnique<char[]>(certInfoLen);
-
-  ok = CryptMsgGetParam(mCryptMsg.get(), CMSG_SIGNER_CERT_INFO_PARAM, 0,
-                        certInfoBuf.get(), &certInfoLen);
-  if (!ok) {
-    return;
-  }
-
-  auto certInfo = reinterpret_cast<CERT_INFO*>(certInfoBuf.get());
-
-  PCCERT_CONTEXT certCtx = CertFindCertificateInStore(mCertStore.get(),
-                                                      kEncodingTypes, 0,
-                                                      CERT_FIND_SUBJECT_CERT,
-                                                      certInfo, nullptr);
-  if (!certCtx) {
-    return;
-  }
-
-  mCertCtx.reset(certCtx);
-}
-
-bool
-SignedBinary::VerifySignature(const wchar_t* aFilePath)
-{
-  WINTRUST_FILE_INFO fileInfo = {sizeof(fileInfo)};
-  fileInfo.pcwszFilePath = aFilePath;
-
-  WINTRUST_DATA trustData = {sizeof(trustData)};
-  trustData.dwUIChoice = WTD_UI_NONE;
-  trustData.fdwRevocationChecks = WTD_REVOKE_NONE;
-  trustData.dwUnionChoice = WTD_CHOICE_FILE;
-  trustData.pFile = &fileInfo;
-  trustData.dwStateAction = WTD_STATEACTION_VERIFY;
-
-  const HWND hwnd = (HWND) INVALID_HANDLE_VALUE;
-  GUID policyGUID = WINTRUST_ACTION_GENERIC_VERIFY_V2;
-  LONG result = WinVerifyTrust(hwnd, &policyGUID, &trustData);
-
-  trustData.dwStateAction = WTD_STATEACTION_CLOSE;
-  WinVerifyTrust(hwnd, &policyGUID, &trustData);
-
-  return result == ERROR_SUCCESS;
-}
-
-mozilla::UniquePtr<wchar_t[]>
-SignedBinary::GetOrgName()
-{
-  DWORD charCount = CertGetNameStringW(mCertCtx.get(),
-                                       CERT_NAME_SIMPLE_DISPLAY_TYPE, 0,
-                                       nullptr, nullptr, 0);
-  if (charCount <= 1) {
-    // Not found
-    return nullptr;
-  }
-
-  auto result = mozilla::MakeUnique<wchar_t[]>(charCount);
-  charCount = CertGetNameStringW(mCertCtx.get(), CERT_NAME_SIMPLE_DISPLAY_TYPE,
-                                 0, nullptr, result.get(), charCount);
-  MOZ_ASSERT(charCount > 1);
-
-  return result;
-}
-
-} // anonymous namespace
-
-namespace mozilla {
-
-class AuthenticodeImpl : public Authenticode
-{
-public:
-  virtual UniquePtr<wchar_t[]> GetBinaryOrgName(const wchar_t* aFilePath) override;
-};
-
-UniquePtr<wchar_t[]>
-AuthenticodeImpl::GetBinaryOrgName(const wchar_t* aFilePath)
-{
-  SignedBinary bin(aFilePath);
-  if (!bin) {
-    return nullptr;
-  }
-
-  return bin.GetOrgName();
-}
-
-static AuthenticodeImpl sAuthenticodeImpl;
-
-Authenticode*
-GetAuthenticode()
-{
-  return &sAuthenticodeImpl;
-}
-
-} // namespace mozilla
-
deleted file mode 100644
--- a/mozglue/build/Authenticode.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_Authenticode_h
-#define mozilla_Authenticode_h
-
-#include "mozilla/Maybe.h"
-#include "mozilla/UniquePtr.h"
-
-namespace mozilla {
-
-class Authenticode
-{
-public:
-  virtual UniquePtr<wchar_t[]> GetBinaryOrgName(const wchar_t* aFilePath) = 0;
-};
-
-} // namespace mozilla
-
-#endif // mozilla_Authenticode_h
-
--- a/mozglue/build/WindowsDllBlocklist.cpp
+++ b/mozglue/build/WindowsDllBlocklist.cpp
@@ -18,27 +18,27 @@
 #include <winternl.h>
 #include <io.h>
 
 #pragma warning( push )
 #pragma warning( disable : 4275 4530 ) // See msvc-stl-wrapper.template.h
 #include <map>
 #pragma warning( pop )
 
-#include "Authenticode.h"
 #include "nsAutoPtr.h"
+
 #include "nsWindowsDllInterceptor.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/StackWalk_windows.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/WindowsVersion.h"
 #include "nsWindowsHelpers.h"
 #include "WindowsDllBlocklist.h"
 #include "mozilla/AutoProfilerLabel.h"
-#include "mozilla/glue/WindowsDllServices.h"
+#include "mozilla/WindowsDllServices.h"
 
 using namespace mozilla;
 
 #define ALL_VERSIONS   ((unsigned long long)-1LL)
 
 // DLLs sometimes ship without a version number, particularly early
 // releases. Blocking "version <= 0" has the effect of blocking unversioned
 // DLLs (since the call to get version info fails), but not blocking
@@ -933,17 +933,17 @@ DllBlocklist_CheckStatus()
 }
 
 // ============================================================================
 // This section is for DLL Services
 // ============================================================================
 
 
 static SRWLOCK gDllServicesLock = SRWLOCK_INIT;
-static mozilla::glue::detail::DllServicesBase* gDllServices;
+static mozilla::detail::DllServicesBase* gDllServices;
 
 class MOZ_RAII AutoSharedLock final
 {
 public:
   explicit AutoSharedLock(SRWLOCK& aLock)
     : mLock(aLock)
   {
     ::AcquireSRWLockShared(&aLock);
@@ -1042,37 +1042,29 @@ DllLoadNotification(ULONG aReason, PCLDR
   if (!gDllServices) {
     return;
   }
 
   PCUNICODE_STRING fullDllName = aNotificationData->Loaded.FullDllName;
   gDllServices->DispatchDllLoadNotification(fullDllName);
 }
 
-namespace mozilla {
-Authenticode* GetAuthenticode();
-} // namespace mozilla
-
 MFBT_API void
-DllBlocklist_SetDllServices(mozilla::glue::detail::DllServicesBase* aSvc)
+DllBlocklist_SetDllServices(mozilla::detail::DllServicesBase* aSvc)
 {
   AutoExclusiveLock lock(gDllServicesLock);
 
-  if (aSvc) {
-    aSvc->SetAuthenticodeImpl(GetAuthenticode());
+  if (aSvc && !gNotificationCookie) {
+    auto pLdrRegisterDllNotification =
+      reinterpret_cast<decltype(&::LdrRegisterDllNotification)>(
+        ::GetProcAddress(::GetModuleHandleW(L"ntdll.dll"),
+                         "LdrRegisterDllNotification"));
 
-    if (!gNotificationCookie) {
-      auto pLdrRegisterDllNotification =
-        reinterpret_cast<decltype(&::LdrRegisterDllNotification)>(
-          ::GetProcAddress(::GetModuleHandleW(L"ntdll.dll"),
-                           "LdrRegisterDllNotification"));
+    MOZ_DIAGNOSTIC_ASSERT(pLdrRegisterDllNotification);
 
-      MOZ_DIAGNOSTIC_ASSERT(pLdrRegisterDllNotification);
-
-      NTSTATUS ntStatus = pLdrRegisterDllNotification(0, &DllLoadNotification,
-                                                      nullptr, &gNotificationCookie);
-      MOZ_DIAGNOSTIC_ASSERT(NT_SUCCESS(ntStatus));
-    }
+    NTSTATUS ntStatus = pLdrRegisterDllNotification(0, &DllLoadNotification,
+                                                    nullptr, &gNotificationCookie);
+    MOZ_DIAGNOSTIC_ASSERT(NT_SUCCESS(ntStatus));
   }
 
   gDllServices = aSvc;
 }
 
--- a/mozglue/build/WindowsDllBlocklist.h
+++ b/mozglue/build/WindowsDllBlocklist.h
@@ -21,19 +21,17 @@ enum DllBlocklistInitFlags
 };
 
 MFBT_API void DllBlocklist_Initialize(uint32_t aInitFlags = eDllBlocklistInitFlagDefault);
 MFBT_API void DllBlocklist_WriteNotes(HANDLE file);
 MFBT_API bool DllBlocklist_CheckStatus();
 
 // Forward declaration
 namespace mozilla {
-namespace glue {
 namespace detail {
 class DllServicesBase;
 } // namespace detail
-} // namespace glue
 } // namespace mozilla
 
-MFBT_API void DllBlocklist_SetDllServices(mozilla::glue::detail::DllServicesBase* aSvc);
+MFBT_API void DllBlocklist_SetDllServices(mozilla::detail::DllServicesBase* aSvc);
 
 #endif // defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
 #endif // mozilla_windowsdllblocklist_h
--- a/mozglue/build/WindowsDllServices.h
+++ b/mozglue/build/WindowsDllServices.h
@@ -1,86 +1,63 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
-#ifndef mozilla_glue_WindowsDllServices_h
-#define mozilla_glue_WindowsDllServices_h
+#ifndef mozilla_WindowsDllServices_h
+#define mozilla_WindowsDllServices_h
 
-#include "mozilla/Authenticode.h"
 #include "mozilla/WindowsDllBlocklist.h"
 
 #if defined(MOZILLA_INTERNAL_API)
 
 #include "mozilla/SystemGroup.h"
 #include "nsISupportsImpl.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 
 #endif // defined(MOZILLA_INTERNAL_API)
 
 // For PCUNICODE_STRING
 #include <winternl.h>
 
 namespace mozilla {
-namespace glue {
 namespace detail {
 
-class DllServicesBase : public Authenticode
+class DllServicesBase
 {
 public:
   /**
    * WARNING: This method is called from within an unsafe context that holds
    *          multiple locks inside the Windows loader. The only thing that
    *          this function should be used for is dispatching the event to our
    *          event loop so that it may be handled in a safe context.
    */
   virtual void DispatchDllLoadNotification(PCUNICODE_STRING aDllName) = 0;
 
-  void SetAuthenticodeImpl(Authenticode* aAuthenticode)
-  {
-    mAuthenticode = aAuthenticode;
-  }
-
-  virtual UniquePtr<wchar_t[]> GetBinaryOrgName(const wchar_t* aFilePath) override final
-  {
-    if (!mAuthenticode) {
-      return nullptr;
-    }
-
-    return mAuthenticode->GetBinaryOrgName(aFilePath);
-  }
-
   void Disable()
   {
     DllBlocklist_SetDllServices(nullptr);
   }
 
   DllServicesBase(const DllServicesBase&) = delete;
   DllServicesBase(DllServicesBase&&) = delete;
   DllServicesBase& operator=(const DllServicesBase&) = delete;
   DllServicesBase& operator=(DllServicesBase&&) = delete;
 
 protected:
-  DllServicesBase()
-    : mAuthenticode(nullptr)
-  {
-  }
-
+  DllServicesBase() = default;
   virtual ~DllServicesBase() = default;
 
   void Enable()
   {
     DllBlocklist_SetDllServices(this);
   }
-
-private:
-  Authenticode* mAuthenticode;
 };
 
 } // namespace detail
 
 #if defined(MOZILLA_INTERNAL_API)
 
 class DllServices : public detail::DllServicesBase
 {
@@ -104,12 +81,11 @@ protected:
   DllServices() = default;
   ~DllServices() = default;
 
   virtual void NotifyDllLoad(const bool aIsMainThread, const nsString& aDllName) = 0;
 };
 
 #endif // defined(MOZILLA_INTERNAL_API)
 
-} // namespace glue
 } // namespace mozilla
 
-#endif // mozilla_glue_WindowsDllServices_h
+#endif // mozilla_WindowsDllServices_h
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -51,39 +51,31 @@ if CONFIG['MOZ_WIDGET_TOOLKIT']:
     if CONFIG['OS_TARGET'] == 'WINNT':
         LOCAL_INCLUDES += [
             '/memory/build',
         ]
 
         if CONFIG['CC_TYPE'] == "msvc":
             SOURCES += ['WindowsCFGStatus.cpp']
         SOURCES += [
-            'Authenticode.cpp',
             'WindowsDllBlocklist.cpp',
         ]
 
         DisableStlWrapping()
         OS_LIBS += [
-            'crypt32',
             'version',
-            'wintrust',
-        ]
-        EXPORTS.mozilla += [
-            'Authenticode.h',
-            'WindowsDllBlocklist.h',
-        ]
-        EXPORTS.mozilla.glue += [
-            'WindowsDllServices.h',
         ]
 
     EXPORTS.mozilla += [
         'arm.h',
         'mips.h',
         'SSE.h',
         'WindowsCFGStatus.h',
+        'WindowsDllBlocklist.h',
+        'WindowsDllServices.h',
     ]
 
     if CONFIG['CPU_ARCH'].startswith('x86'):
         SOURCES += [
             'SSE.cpp',
         ]
 
     if CONFIG['CPU_ARCH'] == 'arm':
--- a/testing/marionette/doc/api/element.js.html
+++ b/testing/marionette/doc/api/element.js.html
@@ -48,20 +48,19 @@ this.EXPORTED_SYMBOLS = [
   "ChromeWebElement",
   "ContentWebElement",
   "ContentWebFrame",
   "ContentWebWindow",
   "element",
   "WebElement",
 ];
 
-const {
-  FIRST_ORDERED_NODE_TYPE,
-  ORDERED_NODE_ITERATOR_TYPE,
-} = Ci.nsIDOMXPathResult;
+const ORDERED_NODE_ITERATOR_TYPE = 5;
+const FIRST_ORDERED_NODE_TYPE = 9;
+
 const ELEMENT_NODE = 1;
 const DOCUMENT_NODE = 9;
 
 const XBLNS = "http://www.mozilla.org/xbl";
 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 /** XUL elements that support checked property. */
 const XUL_CHECKED_ELS = new Set([
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -20,20 +20,19 @@ this.EXPORTED_SYMBOLS = [
   "ChromeWebElement",
   "ContentWebElement",
   "ContentWebFrame",
   "ContentWebWindow",
   "element",
   "WebElement",
 ];
 
-const {
-  FIRST_ORDERED_NODE_TYPE,
-  ORDERED_NODE_ITERATOR_TYPE,
-} = Ci.nsIDOMXPathResult;
+const ORDERED_NODE_ITERATOR_TYPE = 5;
+const FIRST_ORDERED_NODE_TYPE = 9;
+
 const ELEMENT_NODE = 1;
 const DOCUMENT_NODE = 9;
 
 const XBLNS = "http://www.mozilla.org/xbl";
 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 /** XUL elements that support checked property. */
 const XUL_CHECKED_ELS = new Set([
deleted file mode 100644
--- a/toolkit/crashreporter/CertAnnotator.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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 https://mozilla.org/MPL/2.0/. */
-
-#include "CertAnnotator.h"
-
-#include "mozilla/JSONWriter.h"
-#include "mozilla/StaticPtr.h"
-#include "mozilla/Services.h"
-#include "mozilla/WinDllServices.h"
-#include "nsExceptionHandler.h"
-#include "nsIFile.h"
-#include "nsIObserverService.h"
-#include "nsReadableUtils.h"
-#include "nsString.h"
-#include "nsThreadUtils.h"
-#include "nsXPCOM.h"
-#include "nsXULAppAPI.h"
-#include "nsWindowsHelpers.h"
-
-#include <tlhelp32.h>
-
-namespace mozilla {
-
-NS_IMPL_ISUPPORTS(CertAnnotator, nsIObserver)
-
-CertAnnotator::~CertAnnotator()
-{
-  if (mAnnotatorThread) {
-    mAnnotatorThread->Shutdown();
-  }
-}
-
-bool
-CertAnnotator::Init()
-{
-  if (mAnnotatorThread) {
-    return true;
-  }
-
-  nsCOMPtr<nsIRunnable> initialEvent =
-    NewRunnableMethod("mozilla::CertAnnotator::RecordInitialCertInfo", this,
-                      &CertAnnotator::RecordInitialCertInfo);
-
-  nsresult rv = NS_NewNamedThread("Cert Annotator",
-                                  getter_AddRefs(mAnnotatorThread),
-                                  initialEvent);
-  return NS_SUCCEEDED(rv);
-}
-
-NS_IMETHODIMP
-CertAnnotator::Observe(nsISupports* aSubject, const char* aTopic,
-                       const char16_t* aData)
-{
-  MOZ_ASSERT(!strcmp(aTopic, DllServices::kTopicDllLoadedMainThread) ||
-             !strcmp(aTopic, DllServices::kTopicDllLoadedNonMainThread));
-  MOZ_ASSERT(mAnnotatorThread);
-
-  if (!mAnnotatorThread) {
-    return NS_OK;
-  }
-
-  nsCOMPtr<nsIRunnable> event =
-    NewRunnableMethod<nsString, bool>("mozilla::CertAnnotator::RecordCertInfo",
-                                      this, &CertAnnotator::RecordCertInfo,
-                                      aData, true);
-
-  mAnnotatorThread->Dispatch(event, NS_DISPATCH_NORMAL);
-
-  return NS_OK;
-}
-
-void
-CertAnnotator::RecordInitialCertInfo()
-{
-  MOZ_ASSERT(!NS_IsMainThread());
-
-  nsAutoHandle snapshot(::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0));
-  MOZ_ASSERT(snapshot != INVALID_HANDLE_VALUE);
-  if (snapshot == INVALID_HANDLE_VALUE) {
-    return;
-  }
-
-  MODULEENTRY32W moduleEntry = { sizeof(moduleEntry) };
-
-  if (!::Module32FirstW(snapshot, &moduleEntry)) {
-    return;
-  }
-
-  do {
-    RecordCertInfo(nsDependentString(moduleEntry.szExePath), false);
-  } while(::Module32NextW(snapshot, &moduleEntry));
-
-  Serialize();
-}
-
-void
-CertAnnotator::RecordCertInfo(const nsAString& aLibPath, const bool aDoSerialize)
-{
-  MOZ_ASSERT(!NS_IsMainThread());
-
-  // (1) Get Lowercase Module Name
-  nsCOMPtr<nsIFile> file;
-  nsresult rv = NS_NewLocalFile(aLibPath, false, getter_AddRefs(file));
-  if (NS_FAILED(rv)) {
-    return;
-  }
-
-  nsAutoString key;
-  rv = file->GetLeafName(key);
-  if (NS_FAILED(rv)) {
-    return;
-  }
-
-  ToLowerCase(key);
-
-  // (2) Get cert subject info
-  auto flatLibPath = PromiseFlatString(aLibPath);
-
-  RefPtr<mozilla::DllServices> dllSvc(mozilla::DllServices::Get());
-  auto orgName = dllSvc->GetBinaryOrgName(flatLibPath.get());
-  if (!orgName) {
-    return;
-  }
-
-  // (3) Insert into hash table
-  auto& modulesForThisSubject = mCertTable.GetOrInsert(nsString(orgName.get()));
-
-  if (modulesForThisSubject.ContainsSorted(key)) {
-    return;
-  }
-
-  modulesForThisSubject.InsertElementSorted(Move(key));
-
-  if (!aDoSerialize) {
-    return;
-  }
-
-  // (4) Serialize and annotate
-  Serialize();
-}
-
-} // namespace mozilla
-
-namespace {
-
-class Writer final : public mozilla::JSONWriteFunc
-{
-public:
-  virtual void Write(const char* aStr) override
-  {
-    mStr += aStr;
-  }
-
-  const nsCString& Get() const
-  {
-    return mStr;
-  }
-
-private:
-  nsCString mStr;
-};
-
-} // anonymous namespace
-
-namespace mozilla {
-
-void
-CertAnnotator::Serialize()
-{
-  MOZ_ASSERT(!NS_IsMainThread());
-
-  JSONWriter json(MakeUnique<Writer>());
-
-#if defined(DEBUG)
-  const JSONWriter::CollectionStyle style = JSONWriter::MultiLineStyle;
-#else
-  const JSONWriter::CollectionStyle style = JSONWriter::SingleLineStyle;
-#endif
-
-  json.Start(style);
-
-  for (auto subjectItr = mCertTable.Iter(); !subjectItr.Done(); subjectItr.Next()) {
-    json.StartArrayProperty(NS_ConvertUTF16toUTF8(subjectItr.Key()).get());
-    auto& modules = subjectItr.Data();
-    for (auto&& module : modules) {
-      json.StringElement(NS_ConvertUTF16toUTF8(module).get());
-    }
-    json.EndArray();
-  }
-
-  json.End();
-
-  const nsCString& serialized = static_cast<Writer*>(json.WriteFunc())->Get();
-
-  if (XRE_IsParentProcess()) {
-    // Safe to do off main thread in the parent process
-    Annotate(serialized);
-    return;
-  }
-
-  nsCOMPtr<nsIRunnable> event =
-    NewRunnableMethod<nsCString>("mozilla::CertAnnotator::Annotate", this,
-                                 &CertAnnotator::Annotate, serialized);
-  NS_DispatchToMainThread(event);
-}
-
-void
-CertAnnotator::Annotate(const nsCString& aAnnotation)
-{
-  nsAutoCString annotationKey;
-  annotationKey.AppendLiteral("ModuleSignatureInfo");
-  if (XRE_IsParentProcess()) {
-    annotationKey.AppendLiteral("Parent");
-  } else {
-    MOZ_ASSERT(NS_IsMainThread());
-    annotationKey.AppendLiteral("Child");
-  }
-
-  CrashReporter::AnnotateCrashReport(annotationKey, aAnnotation);
-}
-
-void
-CertAnnotator::Register()
-{
-  RefPtr<CertAnnotator> annotator(new CertAnnotator());
-  if (!annotator->Init()) {
-    return;
-  }
-
-  nsCOMPtr<nsIObserverService> obsServ(services::GetObserverService());
-  obsServ->AddObserver(annotator, DllServices::kTopicDllLoadedMainThread,
-                       false);
-  obsServ->AddObserver(annotator, DllServices::kTopicDllLoadedNonMainThread,
-                       false);
-}
-
-} // namespace mozilla
deleted file mode 100644
--- a/toolkit/crashreporter/CertAnnotator.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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 https://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_CertAnnotator_h
-#define mozilla_CertAnnotator_h
-
-#include "mozilla/Move.h"
-#include "mozilla/Mutex.h"
-#include "nsDataHashtable.h"
-#include "nsIObserver.h"
-#include "nsIThread.h"
-#include "nsString.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-
-class CertAnnotator final : public nsIObserver
-{
-public:
-  NS_DECL_THREADSAFE_ISUPPORTS
-  NS_DECL_NSIOBSERVER
-
-  static void Register();
-
-private:
-  CertAnnotator() = default;
-  virtual ~CertAnnotator();
-
-  bool Init();
-
-  void RecordInitialCertInfo();
-  void RecordCertInfo(const nsAString& aLibPath, const bool aDoSerialize);
-
-  void Serialize();
-  void Annotate(const nsCString& aAnnotation);
-
-  nsDataHashtable<nsStringHashKey, nsTArray<nsString>> mCertTable;
-  nsCOMPtr<nsIThread> mAnnotatorThread;
-};
-
-} // namespace mozilla
-
-#endif // mozilla_CertAnnotator_h
-
--- a/toolkit/crashreporter/moz.build
+++ b/toolkit/crashreporter/moz.build
@@ -30,23 +30,16 @@ if CONFIG['MOZ_CRASHREPORTER']:
         ]
 
         if CONFIG['MSVC_HAS_DIA_SDK']:
             DIRS += ['google-breakpad/src/tools/windows/dump_syms']
 
         if CONFIG['MOZ_CRASHREPORTER_INJECTOR']:
             DIRS += ['breakpad-windows-standalone']
 
-        UNIFIED_SOURCES += [
-            'CertAnnotator.cpp',
-        ]
-        EXPORTS.mozilla += [
-            'CertAnnotator.h',
-        ]
-
     elif CONFIG['OS_ARCH'] == 'Darwin':
         DIRS += [
             'breakpad-client',
             'breakpad-client/mac/crash_generation',
             'breakpad-client/mac/handler',
             'google-breakpad/src/common',
             'google-breakpad/src/common/mac',
             'google-breakpad/src/processor',
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -37,17 +37,16 @@
 #include "breakpad-client/windows/crash_generation/client_info.h"
 #include "breakpad-client/windows/crash_generation/crash_generation_server.h"
 #include "breakpad-client/windows/handler/exception_handler.h"
 #include <dbghelp.h>
 #include <string.h>
 #include "nsDirectoryServiceUtils.h"
 
 #include "nsWindowsDllInterceptor.h"
-#include "mozilla/WindowsDllBlocklist.h"
 #include "mozilla/WindowsVersion.h"
 #elif defined(XP_MACOSX)
 #include "breakpad-client/mac/crash_generation/client_info.h"
 #include "breakpad-client/mac/crash_generation/crash_generation_server.h"
 #include "breakpad-client/mac/handler/exception_handler.h"
 #include <string>
 #include <Carbon/Carbon.h>
 #include <CoreFoundation/CoreFoundation.h>
@@ -87,16 +86,17 @@ using mozilla::InjectCrashRunnable;
 #include "nsDebug.h"
 #include "nsCRT.h"
 #include "nsIFile.h"
 #include <map>
 #include <vector>
 
 #include "mozilla/IOInterposer.h"
 #include "mozilla/mozalloc_oom.h"
+#include "mozilla/WindowsDllBlocklist.h"
 
 #if defined(XP_MACOSX)
 CFStringRef reporterClientAppID = CFSTR("org.mozilla.crashreporter");
 #endif
 #if defined(MOZ_WIDGET_ANDROID)
 #include "common/linux/file_id.h"
 #endif
 
--- a/toolkit/modules/ClientID.jsm
+++ b/toolkit/modules/ClientID.jsm
@@ -38,18 +38,17 @@ const PREF_CACHED_CLIENTID = "toolkit.te
 function isValidClientID(id) {
   const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
   return UUID_REGEX.test(id);
 }
 
 this.ClientID = Object.freeze({
   /**
    * This returns a promise resolving to the the stable client ID we use for
-   * data reporting (FHR & Telemetry). Previously exising FHR client IDs are
-   * migrated to this.
+   * data reporting (FHR & Telemetry).
    *
    * WARNING: This functionality is duplicated for Android (see GeckoProfile.getClientId
    * for more). There are Java tests (TestGeckoProfile) to ensure the functionality is
    * consistent and Gecko tests to come (bug 1249156). However, THIS IS NOT FOOLPROOF.
    * Be careful when changing this code and, in particular, the underlying file format.
    *
    * @return {Promise<string>} The stable client ID.
    */
@@ -89,45 +88,32 @@ var ClientIDImpl = {
     }
 
     this._loadClientIdTask = this._doLoadClientID();
     let clear = () => this._loadClientIdTask = null;
     this._loadClientIdTask.then(clear, clear);
     return this._loadClientIdTask;
   },
 
+  /**
+   * Load the Client ID from the DataReporting Service state file.
+   * If no Client ID is found, we generate a new one.
+   */
   async _doLoadClientID() {
-    // As we want to correlate FHR and telemetry data (and move towards unifying the two),
-    // we first moved the ID management from the FHR implementation to the datareporting
-    // service, then to a common shared module.
-    // Consequently, we try to import an existing FHR ID, so we can keep using it.
-
-    // Try to load the client id from the DRS state file first.
+    // Try to load the client id from the DRS state file.
     try {
       let state = await CommonUtils.readJSON(gStateFilePath);
       if (state && this.updateClientID(state.clientID)) {
         return this._clientID;
       }
     } catch (e) {
       // fall through to next option
     }
 
-    // If we dont have DRS state yet, try to import from the FHR state.
-    try {
-      let fhrStatePath = OS.Path.join(OS.Constants.Path.profileDir, "healthreport", "state.json");
-      let state = await CommonUtils.readJSON(fhrStatePath);
-      if (state && this.updateClientID(state.clientID)) {
-        this._saveClientID();
-        return this._clientID;
-      }
-    } catch (e) {
-      // fall through to next option
-    }
-
-    // We dont have an id from FHR yet, generate a new ID.
+    // We dont have an id from the DRS state file yet, generate a new ID.
     this.updateClientID(CommonUtils.generateUUID());
     this._saveClientIdTask = this._saveClientID();
 
     // Wait on persisting the id. Otherwise failure to save the ID would result in
     // the client creating and subsequently sending multiple IDs to the server.
     // This would appear as multiple clients submitting similar data, which would
     // result in orphaning.
     await this._saveClientIdTask;
@@ -144,18 +130,17 @@ var ClientIDImpl = {
     let obj = { clientID: this._clientID };
     await OS.File.makeDir(gDatareportingPath);
     await CommonUtils.writeJSON(obj, gStateFilePath);
     this._saveClientIdTask = null;
   },
 
   /**
    * This returns a promise resolving to the the stable client ID we use for
-   * data reporting (FHR & Telemetry). Previously exising FHR client IDs are
-   * migrated to this.
+   * data reporting (FHR & Telemetry).
    *
    * @return {Promise<string>} The stable client ID.
    */
   getClientID() {
     if (!this._clientID) {
       return this._loadClientID();
     }
 
--- a/toolkit/modules/sessionstore/FormData.jsm
+++ b/toolkit/modules/sessionstore/FormData.jsm
@@ -115,17 +115,17 @@ var FormDataInternal = {
     "xhtml": "http://www.w3.org/1999/xhtml",
     "xul": "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   },
 
   /**
    * Resolves an XPath query generated by node.generateXPath.
    */
   resolve(aDocument, aQuery) {
-    let xptype = Components.interfaces.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE;
+    let xptype = aDocument.defaultView.XPathResult.FIRST_ORDERED_NODE_TYPE;
     return aDocument.evaluate(aQuery, aDocument, this.resolveNS.bind(this), xptype, null).singleNodeValue;
   },
 
   /**
    * Namespace resolver for the above XPath resolver.
    */
   resolveNS(aPrefix) {
     return this.namespaceURIs[aPrefix] || null;
@@ -168,17 +168,17 @@ var FormDataInternal = {
    * @return object
    *         Form data encoded in an object.
    */
   collect({document: doc}) {
     let formNodes = doc.evaluate(
       this.restorableFormNodesXPath,
       doc,
       this.resolveNS.bind(this),
-      Ci.nsIDOMXPathResult.UNORDERED_NODE_ITERATOR_TYPE, null
+      doc.defaultView.XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null
     );
 
     let node;
     let ret = {};
 
     // Limit the number of XPath expressions for performance reasons. See
     // bug 477564.
     const MAX_TRAVERSED_XPATHS = 100;
--- a/toolkit/modules/tests/xpcshell/test_client_id.js
+++ b/toolkit/modules/tests/xpcshell/test_client_id.js
@@ -10,81 +10,43 @@ ChromeUtils.import("resource://gre/modul
 
 function run_test() {
   do_get_profile();
   run_next_test();
 }
 
 add_task(async function() {
   const drsPath = OS.Path.join(OS.Constants.Path.profileDir, "datareporting", "state.json");
-  const fhrDir  = OS.Path.join(OS.Constants.Path.profileDir, "healthreport");
-  const fhrPath = OS.Path.join(fhrDir, "state.json");
   const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
   const invalidIDs = [
     [-1, "setIntPref"],
     [0.5, "setIntPref"],
     ["INVALID-UUID", "setStringPref"],
     [true, "setBoolPref"],
     ["", "setStringPref"],
     ["3d1e1560-682a-4043-8cf2-aaaaaaaaaaaZ", "setStringPref"],
   ];
   const PREF_CACHED_CLIENTID = "toolkit.telemetry.cachedClientID";
 
-  await OS.File.makeDir(fhrDir);
-
-  // Check that we are importing the FHR client ID.
-  let clientID = CommonUtils.generateUUID();
-  await CommonUtils.writeJSON({clientID}, fhrPath);
-  Assert.equal(clientID, await ClientID.getClientID());
-
-  // We should persist the ID in DRS now and not pick up a differing ID from FHR.
+  // If there is no DRS file, we should get a new client ID.
   await ClientID._reset();
-  await CommonUtils.writeJSON({clientID: CommonUtils.generateUUID()}, fhrPath);
-  Assert.equal(clientID, await ClientID.getClientID());
-
-  // We should be guarded against broken FHR data.
-  for (let invalidID of invalidIDs) {
-    await ClientID._reset();
-    await OS.File.remove(drsPath);
-    await CommonUtils.writeJSON({clientID: invalidID}, fhrPath);
-    clientID = await ClientID.getClientID();
-    Assert.equal(typeof(clientID), "string");
-    Assert.ok(uuidRegex.test(clientID));
-  }
-
-  // We should be guarded against invalid FHR json.
-  await ClientID._reset();
-  await OS.File.remove(drsPath);
-  await OS.File.writeAtomic(fhrPath, "abcd", {encoding: "utf-8", tmpPath: fhrPath + ".tmp"});
-  clientID = await ClientID.getClientID();
+  let clientID = await ClientID.getClientID();
   Assert.equal(typeof(clientID), "string");
   Assert.ok(uuidRegex.test(clientID));
 
-  // We should be guarded against broken DRS data too and fall back to loading
-  // the FHR ID.
-  for (let invalidID of invalidIDs) {
-    await ClientID._reset();
-    clientID = CommonUtils.generateUUID();
-    await CommonUtils.writeJSON({clientID}, fhrPath);
-    await CommonUtils.writeJSON({clientID: invalidID}, drsPath);
-    Assert.equal(clientID, await ClientID.getClientID());
-  }
-
-  // We should be guarded against invalid DRS json too.
+  // We should be guarded against invalid DRS json.
   await ClientID._reset();
-  await OS.File.remove(fhrPath);
   await OS.File.writeAtomic(drsPath, "abcd", {encoding: "utf-8", tmpPath: drsPath + ".tmp"});
   clientID = await ClientID.getClientID();
   Assert.equal(typeof(clientID), "string");
   Assert.ok(uuidRegex.test(clientID));
 
-  // If both the FHR and DSR data are broken, we should end up with a new client ID.
+  // If the DRS data is broken, we should end up with a new client ID.
   for (let [invalidID, ] of invalidIDs) {
     await ClientID._reset();
-    await CommonUtils.writeJSON({clientID: invalidID}, fhrPath);
     await CommonUtils.writeJSON({clientID: invalidID}, drsPath);
     clientID = await ClientID.getClientID();
     Assert.equal(typeof(clientID), "string");
     Assert.ok(uuidRegex.test(clientID));
   }
 
   // Assure that cached IDs are being checked for validity.
   for (let [invalidID, prefFunc] of invalidIDs) {
deleted file mode 100644
--- a/toolkit/xre/WinDllServices.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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 https://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/WinDllServices.h"
-
-#include "mozilla/ClearOnShutdown.h"
-#include "mozilla/Services.h"
-#include "nsIObserverService.h"
-#include "nsString.h"
-
-namespace mozilla {
-
-const char* DllServices::kTopicDllLoadedMainThread = "dll-loaded-main-thread";
-const char* DllServices::kTopicDllLoadedNonMainThread = "dll-loaded-non-main-thread";
-
-static StaticRefPtr<DllServices> sInstance;
-
-DllServices*
-DllServices::Get()
-{
-  if (sInstance) {
-    return sInstance;
-  }
-
-  sInstance = new DllServices();
-  ClearOnShutdown(&sInstance);
-  return sInstance;
-}
-
-DllServices::DllServices()
-{
-  Enable();
-}
-
-void
-DllServices::NotifyDllLoad(const bool aIsMainThread, const nsString& aDllName)
-{
-  const char* topic;
-
-  if (aIsMainThread) {
-    topic = kTopicDllLoadedMainThread;
-  } else {
-    topic = kTopicDllLoadedNonMainThread;
-  }
-
-  nsCOMPtr<nsIObserverService> obsServ(mozilla::services::GetObserverService());
-  obsServ->NotifyObservers(nullptr, topic, aDllName.get());
-}
-
-} // namespace mozilla
-
deleted file mode 100644
--- a/toolkit/xre/WinDllServices.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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 https://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_WinDllServices_h
-#define mozilla_WinDllServices_h
-
-#include "mozilla/glue/WindowsDllServices.h"
-
-namespace mozilla {
-
-class DllServices : public mozilla::glue::DllServices
-{
-public:
-  static DllServices* Get();
-
-  static const char* kTopicDllLoadedMainThread;
-  static const char* kTopicDllLoadedNonMainThread;
-
-private:
-  DllServices();
-  ~DllServices() = default;
-
-  void NotifyDllLoad(const bool aIsMainThread, const nsString& aDllName) override;
-};
-
-} // namespace mozilla
-
-#endif // mozilla_WinDllServices_h
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -31,25 +31,21 @@ EXPORTS += [
 ]
 
 EXPORTS.mozilla += ['AutoSQLiteLifetime.h', 'Bootstrap.h']
 
 if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
     EXPORTS += ['EventTracer.h']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
-    EXPORTS.mozilla += [
-        'WinDllServices.h',
-    ]
     SOURCES += [
         '../../other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp',
     ]
     UNIFIED_SOURCES += [
         'nsNativeAppSupportWin.cpp',
-        'WinDllServices.cpp',
     ]
     DEFINES['PROXY_PRINTING'] = 1
     LOCAL_INCLUDES += [
         '../../other-licenses/nsis/Contrib/CityHash/cityhash',
         '../components/printingui',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     UNIFIED_SOURCES += [
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -155,18 +155,17 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <pwd.h>
 #endif
 
 #ifdef XP_WIN
 #include <process.h>
 #include <shlobj.h>
-#include "mozilla/CertAnnotator.h"
-#include "mozilla/WinDllServices.h"
+#include "mozilla/WindowsDllServices.h"
 #include "nsThreadUtils.h"
 #include <comdef.h>
 #include <wbemidl.h>
 #include "WinUtils.h"
 #endif
 
 #ifdef XP_MACOSX
 #include "nsILocalFileMac.h"
@@ -1661,16 +1660,50 @@ ScopedXPCOMStartup::CreateAppSupport(nsI
   if (!gNativeAppSupport)
     return NS_ERROR_NOT_INITIALIZED;
 
   return gNativeAppSupport->QueryInterface(aIID, aResult);
 }
 
 nsINativeAppSupport* ScopedXPCOMStartup::gNativeAppSupport;
 
+#if defined(XP_WIN)
+
+class DllNotifications : public mozilla::DllServices
+{
+public:
+  DllNotifications()
+  {
+    Enable();
+  }
+
+private:
+  ~DllNotifications() = default;
+
+  void NotifyDllLoad(const bool aIsMainThread, const nsString& aDllName) override;
+};
+
+void
+DllNotifications::NotifyDllLoad(const bool aIsMainThread,
+                                const nsString& aDllName)
+{
+  const char* topic;
+
+  if (aIsMainThread) {
+    topic = "dll-loaded-main-thread";
+  } else {
+    topic = "dll-loaded-non-main-thread";
+  }
+
+  nsCOMPtr<nsIObserverService> obsServ(mozilla::services::GetObserverService());
+  obsServ->NotifyObservers(nullptr, topic, aDllName.get());
+}
+
+#endif // defined(XP_WIN)
+
 static void DumpArbitraryHelp()
 {
   nsresult rv;
 
   ScopedLogging log;
 
   {
     ScopedXPCOMStartup xpcom;
@@ -4306,22 +4339,20 @@ void AddSandboxAnnotations()
  */
 nsresult
 XREMain::XRE_mainRun()
 {
   nsresult rv = NS_OK;
   NS_ASSERTION(mScopedXPCOM, "Scoped xpcom not initialized.");
 
 #if defined(XP_WIN)
-  RefPtr<mozilla::DllServices> dllServices(mozilla::DllServices::Get());
-  auto dllServicesDisable = MakeScopeExit([&dllServices]() {
-    dllServices->Disable();
+  RefPtr<DllNotifications> dllNotifications(new DllNotifications());
+  auto dllNotificationsDisable = MakeScopeExit([&dllNotifications]() {
+    dllNotifications->Disable();
   });
-
-  mozilla::CertAnnotator::Register();
 #endif // defined(XP_WIN)
 
 #ifdef NS_FUNCTION_TIMER
   // initialize some common services, so we don't pay the cost for these at odd times later on;
   // SetWindowCreator -> ChromeRegistry -> IOService -> SocketTransportService -> (nspr wspm init), Prefs
   {
     nsCOMPtr<nsISupports> comp;
 
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -21,17 +21,16 @@
 #include "nsIFile.h"
 #include "nsIToolkitChromeRegistry.h"
 #include "nsIToolkitProfile.h"
 
 #ifdef XP_WIN
 #include <process.h>
 #include <shobjidl.h>
 #include "mozilla/ipc/WindowsMessageLoop.h"
-#include "mozilla/WindowsDllBlocklist.h"
 #endif
 
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsAppRunner.h"
 #include "nsAutoRef.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsExceptionHandler.h"
 #include "nsString.h"
@@ -69,16 +68,17 @@
 #include "mozilla/plugins/PluginProcessChild.h"
 #include "mozilla/dom/ContentProcess.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/ContentChild.h"
 
 #include "mozilla/ipc/TestShellParent.h"
 #include "mozilla/ipc/XPCShellEnvironment.h"
 #include "mozilla/Scheduler.h"
+#include "mozilla/WindowsDllBlocklist.h"
 
 #include "GMPProcessChild.h"
 #include "mozilla/gfx/GPUProcessImpl.h"
 
 #include "GeckoProfiler.h"
 
 #if defined(MOZ_SANDBOX) && defined(XP_WIN)
 #include "mozilla/sandboxTarget.h"
--- a/widget/gtk/mozgtk/mozgtk.c
+++ b/widget/gtk/mozgtk/mozgtk.c
@@ -474,17 +474,16 @@ STUB(gtk_widget_set_double_buffered)
 STUB(gtk_widget_set_has_window)
 STUB(gtk_widget_set_mapped)
 STUB(gtk_widget_set_name)
 STUB(gtk_widget_set_parent)
 STUB(gtk_widget_set_parent_window)
 STUB(gtk_widget_set_realized)
 STUB(gtk_widget_set_redraw_on_allocate)
 STUB(gtk_widget_set_sensitive)
-STUB(gtk_widget_set_valign)
 STUB(gtk_widget_set_window)
 STUB(gtk_widget_show)
 STUB(gtk_widget_show_all)
 STUB(gtk_widget_size_allocate)
 STUB(gtk_widget_style_get)
 STUB(gtk_widget_unparent)
 STUB(gtk_widget_unrealize)
 STUB(gtk_window_deiconify)
@@ -598,16 +597,17 @@ STUB(gtk_widget_get_state_flags)
 STUB(gtk_widget_get_style_context)
 STUB(gtk_widget_path_append_type)
 STUB(gtk_widget_path_copy)
 STUB(gtk_widget_path_free)
 STUB(gtk_widget_path_iter_add_class)
 STUB(gtk_widget_path_get_object_type)
 STUB(gtk_widget_path_new)
 STUB(gtk_widget_path_unref)
+STUB(gtk_widget_set_valign)
 STUB(gtk_widget_set_visual)
 STUB(gtk_app_chooser_dialog_new_for_content_type)
 STUB(gtk_app_chooser_get_type)
 STUB(gtk_app_chooser_get_app_info)
 STUB(gtk_app_chooser_dialog_get_type)
 STUB(gtk_app_chooser_dialog_set_heading)
 STUB(gtk_color_chooser_dialog_new)
 STUB(gtk_color_chooser_dialog_get_type)
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -1091,16 +1091,17 @@ public:
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsGoogleJapaneseInputActive)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsATOKActive)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsATOK2011Active)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsATOK2012Active)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsATOK2013Active)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsATOK2014Active)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsATOK2015Active)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsATOK2016Active)
+  DECL_AND_IMPL_IS_TIP_ACTIVE(IsJapanist10Active)
 
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsMSBopomofoActive)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsMSChangJieActive)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsMSPhoneticActive)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsMSQuickActive)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsMSNewChangJieActive)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsMSNewPhoneticActive)
   DECL_AND_IMPL_IS_TIP_ACTIVE(IsMSNewQuickActive)
@@ -1242,18 +1243,25 @@ private:
     return mActiveTIPGUID == kGUID;
   }
 
   // * ATOK 2017
   //   - {6DBFD8F5-701D-11E6-920F-782BCBA6348F}
   // * ATOK Passport (confirmed with version 31.1.2)
   //   - {A38F2FD9-7199-45E1-841C-BE0313D8052F}
 
-  // * Japanist 10
-  //   - {E6D66705-1EDA-4373-8D01-1D0CB2D054C7}
+  bool IsJapanist10ActiveInternal() const
+  {
+    // {E6D66705-1EDA-4373-8D01-1D0CB2D054C7}
+    static const GUID kGUID = {
+      0xE6D66705, 0x1EDA, 0x4373,
+        { 0x8D, 0x01, 0x1D, 0x0C, 0xB2, 0xD0, 0x54, 0xC7 }
+    };
+    return mActiveTIPGUID == kGUID;
+  }
 
   /****************************************************************************
    * Traditional Chinese TIP
    ****************************************************************************/
 
   bool IsMSBopomofoActiveInternal() const
   {
     // {B2F9C502-1742-11D4-9790-0080C882687E} (Win8.1, Win10)
@@ -1701,16 +1709,20 @@ public:
     ShouldSetInputScopeOfURLBarToDefault, true)
   DECL_AND_IMPL_BOOL_PREF(
     "intl.tsf.hack.atok.create_native_caret",
     NeedToCreateNativeCaretForLegacyATOK, true)
   DECL_AND_IMPL_BOOL_PREF(
     "intl.tsf.hack.atok.do_not_return_no_layout_error_of_composition_string",
     DoNotReturnNoLayoutErrorToATOKOfCompositionString, true)
   DECL_AND_IMPL_BOOL_PREF(
+    "intl.tsf.hack.japanist10."
+    "do_not_return_no_layout_error_of_composition_string",
+    DoNotReturnNoLayoutErrorToJapanist10OfCompositionString, true)
+  DECL_AND_IMPL_BOOL_PREF(
     "intl.tsf.hack.ms_simplified_chinese.do_not_return_no_layout_error",
     DoNotReturnNoLayoutErrorToMSSimplifiedTIP, true)
   DECL_AND_IMPL_BOOL_PREF(
     "intl.tsf.hack.ms_traditional_chinese.do_not_return_no_layout_error",
     DoNotReturnNoLayoutErrorToMSTraditionalTIP, true)
   DECL_AND_IMPL_BOOL_PREF(
     "intl.tsf.hack.free_chang_jie.do_not_return_no_layout_error",
     DoNotReturnNoLayoutErrorToFreeChangJie, true)
@@ -3355,17 +3367,17 @@ TSFTextStore::SetSelectionInternal(const
        "SelectionForTSFRef() failure", this));
     return E_FAIL;
   }
 
   // If actually the range is not changing, we should do nothing.
   // Perhaps, we can ignore the difference change because it must not be
   // important for following edit.
   if (selectionForTSF.EqualsExceptDirection(*pSelection)) {
-    MOZ_LOG(sTextStoreLog, LogLevel::Error,
+    MOZ_LOG(sTextStoreLog, LogLevel::Warning,
       ("0x%p   TSFTextStore::SetSelectionInternal() Succeeded but "
        "did nothing because the selection range isn't changing", this));
     selectionForTSF.SetSelection(*pSelection);
     return S_OK;
   }
 
   if (mComposition.IsComposing()) {
     if (aDispatchCompositionChangeEvent) {
@@ -4248,18 +4260,30 @@ TSFTextStore::GetTextExt(TsViewCookie vc
                          LONG acpStart,
                          LONG acpEnd,
                          RECT* prc,
                          BOOL* pfClipped)
 {
   MOZ_LOG(sTextStoreLog, LogLevel::Info,
     ("0x%p TSFTextStore::GetTextExt(vcView=%ld, "
      "acpStart=%ld, acpEnd=%ld, prc=0x%p, pfClipped=0x%p), "
+     "IsHandlingComposition()=%s, "
+     "mContentForTSF={ MinOffsetOfLayoutChanged()=%u, "
+     "LatestCompositionStartOffset()=%d, LatestCompositionEndOffset()=%d }, "
+     "mComposition= { IsComposing()=%s, mStart=%d, EndOffset()=%d }, "
      "mDeferNotifyingTSF=%s, mWaitingQueryLayout=%s",
      this, vcView, acpStart, acpEnd, prc, pfClipped,
+     GetBoolName(IsHandlingComposition()),
+     mContentForTSF.MinOffsetOfLayoutChanged(),
+     mContentForTSF.HasOrHadComposition() ?
+       mContentForTSF.LatestCompositionStartOffset() : -1,
+     mContentForTSF.HasOrHadComposition() ?
+       mContentForTSF.LatestCompositionEndOffset() : -1,
+     GetBoolName(mComposition.IsComposing()),
+     mComposition.mStart, mComposition.EndOffset(),
      GetBoolName(mDeferNotifyingTSF), GetBoolName(mWaitingQueryLayout)));
 
   if (!IsReadLocked()) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
       ("0x%p   TSFTextStore::GetTextExt() FAILED due to "
        "not locked (read)", this));
     return TS_E_NOLOCK;
   }
@@ -4273,16 +4297,26 @@ TSFTextStore::GetTextExt(TsViewCookie vc
 
   if (!prc || !pfClipped) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
       ("0x%p   TSFTextStore::GetTextExt() FAILED due to "
        "null argument", this));
     return E_INVALIDARG;
   }
 
+  // According to MSDN, ITextStoreACP::GetTextExt() should return
+  // TS_E_INVALIDARG when acpStart and acpEnd are same (i.e., collapsed range).
+  // https://msdn.microsoft.com/en-us/library/windows/desktop/ms538435(v=vs.85).aspx
+  // > TS_E_INVALIDARG: The specified start and end character positions are
+  // >                  equal.
+  // However, some TIPs (including Microsoft's Chinese TIPs!) call this with
+  // collapsed range and if we return TS_E_INVALIDARG, they stops showing their
+  // owning window or shows it but odd position.  So, we should just return
+  // error only when acpStart and/or acpEnd are really odd.
+
   if (acpStart < 0 || acpEnd < acpStart) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
       ("0x%p   TSFTextStore::GetTextExt() FAILED due to "
        "invalid position", this));
     return TS_E_INVALIDPOS;
   }
 
   mWaitingQueryLayout = false;
@@ -4373,16 +4407,29 @@ TSFTextStore::GetTextExt(TsViewCookie vc
     else if (TSFPrefs::DoNotReturnNoLayoutErrorToATOKOfCompositionString() &&
              TSFStaticSink::IsATOKActive() &&
              (!TSFStaticSink::IsATOKReferringNativeCaretActive() ||
               !TSFPrefs::NeedToCreateNativeCaretForLegacyATOK()) &&
              mContentForTSF.LatestCompositionStartOffset() == acpStart &&
              mContentForTSF.LatestCompositionEndOffset() == acpEnd) {
       dontReturnNoLayoutError = true;
     }
+    // Japanist 10 fails to handle TS_E_NOLAYOUT when it decides the position of
+    // candidate window.  In such case, Japanist shows candidate window at
+    // top-left of the screen.  So, we should return the nearest caret rect
+    // where we know.
+    else if (
+      TSFPrefs::DoNotReturnNoLayoutErrorToJapanist10OfCompositionString() &&
+      TSFStaticSink::IsJapanist10Active() &&
+      acpStart >= mContentForTSF.LatestCompositionStartOffset() &&
+      acpStart <= mContentForTSF.LatestCompositionEndOffset() &&
+      acpEnd >= mContentForTSF.LatestCompositionStartOffset() &&
+      acpEnd <= mContentForTSF.LatestCompositionEndOffset()) {
+      dontReturnNoLayoutError = true;
+    }
     // Free ChangJie 2010 doesn't handle ITfContextView::GetTextExt() properly.
     // Prehaps, it's due to the bug of TSF.  We need to check if this is
     // necessary on Windows 10 before disabling this on Windows 10.
     else if (TSFPrefs::DoNotReturnNoLayoutErrorToFreeChangJie() &&
              TSFStaticSink::IsFreeChangJieActive()) {
       acpEnd = mContentForTSF.LatestCompositionStartOffset();
       acpStart = std::min(acpStart, acpEnd);
       dontReturnNoLayoutError = true;
@@ -4409,39 +4456,64 @@ TSFTextStore::GetTextExt(TsViewCookie vc
       if (mContentForTSF.MinOffsetOfLayoutChanged() > LONG_MAX) {
         MOZ_LOG(sTextStoreLog, LogLevel::Error,
           ("0x%p   TSFTextStore::GetTextExt(), FAILED due to the text "
            "is too big for TSF (cannot treat modified offset as LONG), "
            "mContentForTSF.MinOffsetOfLayoutChanged()=%u",
            this, mContentForTSF.MinOffsetOfLayoutChanged()));
         return E_FAIL;
       }
+      bool collapsed = acpStart == acpEnd;
       // Note that even if all characters in the editor or the composition
       // string was modified, 0 or start offset of the composition string is
       // useful because it may return caret rect or old character's rect which
       // the user still see.  That must be useful information for TIP.
       int32_t firstModifiedOffset =
         static_cast<int32_t>(mContentForTSF.MinOffsetOfLayoutChanged());
       LONG lastUnmodifiedOffset = std::max(firstModifiedOffset - 1, 0);
       if (mContentForTSF.IsLayoutChangedAt(acpStart)) {
-        // If TSF queries text rect in composition string, we should return
-        // rect at start of the composition even if its layout is changed.
         if (acpStart >= mContentForTSF.LatestCompositionStartOffset()) {
-          acpStart = mContentForTSF.LatestCompositionStartOffset();
+          // If mContentForTSF has last composition string and current
+          // composition string, we can assume that ContentCacheInParent has
+          // cached rects of composition string at least length of current
+          // composition string.  Otherwise, we can assume that rect for
+          // first character of composition string is stored since it was
+          // selection start or caret position.
+          LONG maxCachedOffset = mContentForTSF.LatestCompositionEndOffset();
+          if (mContentForTSF.WasLastComposition()) {
+            maxCachedOffset =
+              std::min(maxCachedOffset,
+                       mContentForTSF.LastCompositionStringEndOffset());
+          }
+          acpStart = std::min(acpStart, maxCachedOffset);
         }
-        // Otherwise, use first character's rect.  Even if there is no
-        // characters, the query event will return caret rect instead.
+        // Otherwise, we don't know which character rects are cached.  So, we
+        // need to use first unmodified character's rect in this case.  Even
+        // if there is no character, the query event will return caret rect
+        // instead.
         else {
           acpStart = lastUnmodifiedOffset;
         }
         MOZ_ASSERT(acpStart <= acpEnd);
       }
-      if (mContentForTSF.IsLayoutChangedAt(acpEnd)) {
-        // Use max larger offset of last unmodified offset or acpStart which
-        // may be the first character offset of the composition string.
+      // If TIP requests caret rect with collapsed range, we should keep
+      // collapsing the range.
+      if (collapsed) {
+        acpEnd = acpStart;
+      }
+      // Let's set acpEnd to larger offset of last unmodified offset or
+      // acpStart which may be the first character offset of the composition
+      // string.  However, some TIPs may want to know the right edge of the
+      // range.  Therefore, if acpEnd is in composition string and active TIP
+      // doesn't retrieve caret rect (i.e., the range isn't collapsed), we
+      // should keep using the original acpEnd.  Otherwise, we should set
+      // acpEnd to larger value of acpStart and lastUnmodifiedOffset.
+      else if (mContentForTSF.IsLayoutChangedAt(acpEnd) &&
+               (acpEnd < mContentForTSF.LatestCompositionStartOffset() ||
+                acpEnd > mContentForTSF.LatestCompositionEndOffset())) {
         acpEnd = std::max(acpStart, lastUnmodifiedOffset);
       }
       MOZ_LOG(sTextStoreLog, LogLevel::Debug,
         ("0x%p   TSFTextStore::GetTextExt() hacked the queried range "
          "for not returning TS_E_NOLAYOUT, new values are: "
          "acpStart=%d, acpEnd=%d", this, acpStart, acpEnd));
     }
   }
@@ -5914,16 +5986,19 @@ TSFTextStore::OnUpdateCompositionInterna
      "mDestroyed=%s, mDeferNotifyingTSF=%s",
      this, GetBoolName(mDestroyed), GetBoolName(mDeferNotifyingTSF)));
 
   // There are nothing to do after destroyed.
   if (mDestroyed) {
     return NS_OK;
   }
 
+  // Update cached data now because all pending events have been handled now.
+  mContentForTSF.OnCompositionEventsHandled();
+
   // If composition is completely finished both in TSF/TIP and the focused
   // editor which may be in a remote process, we can clear the cache and don't
   // have it until starting next composition.
   if (!mComposition.IsComposing() && !IsHandlingComposition()) {
     mDeferClearingContentForTSF = false;
   }
   mDeferNotifyingTSF = false;
   MaybeFlushPendingNotifications();
--- a/widget/windows/TSFTextStore.h
+++ b/widget/windows/TSFTextStore.h
@@ -780,39 +780,59 @@ protected:
     {
       Clear();
     }
 
     void Clear()
     {
       mText.Truncate();
       mLastCompositionString.Truncate();
+      mLastCompositionStart = -1;
       mInitialized = false;
     }
 
     bool IsInitialized() const { return mInitialized; }
 
     void Init(const nsAString& aText)
     {
       mText = aText;
       if (mComposition.IsComposing()) {
         mLastCompositionString = mComposition.mString;
+        mLastCompositionStart = mComposition.mStart;
       } else {
         mLastCompositionString.Truncate();
+        mLastCompositionStart = -1;
       }
       mMinTextModifiedOffset = NOT_MODIFIED;
       mLatestCompositionStartOffset = mLatestCompositionEndOffset = LONG_MAX;
       mInitialized = true;
     }
 
     void OnLayoutChanged()
     {
       mMinTextModifiedOffset = NOT_MODIFIED;
     }
 
+    // OnCompositionEventsHandled() is called when all pending composition
+    // events are handled in the focused content which may be in a remote
+    // process.
+    void OnCompositionEventsHandled()
+    {
+      if (!mInitialized) {
+        return;
+      }
+      if (mComposition.IsComposing()) {
+        mLastCompositionString = mComposition.mString;
+        mLastCompositionStart = mComposition.mStart;
+      } else {
+        mLastCompositionString.Truncate();
+        mLastCompositionStart = -1;
+      }
+    }
+
     const nsDependentSubstring GetSelectedText() const;
     const nsDependentSubstring GetSubstring(uint32_t aStart,
                                             uint32_t aLength) const;
     void ReplaceSelectedTextWith(const nsAString& aString);
     void ReplaceTextWith(LONG aStart, LONG aLength, const nsAString& aString);
 
     void StartComposition(ITfCompositionView* aCompositionView,
                           const PendingAction& aCompStart,
@@ -841,16 +861,27 @@ protected:
       MOZ_ASSERT(mInitialized);
       return mText;
     }
     const nsString& LastCompositionString() const
     {
       MOZ_ASSERT(mInitialized);
       return mLastCompositionString;
     }
+    LONG LastCompositionStringEndOffset() const
+    {
+      MOZ_ASSERT(mInitialized);
+      MOZ_ASSERT(WasLastComposition());
+      return mLastCompositionStart + mLastCompositionString.Length();
+    }
+    bool WasLastComposition() const
+    {
+      MOZ_ASSERT(mInitialized);
+      return mLastCompositionStart >= 0;
+    }
     uint32_t MinTextModifiedOffset() const
     {
       MOZ_ASSERT(mInitialized);
       return mMinTextModifiedOffset;
     }
     LONG LatestCompositionStartOffset() const
     {
       MOZ_ASSERT(mInitialized);
@@ -895,16 +926,20 @@ protected:
   private:
     nsString mText;
     // mLastCompositionString stores the composition string when the document
     // is locked. This is necessary to compute mMinTextModifiedOffset.
     nsString mLastCompositionString;
     TSFTextStore::Composition& mComposition;
     TSFTextStore::Selection& mSelection;
 
+    // mLastCompositionStart stores the start offset of composition when
+    // mLastCompositionString is set.
+    LONG mLastCompositionStart;
+
     // The latest composition's start and end offset.  If composition hasn't
     // been started since this instance is initialized, they are LONG_MAX.
     LONG mLatestCompositionStartOffset;
     LONG mLatestCompositionEndOffset;
 
     // The minimum offset of modified part of the text.
     enum : uint32_t
     {
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -53,27 +53,23 @@
 #include "nsIDOMPaintRequest.h"
 #include "nsIDOMParser.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMScreen.h"
 #include "nsIDOMScrollAreaEvent.h"
 #include "nsIDOMSerializer.h"
 #include "nsIDOMSimpleGestureEvent.h"
-#include "nsIDOMSVGElement.h"
 #include "nsIDOMText.h"
-#include "nsIDOMTimeEvent.h"
 #include "nsIDOMTimeRanges.h"
 #include "nsIDOMTransitionEvent.h"
 #include "nsIDOMUIEvent.h"
 #include "nsIDOMValidityState.h"
 #include "nsIDOMWheelEvent.h"
 #include "nsIDOMXMLDocument.h"
-#include "nsIDOMXPathEvaluator.h"
-#include "nsIDOMXPathResult.h"
 #include "nsIDOMXULCommandEvent.h"
 #include "nsIDOMXULElement.h"
 #include "nsIFrameLoader.h"
 #include "nsIListBoxObject.h"
 #include "nsIMenuBoxObject.h"
 #include "nsIScrollBoxObject.h"
 #include "nsISelection.h"
 #include "nsITreeBoxObject.h"
@@ -159,18 +155,16 @@
 #include "mozilla/dom/TreeBoxObjectBinding.h"
 #include "mozilla/dom/UIEventBinding.h"
 #include "mozilla/dom/ValidityStateBinding.h"
 #include "mozilla/dom/WheelEventBinding.h"
 #include "mozilla/dom/XMLDocumentBinding.h"
 #include "mozilla/dom/XMLHttpRequestEventTargetBinding.h"
 #include "mozilla/dom/XMLHttpRequestUploadBinding.h"
 #include "mozilla/dom/XMLSerializerBinding.h"
-#include "mozilla/dom/XPathEvaluatorBinding.h"
-#include "mozilla/dom/XPathResultBinding.h"
 #include "mozilla/dom/XULCommandEventBinding.h"
 #include "mozilla/dom/XULDocumentBinding.h"
 #include "mozilla/dom/XULElementBinding.h"
 
 using namespace mozilla;
 
 struct ComponentsInterfaceShimEntry {
   constexpr
@@ -275,31 +269,27 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMParser, DOMParser),
   DEFINE_SHIM(ProcessingInstruction),
   DEFINE_SHIM(Range),
   DEFINE_SHIM(Screen),
   DEFINE_SHIM(ScrollAreaEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIScrollBoxObject, ScrollBoxObject),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMSerializer, XMLSerializer),
   DEFINE_SHIM(SimpleGestureEvent),
-  DEFINE_SHIM(SVGElement),
   DEFINE_SHIM(Text),
-  DEFINE_SHIM(TimeEvent),
   DEFINE_SHIM(TimeRanges),
   DEFINE_SHIM(TransitionEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsITreeBoxObject, TreeBoxObject),
   DEFINE_SHIM(UIEvent),
   DEFINE_SHIM(ValidityState),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIWebBrowserPersistable, FrameLoader),
   DEFINE_SHIM(WheelEvent),
   DEFINE_SHIM(XMLDocument),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIXMLHttpRequestEventTarget, XMLHttpRequestEventTarget),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIXMLHttpRequestUpload, XMLHttpRequestUpload),
-  DEFINE_SHIM(XPathEvaluator),
-  DEFINE_SHIM(XPathResult),
   DEFINE_SHIM(XULCommandEvent),
   DEFINE_SHIM(XULElement),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsISelection, Selection),
 };
 
 #undef DEFINE_SHIM
 #undef DEFINE_SHIM_WITH_CUSTOM_INTERFACE