Merge inbound to mozilla-central. a=merge
authorGurzau Raul <rgurzau@mozilla.com>
Thu, 01 Feb 2018 23:53:53 +0200
changeset 402153 ee7f64d0764961e9663c681efc8d2b3759af79d6
parent 402126 ca21ae6abd8e32bb85d76b5c2b238a7869b68e20 (current diff)
parent 402152 bffbab07fdc4c9a92b7a6ff5d68459961cc786ab (diff)
child 402156 27e993937c984b0e2bd05aeb17d791c7c036ad21
child 402163 797e282bade184a6149f8075a75399dc0afd9f62
child 402176 b76c08a1f5b3b51ddabf65302662ce7eb7660aa5
push id33367
push userrgurzau@mozilla.com
push dateThu, 01 Feb 2018 21:54:13 +0000
treeherdermozilla-central@ee7f64d07649 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone60.0a1
first release with
nightly linux32
ee7f64d07649 / 60.0a1 / 20180201220225 / files
nightly linux64
ee7f64d07649 / 60.0a1 / 20180201220225 / files
nightly mac
ee7f64d07649 / 60.0a1 / 20180201220225 / files
nightly win32
ee7f64d07649 / 60.0a1 / 20180201220225 / files
nightly win64
ee7f64d07649 / 60.0a1 / 20180201220225 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central. a=merge
dom/interfaces/traversal/moz.build
dom/interfaces/traversal/nsIDOMNodeFilter.idl
dom/interfaces/traversal/nsIDOMNodeIterator.idl
dom/interfaces/traversal/nsIDOMTreeWalker.idl
dom/workers/test/test_workersDisabled.html
dom/workers/test/test_workersDisabled.xul
dom/workers/test/workersDisabled_worker.js
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -93,19 +93,18 @@ nsCoreUtils::DispatchClickEvent(nsITreeB
   int32_t x = 0, y = 0, width = 0, height = 0;
   nsresult rv = aTreeBoxObj->GetCoordsForCellItem(aRowIndex, aColumn,
                                                   aPseudoElt,
                                                   &x, &y, &width, &height);
   if (NS_FAILED(rv))
     return;
 
   nsCOMPtr<nsIContent> tcXULElm(do_QueryInterface(tcElm));
-  IgnoredErrorResult ignored;
   nsCOMPtr<nsIBoxObject> tcBoxObj =
-    nsXULElement::FromContent(tcXULElm)->GetBoxObject(ignored);
+    nsXULElement::FromContent(tcXULElm)->GetBoxObject(IgnoreErrors());
 
   int32_t tcX = 0;
   tcBoxObj->GetX(&tcX);
 
   int32_t tcY = 0;
   tcBoxObj->GetY(&tcY);
 
   // Dispatch mouse events.
@@ -496,33 +495,31 @@ nsCoreUtils::GetTreeBodyBoxObject(nsITre
 {
   nsCOMPtr<nsIDOMElement> tcElm;
   aTreeBoxObj->GetTreeBody(getter_AddRefs(tcElm));
   nsCOMPtr<nsIContent> tcContent(do_QueryInterface(tcElm));
   RefPtr<nsXULElement> tcXULElm = nsXULElement::FromContentOrNull(tcContent);
   if (!tcXULElm)
     return nullptr;
 
-  IgnoredErrorResult ignored;
-  return tcXULElm->GetBoxObject(ignored);
+  return tcXULElm->GetBoxObject(IgnoreErrors());
 }
 
 already_AddRefed<nsITreeBoxObject>
 nsCoreUtils::GetTreeBoxObject(nsIContent *aContent)
 {
   // Find DOMNode's parents recursively until reach the <tree> tag
   nsIContent* currentContent = aContent;
   while (currentContent) {
     if (currentContent->NodeInfo()->Equals(nsGkAtoms::tree,
                                            kNameSpaceID_XUL)) {
       // We will get the nsITreeBoxObject from the tree node
       RefPtr<nsXULElement> xulElement =
         nsXULElement::FromContent(currentContent);
-      IgnoredErrorResult ignored;
-      nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(ignored);
+      nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(IgnoreErrors());
       nsCOMPtr<nsITreeBoxObject> treeBox(do_QueryInterface(box));
       if (treeBox)
         return treeBox.forget();
     }
     currentContent = currentContent->GetFlattenedTreeParent();
   }
 
   return nullptr;
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -26,19 +26,17 @@
 #include "States.h"
 #include "StyleInfo.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
 #include "TreeWalker.h"
 #include "XULDocument.h"
 
 #include "nsIDOMElement.h"
-#include "nsIDOMNodeFilter.h"
 #include "nsIDOMKeyEvent.h"
-#include "nsIDOMTreeWalker.h"
 #include "nsIDOMXULButtonElement.h"
 #include "nsIDOMXULElement.h"
 #include "nsIDOMXULLabelElement.h"
 #include "nsIDOMXULSelectCntrlEl.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
 #include "nsINodeList.h"
 #include "nsPIDOMWindow.h"
 
--- a/browser/components/translation/TranslationDocument.jsm
+++ b/browser/components/translation/TranslationDocument.jsm
@@ -3,18 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 this.EXPORTED_SYMBOLS = [ "TranslationDocument" ];
 
-const SHOW_ELEMENT = Ci.nsIDOMNodeFilter.SHOW_ELEMENT;
-const SHOW_TEXT = Ci.nsIDOMNodeFilter.SHOW_TEXT;
 const TEXT_NODE = Ci.nsIDOMNode.TEXT_NODE;
 
 ChromeUtils.import("resource://services-common/utils.js");
 
 /**
  * This class represents a document that is being translated,
  * and it is responsible for parsing the document,
  * generating the data structures translation (the list of
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -212,17 +212,16 @@
 @RESPATH@/components/dom_payments.xpt
 @RESPATH@/components/dom_power.xpt
 @RESPATH@/components/dom_push.xpt
 @RESPATH@/components/dom_quota.xpt
 @RESPATH@/components/dom_range.xpt
 @RESPATH@/components/dom_security.xpt
 @RESPATH@/components/dom_sidebar.xpt
 @RESPATH@/components/dom_storage.xpt
-@RESPATH@/components/dom_traversal.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
--- a/dom/animation/test/chrome/test_generated_content_getAnimations.html
+++ b/dom/animation/test/chrome/test_generated_content_getAnimations.html
@@ -27,17 +27,17 @@
 'use strict';
 
 const {Cc, Ci, Cu} = SpecialPowers;
 
 function getWalker(node) {
   var walker = Cc["@mozilla.org/inspector/deep-tree-walker;1"].
     createInstance(Ci.inIDeepTreeWalker);
   walker.showAnonymousContent = true;
-  walker.init(node.ownerDocument, Ci.nsIDOMNodeFilter.SHOW_ALL);
+  walker.init(node.ownerDocument, NodeFilter.SHOW_ALL);
   walker.currentNode = node;
   return walker;
 }
 
 test(function(t) {
   var root = document.getElementById('root');
   // Flush first to make sure the generated-content elements are ready
   // in the tree.
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -67,31 +67,30 @@ class CustomElementCallbackReaction fina
 };
 
 //-----------------------------------------------------
 // CustomElementCallback
 
 void
 CustomElementCallback::Call()
 {
-  IgnoredErrorResult rv;
   switch (mType) {
     case nsIDocument::eConnected:
-      static_cast<LifecycleConnectedCallback *>(mCallback.get())->Call(mThisObject, rv);
+      static_cast<LifecycleConnectedCallback *>(mCallback.get())->Call(mThisObject);
       break;
     case nsIDocument::eDisconnected:
-      static_cast<LifecycleDisconnectedCallback *>(mCallback.get())->Call(mThisObject, rv);
+      static_cast<LifecycleDisconnectedCallback *>(mCallback.get())->Call(mThisObject);
       break;
     case nsIDocument::eAdopted:
       static_cast<LifecycleAdoptedCallback *>(mCallback.get())->Call(mThisObject,
-        mAdoptedCallbackArgs.mOldDocument, mAdoptedCallbackArgs.mNewDocument, rv);
+        mAdoptedCallbackArgs.mOldDocument, mAdoptedCallbackArgs.mNewDocument);
       break;
     case nsIDocument::eAttributeChanged:
       static_cast<LifecycleAttributeChangedCallback *>(mCallback.get())->Call(mThisObject,
-        mArgs.name, mArgs.oldValue, mArgs.newValue, mArgs.namespaceURI, rv);
+        mArgs.name, mArgs.oldValue, mArgs.newValue, mArgs.namespaceURI);
       break;
   }
 }
 
 void
 CustomElementCallback::Traverse(nsCycleCollectionTraversalCallback& aCb) const
 {
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCb, "mThisObject");
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1474,18 +1474,17 @@ Navigator::RequestVRPresentation(VRDispl
 {
   nsGlobalWindowInner* win = nsGlobalWindowInner::Cast(mWindow);
   win->DispatchVRDisplayActivate(aDisplay.DisplayId(), VRDisplayEventReason::Requested);
 }
 
 nsINetworkProperties*
 Navigator::GetNetworkProperties()
 {
-  IgnoredErrorResult rv;
-  return GetConnection(rv);
+  return GetConnection(IgnoreErrors());
 }
 
 network::Connection*
 Navigator::GetConnection(ErrorResult& aRv)
 {
   if (!mConnection) {
     if (!mWindow) {
       aRv.Throw(NS_ERROR_UNEXPECTED);
--- a/dom/base/NodeIterator.cpp
+++ b/dom/base/NodeIterator.cpp
@@ -1,27 +1,28 @@
 /* -*- 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/. */
 
 /*
- * Implementation of DOM Traversal's nsIDOMNodeIterator
+ * Implementation of DOM Traversal's NodeIterator
  */
 
 #include "mozilla/dom/NodeIterator.h"
 
 #include "nsIDOMNode.h"
 #include "nsError.h"
 
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsCOMPtr.h"
+#include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/NodeIteratorBinding.h"
 
 namespace mozilla {
 namespace dom {
 
 /*
  * NodePointer implementation
  */
@@ -133,18 +134,18 @@ void NodeIterator::NodePointer::MoveBack
 }
 
 /*
  * Factories, constructors and destructors
  */
 
 NodeIterator::NodeIterator(nsINode *aRoot,
                            uint32_t aWhatToShow,
-                           NodeFilterHolder aFilter) :
-    nsTraversal(aRoot, aWhatToShow, Move(aFilter)),
+                           NodeFilter* aFilter) :
+    nsTraversal(aRoot, aWhatToShow, aFilter),
     mPointer(mRoot, true)
 {
     aRoot->AddMutationObserver(this);
 }
 
 NodeIterator::~NodeIterator()
 {
     /* destructor code */
@@ -166,56 +167,23 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(No
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(NodeIterator)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRoot)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFilter)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 // QueryInterface implementation for NodeIterator
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(NodeIterator)
-    NS_INTERFACE_MAP_ENTRY(nsIDOMNodeIterator)
     NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
-    NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMNodeIterator)
+    NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(NodeIterator)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(NodeIterator)
 
-NS_IMETHODIMP NodeIterator::GetRoot(nsIDOMNode * *aRoot)
-{
-    nsCOMPtr<nsIDOMNode> root = Root()->AsDOMNode();
-    root.forget(aRoot);
-    return NS_OK;
-}
-
-NS_IMETHODIMP NodeIterator::GetWhatToShow(uint32_t *aWhatToShow)
-{
-    *aWhatToShow = WhatToShow();
-    return NS_OK;
-}
-
-NS_IMETHODIMP NodeIterator::GetFilter(nsIDOMNodeFilter **aFilter)
-{
-    NS_ENSURE_ARG_POINTER(aFilter);
-
-    *aFilter = mFilter.ToXPCOMCallback().take();
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP NodeIterator::NextNode(nsIDOMNode **_retval)
-{
-    return ImplNodeGetter(&NodeIterator::NextNode, _retval);
-}
-
-NS_IMETHODIMP NodeIterator::PreviousNode(nsIDOMNode **_retval)
-{
-    return ImplNodeGetter(&NodeIterator::PreviousNode, _retval);
-}
-
 already_AddRefed<nsINode>
 NodeIterator::NextOrPrevNode(NodePointer::MoveToMethodType aMove,
                              ErrorResult& aResult)
 {
     if (mInAcceptNode) {
         aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
         return nullptr;
     }
@@ -230,44 +198,31 @@ NodeIterator::NextOrPrevNode(NodePointer
 
     while ((mWorkingPointer.*aMove)(mRoot)) {
         nsCOMPtr<nsINode> testNode = mWorkingPointer.mNode;
         int16_t filtered = TestNode(testNode, aResult);
         if (aResult.Failed()) {
             return nullptr;
         }
 
-        if (filtered == nsIDOMNodeFilter::FILTER_ACCEPT) {
+        if (filtered == NodeFilterBinding::FILTER_ACCEPT) {
             mPointer = mWorkingPointer;
             return testNode.forget();
         }
     }
 
     return nullptr;
 }
 
-NS_IMETHODIMP NodeIterator::Detach(void)
+void
+NodeIterator::Detach()
 {
     if (mRoot) {
         mRoot->OwnerDoc()->WarnOnceAbout(nsIDocument::eNodeIteratorDetach);
     }
-    return NS_OK;
-}
-
-NS_IMETHODIMP NodeIterator::GetReferenceNode(nsIDOMNode * *aRefNode)
-{
-    nsCOMPtr<nsIDOMNode> node(do_QueryInterface(GetReferenceNode()));
-    node.forget(aRefNode);
-    return NS_OK;
-}
-
-NS_IMETHODIMP NodeIterator::GetPointerBeforeReferenceNode(bool *aBeforeNode)
-{
-    *aBeforeNode = PointerBeforeReferenceNode();
-    return NS_OK;
 }
 
 /*
  * nsIMutationObserver interface
  */
 
 void NodeIterator::ContentRemoved(nsIDocument *aDocument,
                                   nsIContent *aContainer,
--- a/dom/base/NodeIterator.h
+++ b/dom/base/NodeIterator.h
@@ -1,47 +1,44 @@
 /* -*- 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/. */
 
 /*
- * Implementation of DOM Traversal's nsIDOMNodeIterator
+ * Implementation of DOM Traversal's NodeIterator
  */
 
 #ifndef mozilla_dom_NodeIterator_h
 #define mozilla_dom_NodeIterator_h
 
-#include "nsIDOMNodeIterator.h"
 #include "nsTraversal.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsStubMutationObserver.h"
 
 class nsINode;
 class nsIDOMNode;
 
 namespace mozilla {
 namespace dom {
 
-class NodeIterator final : public nsIDOMNodeIterator,
-                           public nsTraversal,
-                           public nsStubMutationObserver
+class NodeIterator final : public nsStubMutationObserver,
+                           public nsTraversal
 {
 public:
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-    NS_DECL_NSIDOMNODEITERATOR
 
     NodeIterator(nsINode *aRoot,
                  uint32_t aWhatToShow,
-                 NodeFilterHolder aFilter);
+                 NodeFilter* aFilter);
 
     NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
 
-    NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(NodeIterator, nsIDOMNodeIterator)
+    NS_DECL_CYCLE_COLLECTION_CLASS(NodeIterator)
 
     // WebIDL API
     nsINode* Root() const
     {
         return mRoot;
     }
     nsINode* GetReferenceNode() const
     {
@@ -50,29 +47,29 @@ public:
     bool PointerBeforeReferenceNode() const
     {
         return mPointer.mBeforeNode;
     }
     uint32_t WhatToShow() const
     {
         return mWhatToShow;
     }
-    already_AddRefed<NodeFilter> GetFilter()
+    NodeFilter* GetFilter()
     {
-        return mFilter.ToWebIDLCallback();
+        return mFilter;
     }
     already_AddRefed<nsINode> NextNode(ErrorResult& aResult)
     {
         return NextOrPrevNode(&NodePointer::MoveToNext, aResult);
     }
     already_AddRefed<nsINode> PreviousNode(ErrorResult& aResult)
     {
         return NextOrPrevNode(&NodePointer::MoveToPrevious, aResult);
     }
-    // The XPCOM Detach() is fine for our purposes
+    void Detach();
 
     bool WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
 
 private:
     virtual ~NodeIterator();
 
     struct NodePointer {
         NodePointer() : mNode(nullptr) {}
@@ -88,29 +85,16 @@ private:
         void AdjustAfterRemoval(nsINode *aRoot, nsINode *aContainer, nsIContent *aChild, nsIContent *aPreviousSibling);
 
         void Clear() { mNode = nullptr; }
 
         nsINode *mNode;
         bool mBeforeNode;
     };
 
-    // Implementation for some of our XPCOM getters
-    typedef already_AddRefed<nsINode> (NodeIterator::*NodeGetter)(ErrorResult&);
-    inline nsresult ImplNodeGetter(NodeGetter aGetter, nsIDOMNode** aRetval)
-    {
-        mozilla::ErrorResult rv;
-        nsCOMPtr<nsINode> node = (this->*aGetter)(rv);
-        if (rv.Failed()) {
-            return rv.StealNSResult();
-        }
-        *aRetval = node ? node.forget().take()->AsDOMNode() : nullptr;
-        return NS_OK;
-    }
-
     // Have to return a strong ref, because the act of testing the node can
     // remove it from the DOM so we're holding the only ref to it.
     already_AddRefed<nsINode>
     NextOrPrevNode(NodePointer::MoveToMethodType aMove, ErrorResult& aResult);
 
     NodePointer mPointer;
     NodePointer mWorkingPointer;
 };
--- a/dom/base/TreeWalker.cpp
+++ b/dom/base/TreeWalker.cpp
@@ -1,38 +1,39 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim: set ts=4 et sw=4 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/. */
 
 /*
- * Implementation of DOM Traversal's nsIDOMTreeWalker
+ * Implementation of DOM Traversal's TreeWalker
  */
 
 #include "mozilla/dom/TreeWalker.h"
 
 #include "nsIContent.h"
 #include "nsIDOMNode.h"
 #include "nsError.h"
 #include "nsINode.h"
 #include "nsContentUtils.h"
+#include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/TreeWalkerBinding.h"
 
 namespace mozilla {
 namespace dom {
 
 /*
  * Factories, constructors and destructors
  */
 
 TreeWalker::TreeWalker(nsINode *aRoot,
                        uint32_t aWhatToShow,
-                       NodeFilterHolder aFilter) :
-    nsTraversal(aRoot, aWhatToShow, Move(aFilter)),
+                       NodeFilter* aFilter) :
+    nsTraversal(aRoot, aWhatToShow, aFilter),
     mCurrentNode(aRoot)
 {
 }
 
 TreeWalker::~TreeWalker()
 {
     /* destructor code */
 }
@@ -40,193 +41,108 @@ TreeWalker::~TreeWalker()
 /*
  * nsISupports and cycle collection stuff
  */
 
 NS_IMPL_CYCLE_COLLECTION(TreeWalker, mFilter, mCurrentNode, mRoot)
 
 // QueryInterface implementation for TreeWalker
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TreeWalker)
-    NS_INTERFACE_MAP_ENTRY(nsIDOMTreeWalker)
-    NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMTreeWalker)
+    NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 // Have to pass in dom::TreeWalker because a11y has an a11y::TreeWalker that
 // passes TreeWalker so refcount logging would get confused on the name
 // collision.
 NS_IMPL_CYCLE_COLLECTING_ADDREF(dom::TreeWalker)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(dom::TreeWalker)
 
-
-
-/*
- * nsIDOMTreeWalker Getters/Setters
- */
-
-NS_IMETHODIMP TreeWalker::GetRoot(nsIDOMNode * *aRoot)
-{
-    NS_ADDREF(*aRoot = Root()->AsDOMNode());
-    return NS_OK;
-}
-
-NS_IMETHODIMP TreeWalker::GetWhatToShow(uint32_t *aWhatToShow)
-{
-    *aWhatToShow = WhatToShow();
-    return NS_OK;
-}
-
-NS_IMETHODIMP TreeWalker::GetFilter(nsIDOMNodeFilter * *aFilter)
-{
-    NS_ENSURE_ARG_POINTER(aFilter);
-
-    *aFilter = mFilter.ToXPCOMCallback().take();
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP TreeWalker::GetCurrentNode(nsIDOMNode * *aCurrentNode)
-{
-    if (mCurrentNode) {
-        return CallQueryInterface(mCurrentNode, aCurrentNode);
-    }
-
-    *aCurrentNode = nullptr;
-
-    return NS_OK;
-}
-NS_IMETHODIMP TreeWalker::SetCurrentNode(nsIDOMNode * aCurrentNode)
-{
-    NS_ENSURE_TRUE(aCurrentNode, NS_ERROR_DOM_NOT_SUPPORTED_ERR);
-    NS_ENSURE_TRUE(mRoot, NS_ERROR_UNEXPECTED);
-
-    nsCOMPtr<nsINode> node = do_QueryInterface(aCurrentNode);
-    NS_ENSURE_TRUE(node, NS_ERROR_UNEXPECTED);
-
-    ErrorResult rv;
-    SetCurrentNode(*node, rv);
-    return rv.StealNSResult();
-}
-
 void
 TreeWalker::SetCurrentNode(nsINode& aNode, ErrorResult& aResult)
 {
     aResult = nsContentUtils::CheckSameOrigin(mRoot, &aNode);
     if (aResult.Failed()) {
         return;
     }
 
     mCurrentNode = &aNode;
 }
 
-/*
- * nsIDOMTreeWalker functions
- */
-
-NS_IMETHODIMP TreeWalker::ParentNode(nsIDOMNode **_retval)
-{
-    return ImplNodeGetter(&TreeWalker::ParentNode, _retval);
-}
-
 already_AddRefed<nsINode>
 TreeWalker::ParentNode(ErrorResult& aResult)
 {
     nsCOMPtr<nsINode> node = mCurrentNode;
 
     while (node && node != mRoot) {
         node = node->GetParentNode();
 
         if (node) {
             int16_t filtered = TestNode(node, aResult);
             if (aResult.Failed()) {
                 return nullptr;
             }
-            if (filtered == nsIDOMNodeFilter::FILTER_ACCEPT) {
+            if (filtered == NodeFilterBinding::FILTER_ACCEPT) {
                 mCurrentNode = node;
                 return node.forget();
             }
         }
     }
 
     return nullptr;
 }
 
-NS_IMETHODIMP TreeWalker::FirstChild(nsIDOMNode **_retval)
-{
-    return ImplNodeGetter(&TreeWalker::FirstChild, _retval);
-}
-
 already_AddRefed<nsINode>
 TreeWalker::FirstChild(ErrorResult& aResult)
 {
     return FirstChildInternal(false, aResult);
 }
 
-NS_IMETHODIMP TreeWalker::LastChild(nsIDOMNode **_retval)
-{
-    return ImplNodeGetter(&TreeWalker::LastChild, _retval);
-}
-
 already_AddRefed<nsINode>
 TreeWalker::LastChild(ErrorResult& aResult)
 {
     return FirstChildInternal(true, aResult);
 }
 
-NS_IMETHODIMP TreeWalker::PreviousSibling(nsIDOMNode **_retval)
-{
-    return ImplNodeGetter(&TreeWalker::PreviousSibling, _retval);
-}
-
 already_AddRefed<nsINode>
 TreeWalker::PreviousSibling(ErrorResult& aResult)
 {
     return NextSiblingInternal(true, aResult);
 }
 
-NS_IMETHODIMP TreeWalker::NextSibling(nsIDOMNode **_retval)
-{
-    return ImplNodeGetter(&TreeWalker::NextSibling, _retval);
-}
-
 already_AddRefed<nsINode>
 TreeWalker::NextSibling(ErrorResult& aResult)
 {
     return NextSiblingInternal(false, aResult);
 }
 
-NS_IMETHODIMP TreeWalker::PreviousNode(nsIDOMNode **_retval)
-{
-    return ImplNodeGetter(&TreeWalker::PreviousNode, _retval);
-}
-
 already_AddRefed<nsINode>
 TreeWalker::PreviousNode(ErrorResult& aResult)
 {
     nsCOMPtr<nsINode> node = mCurrentNode;
 
     while (node != mRoot) {
         while (nsINode *previousSibling = node->GetPreviousSibling()) {
             node = previousSibling;
 
             int16_t filtered = TestNode(node, aResult);
             if (aResult.Failed()) {
                 return nullptr;
             }
 
             nsINode *lastChild;
-            while (filtered != nsIDOMNodeFilter::FILTER_REJECT &&
+            while (filtered != NodeFilterBinding::FILTER_REJECT &&
                    (lastChild = node->GetLastChild())) {
                 node = lastChild;
                 filtered = TestNode(node, aResult);
                 if (aResult.Failed()) {
                     return nullptr;
                 }
             }
 
-            if (filtered == nsIDOMNodeFilter::FILTER_ACCEPT) {
+            if (filtered == NodeFilterBinding::FILTER_ACCEPT) {
                 mCurrentNode = node;
                 return node.forget();
             }
         }
 
         if (node == mRoot) {
             break;
         }
@@ -236,50 +152,45 @@ TreeWalker::PreviousNode(ErrorResult& aR
             break;
         }
 
         int16_t filtered = TestNode(node, aResult);
         if (aResult.Failed()) {
             return nullptr;
         }
 
-        if (filtered == nsIDOMNodeFilter::FILTER_ACCEPT) {
+        if (filtered == NodeFilterBinding::FILTER_ACCEPT) {
             mCurrentNode = node;
             return node.forget();
         }
     }
 
     return nullptr;
 }
 
-NS_IMETHODIMP TreeWalker::NextNode(nsIDOMNode **_retval)
-{
-    return ImplNodeGetter(&TreeWalker::NextNode, _retval);
-}
-
 already_AddRefed<nsINode>
 TreeWalker::NextNode(ErrorResult& aResult)
 {
-    int16_t filtered = nsIDOMNodeFilter::FILTER_ACCEPT; // pre-init for inner loop
+    int16_t filtered = NodeFilterBinding::FILTER_ACCEPT; // pre-init for inner loop
 
     nsCOMPtr<nsINode> node = mCurrentNode;
 
     while (1) {
 
         nsINode *firstChild;
-        while (filtered != nsIDOMNodeFilter::FILTER_REJECT &&
+        while (filtered != NodeFilterBinding::FILTER_REJECT &&
                (firstChild = node->GetFirstChild())) {
             node = firstChild;
 
             filtered = TestNode(node, aResult);
             if (aResult.Failed()) {
                 return nullptr;
             }
 
-            if (filtered ==  nsIDOMNodeFilter::FILTER_ACCEPT) {
+            if (filtered ==  NodeFilterBinding::FILTER_ACCEPT) {
                 // Node found
                 mCurrentNode = node;
                 return node.forget();
             }
         }
 
         nsINode *sibling = nullptr;
         nsINode *temp = node;
@@ -300,17 +211,17 @@ TreeWalker::NextNode(ErrorResult& aResul
         node = sibling;
 
         // Found a sibling. Either ours or ancestor's
         filtered = TestNode(node, aResult);
         if (aResult.Failed()) {
             return nullptr;
         }
 
-        if (filtered ==  nsIDOMNodeFilter::FILTER_ACCEPT) {
+        if (filtered ==  NodeFilterBinding::FILTER_ACCEPT) {
             // Node found
             mCurrentNode = node;
             return node.forget();
         }
     }
 
     return nullptr;
 }
@@ -334,30 +245,30 @@ TreeWalker::FirstChildInternal(bool aRev
 
     while (node) {
         int16_t filtered = TestNode(node, aResult);
         if (aResult.Failed()) {
             return nullptr;
         }
 
         switch (filtered) {
-            case nsIDOMNodeFilter::FILTER_ACCEPT:
+            case NodeFilterBinding::FILTER_ACCEPT:
                 // Node found
                 mCurrentNode = node;
                 return node.forget();
-            case nsIDOMNodeFilter::FILTER_SKIP: {
+            case NodeFilterBinding::FILTER_SKIP: {
                     nsINode *child = aReversed ? node->GetLastChild()
                                                : node->GetFirstChild();
                     if (child) {
                         node = child;
                         continue;
                     }
                     break;
                 }
-            case nsIDOMNodeFilter::FILTER_REJECT:
+            case NodeFilterBinding::FILTER_REJECT:
                 // Keep searching
                 break;
         }
 
         do {
             nsINode *sibling = aReversed ? node->GetPreviousSibling()
                                          : node->GetNextSibling();
             if (sibling) {
@@ -402,24 +313,24 @@ TreeWalker::NextSiblingInternal(bool aRe
         while (sibling) {
             node = sibling;
 
             int16_t filtered = TestNode(node, aResult);
             if (aResult.Failed()) {
                 return nullptr;
             }
 
-            if (filtered == nsIDOMNodeFilter::FILTER_ACCEPT) {
+            if (filtered == NodeFilterBinding::FILTER_ACCEPT) {
                 // Node found
                 mCurrentNode = node;
                 return node.forget();
             }
 
             // If rejected or no children, try a sibling
-            if (filtered == nsIDOMNodeFilter::FILTER_REJECT ||
+            if (filtered == NodeFilterBinding::FILTER_REJECT ||
                 !(sibling = aReversed ? node->GetLastChild()
                                       : node->GetFirstChild())) {
                 sibling = aReversed ? node->GetPreviousSibling()
                                     : node->GetNextSibling();
             }
         }
 
         node = node->GetParentNode();
@@ -428,17 +339,17 @@ TreeWalker::NextSiblingInternal(bool aRe
             return nullptr;
         }
 
         // Is parent transparent in filtered view?
         int16_t filtered = TestNode(node, aResult);
         if (aResult.Failed()) {
             return nullptr;
         }
-        if (filtered == nsIDOMNodeFilter::FILTER_ACCEPT) {
+        if (filtered == NodeFilterBinding::FILTER_ACCEPT) {
             return nullptr;
         }
     }
 }
 
 bool
 TreeWalker::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
 {
--- a/dom/base/TreeWalker.h
+++ b/dom/base/TreeWalker.h
@@ -1,59 +1,58 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim: set ts=4 et sw=4 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/. */
 
 /*
- * Implementation of DOM Traversal's nsIDOMTreeWalker
+ * Implementation of DOM Traversal's TreeWalker
  */
 
 #ifndef mozilla_dom_TreeWalker_h
 #define mozilla_dom_TreeWalker_h
 
-#include "nsIDOMTreeWalker.h"
+#include "nsISupports.h"
 #include "nsTraversal.h"
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 #include "nsCycleCollectionParticipant.h"
 
 class nsINode;
 class nsIDOMNode;
 
 namespace mozilla {
 namespace dom {
 
-class TreeWalker final : public nsIDOMTreeWalker, public nsTraversal
+class TreeWalker final : public nsISupports, public nsTraversal
 {
     virtual ~TreeWalker();
 
 public:
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-    NS_DECL_NSIDOMTREEWALKER
 
     TreeWalker(nsINode *aRoot,
                uint32_t aWhatToShow,
-               NodeFilterHolder aFilter);
+               NodeFilter* aFilter);
 
     NS_DECL_CYCLE_COLLECTION_CLASS(TreeWalker)
 
     // WebIDL API
     nsINode* Root() const
     {
         return mRoot;
     }
     uint32_t WhatToShow() const
     {
         return mWhatToShow;
     }
-    already_AddRefed<NodeFilter> GetFilter()
+    NodeFilter* GetFilter()
     {
-        return mFilter.ToWebIDLCallback();
+        return mFilter;
     }
     nsINode* CurrentNode() const
     {
         return mCurrentNode;
     }
     void SetCurrentNode(nsINode& aNode, ErrorResult& aResult);
     // All our traversal methods return strong refs because filtering can
     // remove nodes from the tree.
@@ -84,28 +83,15 @@ private:
      * Implements NextSibling and PreviousSibling which only vary in which
      * direction they search.
      * @param aReversed Controls whether we search forwards or backwards
      * @param aResult   Whether we threw or not.
      * @returns         The desired node. Null if no child is found
      */
     already_AddRefed<nsINode> NextSiblingInternal(bool aReversed,
                                                   ErrorResult& aResult);
-
-    // Implementation for our various XPCOM getters
-    typedef already_AddRefed<nsINode> (TreeWalker::*NodeGetter)(ErrorResult&);
-    inline nsresult ImplNodeGetter(NodeGetter aGetter, nsIDOMNode** aRetval)
-    {
-        mozilla::ErrorResult rv;
-        nsCOMPtr<nsINode> node = (this->*aGetter)(rv);
-        if (rv.Failed()) {
-            return rv.StealNSResult();
-        }
-        *aRetval = node ? node.forget().take()->AsDOMNode() : nullptr;
-        return NS_OK;
-    }
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_TreeWalker_h
 
--- a/dom/base/nsContentAreaDragDrop.cpp
+++ b/dom/base/nsContentAreaDragDrop.cpp
@@ -55,16 +55,17 @@
 #include "nsRange.h"
 #include "TabParent.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLAreaElement.h"
 #include "mozilla/dom/HTMLAnchorElement.h"
 #include "nsVariant.h"
 
 using namespace mozilla::dom;
+using mozilla::IgnoreErrors;
 
 class MOZ_STACK_CLASS DragDataProducer
 {
 public:
   DragDataProducer(nsPIDOMWindowOuter* aWindow,
                    nsIContent* aTarget,
                    nsIContent* aSelectionTargetNode,
                    bool aIsAltKeyPressed);
@@ -348,20 +349,19 @@ DragDataProducer::GetNodeString(nsIConte
                                 nsAString & outNodeString)
 {
   nsCOMPtr<nsINode> node = inNode;
 
   outNodeString.Truncate();
 
   // use a range to get the text-equivalent of the node
   nsCOMPtr<nsIDocument> doc = node->OwnerDoc();
-  mozilla::IgnoredErrorResult rv;
-  RefPtr<nsRange> range = doc->CreateRange(rv);
+  RefPtr<nsRange> range = doc->CreateRange(IgnoreErrors());
   if (range) {
-    range->SelectNode(*node, rv);
+    range->SelectNode(*node, IgnoreErrors());
     range->ToString(outNodeString);
   }
 }
 
 nsresult
 DragDataProducer::Produce(DataTransfer* aDataTransfer,
                           bool* aCanDrag,
                           nsISelection** aSelection,
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -1694,16 +1694,17 @@ const InterfaceShimEntry kInterfaceShimM
   { "nsIDOMMouseScrollEvent", "MouseScrollEvent" },
   { "nsIDOMMutationEvent", "MutationEvent" },
   { "nsIDOMSimpleGestureEvent", "SimpleGestureEvent" },
   { "nsIDOMUIEvent", "UIEvent" },
   { "nsIDOMHTMLMediaElement", "HTMLMediaElement" },
   { "nsIDOMOfflineResourceList", "OfflineResourceList" },
   { "nsIDOMRange", "Range" },
   { "nsIDOMSVGLength", "SVGLength" },
+  // Think about whether Ci.nsINodeFilter can just go away for websites!
   { "nsIDOMNodeFilter", "NodeFilter" },
   { "nsIDOMXPathResult", "XPathResult" } };
 
 static nsresult
 LookupComponentsShim(JSContext *cx, JS::Handle<JSObject*> global,
                      nsPIDOMWindowInner *win,
                      JS::MutableHandle<JS::PropertyDescriptor> desc)
 {
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -51,17 +51,16 @@
 #include "mozilla/Services.h"
 #include "nsScreen.h"
 #include "ChildIterator.h"
 
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/EventStateManager.h"
-#include "nsIDOMNodeFilter.h"
 
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "nsIDOMDOMImplementation.h"
 #include "nsIDOMDocumentXBL.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/FramingChecker.h"
 #include "nsGenericHTMLElement.h"
@@ -6395,44 +6394,27 @@ nsIDocument::CreateRange(ErrorResult& rv
   return range.forget();
 }
 
 already_AddRefed<NodeIterator>
 nsIDocument::CreateNodeIterator(nsINode& aRoot, uint32_t aWhatToShow,
                                 NodeFilter* aFilter,
                                 ErrorResult& rv) const
 {
-  return CreateNodeIterator(aRoot, aWhatToShow, NodeFilterHolder(aFilter), rv);
-}
-
-already_AddRefed<NodeIterator>
-nsIDocument::CreateNodeIterator(nsINode& aRoot, uint32_t aWhatToShow,
-                                NodeFilterHolder aFilter,
-                                ErrorResult& rv) const
-{
-  nsINode* root = &aRoot;
-  RefPtr<NodeIterator> iterator = new NodeIterator(root, aWhatToShow,
-                                                   Move(aFilter));
+  RefPtr<NodeIterator> iterator = new NodeIterator(&aRoot, aWhatToShow,
+                                                   aFilter);
   return iterator.forget();
 }
 
 already_AddRefed<TreeWalker>
 nsIDocument::CreateTreeWalker(nsINode& aRoot, uint32_t aWhatToShow,
                               NodeFilter* aFilter,
                               ErrorResult& rv) const
 {
-  return CreateTreeWalker(aRoot, aWhatToShow, NodeFilterHolder(aFilter), rv);
-}
-
-already_AddRefed<TreeWalker>
-nsIDocument::CreateTreeWalker(nsINode& aRoot, uint32_t aWhatToShow,
-                              NodeFilterHolder aFilter, ErrorResult& rv) const
-{
-  nsINode* root = &aRoot;
-  RefPtr<TreeWalker> walker = new TreeWalker(root, aWhatToShow, Move(aFilter));
+  RefPtr<TreeWalker> walker = new TreeWalker(&aRoot, aWhatToShow, aFilter);
   return walker.forget();
 }
 
 
 already_AddRefed<Location>
 nsIDocument::GetLocation() const
 {
   nsCOMPtr<nsPIDOMWindowInner> w = do_QueryInterface(mScriptGlobalObject);
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -2445,29 +2445,25 @@ nsFocusManager::MoveCaretToFocus(nsIPres
         RefPtr<nsRange> newRange = doc->CreateRange(rv);
         if (NS_WARN_IF(rv.Failed())) {
           rv.SuppressException();
           return;
         }
 
         // Set the range to the start of the currently focused node
         // Make sure it's collapsed
-        {
-          IgnoredErrorResult ignored;
-          newRange->SelectNodeContents(*aContent, ignored);
-        }
+        newRange->SelectNodeContents(*aContent, IgnoreErrors());
 
         if (!aContent->GetFirstChild() ||
             aContent->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) {
           // If current focus node is a leaf, set range to before the
           // node by using the parent as a container.
           // This prevents it from appearing as selected.
-          IgnoredErrorResult err1, err2;
-          newRange->SetStartBefore(*aContent, err1);
-          newRange->SetEndBefore(*aContent, err2);
+          newRange->SetStartBefore(*aContent, IgnoreErrors());
+          newRange->SetEndBefore(*aContent, IgnoreErrors());
         }
         domSelection->AddRange(newRange);
         domSelection->CollapseToStart();
       }
     }
   }
 }
 
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -904,23 +904,21 @@ nsFrameLoader::Show(int32_t marginWidth,
       nsAutoString designMode;
       htmlDoc->GetDesignMode(designMode);
 
       if (designMode.EqualsLiteral("on")) {
         // Hold on to the editor object to let the document reattach to the
         // same editor object, instead of creating a new one.
         RefPtr<HTMLEditor> htmlEditor = mDocShell->GetHTMLEditor();
         Unused << htmlEditor;
-        {
-          IgnoredErrorResult rv;
-          htmlDoc->SetDesignMode(NS_LITERAL_STRING("off"), Nothing(), rv);
-        }
-
-        IgnoredErrorResult rv;
-        htmlDoc->SetDesignMode(NS_LITERAL_STRING("on"), Nothing(), rv);
+        htmlDoc->SetDesignMode(NS_LITERAL_STRING("off"), Nothing(),
+                               IgnoreErrors());
+
+        htmlDoc->SetDesignMode(NS_LITERAL_STRING("on"), Nothing(),
+                               IgnoreErrors());
       } else {
         // Re-initialize the presentation for contenteditable documents
         bool editable = false,
              hasEditingSession = false;
         mDocShell->GetEditable(&editable);
         mDocShell->GetHasEditingSession(&hasEditingSession);
         RefPtr<HTMLEditor> htmlEditor = mDocShell->GetHTMLEditor();
         if (editable && hasEditingSession && htmlEditor) {
--- a/dom/base/nsGlobalWindowOuter.h
+++ b/dom/base/nsGlobalWindowOuter.h
@@ -692,19 +692,19 @@ public:
   GetContentInternal(mozilla::ErrorResult& aError,
                      mozilla::dom::CallerType aCallerType);
   void GetContentOuter(JSContext* aCx,
                        JS::MutableHandle<JSObject*> aRetval,
                        mozilla::dom::CallerType aCallerType,
                        mozilla::ErrorResult& aError);
   already_AddRefed<nsPIDOMWindowOuter> GetContent()
   {
-    mozilla::IgnoredErrorResult ignored;
     nsCOMPtr<nsPIDOMWindowOuter> win =
-      GetContentInternal(ignored, mozilla::dom::CallerType::System);
+      GetContentInternal(mozilla::IgnoreErrors(),
+                         mozilla::dom::CallerType::System);
     return win.forget();
   }
 
   // ChromeWindow bits.  Do NOT call these unless your window is in
   // fact chrome.
   nsIBrowserDOMWindow* GetBrowserDOMWindowOuter();
   void SetBrowserDOMWindowOuter(nsIBrowserDOMWindow* aBrowserWindow);
   void SetCursorOuter(const nsAString& aCursor, mozilla::ErrorResult& aError);
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -81,17 +81,16 @@ class nsIContent;
 class nsIContentSink;
 class nsIDocShell;
 class nsIDocShellTreeItem;
 class nsIDocumentEncoder;
 class nsIDocumentObserver;
 class nsIDOMDocument;
 class nsIDOMDocumentType;
 class nsIDOMElement;
-class nsIDOMNodeFilter;
 class nsIDOMNodeList;
 class nsIHTMLCollection;
 class nsILayoutHistoryState;
 class nsILoadContext;
 class nsIObjectLoadingContent;
 class nsIObserver;
 class nsIPrincipal;
 class nsIRequest;
@@ -177,17 +176,16 @@ class TreeWalker;
 class XPathEvaluator;
 class XPathExpression;
 class XPathNSResolver;
 class XPathResult;
 class XULDocument;
 template<typename> class Sequence;
 
 template<typename, typename> class CallbackObjectHolder;
-typedef CallbackObjectHolder<NodeFilter, nsIDOMNodeFilter> NodeFilterHolder;
 
 enum class CallerType : uint32_t;
 
 } // namespace dom
 } // namespace mozilla
 
 // Must be kept in sync with xpcom/rust/xpcom/src/interfaces/nonidl.rs
 #define NS_IDOCUMENT_IID \
@@ -2872,28 +2870,19 @@ public:
     CreateEvent(const nsAString& aEventType,
                 mozilla::dom::CallerType aCallerType,
                 mozilla::ErrorResult& rv) const;
   already_AddRefed<nsRange> CreateRange(mozilla::ErrorResult& rv);
   already_AddRefed<mozilla::dom::NodeIterator>
     CreateNodeIterator(nsINode& aRoot, uint32_t aWhatToShow,
                        mozilla::dom::NodeFilter* aFilter,
                        mozilla::ErrorResult& rv) const;
-  already_AddRefed<mozilla::dom::NodeIterator>
-    CreateNodeIterator(nsINode& aRoot, uint32_t aWhatToShow,
-                       mozilla::dom::NodeFilterHolder aFilter,
-                       mozilla::ErrorResult& rv) const;
   already_AddRefed<mozilla::dom::TreeWalker>
     CreateTreeWalker(nsINode& aRoot, uint32_t aWhatToShow,
                      mozilla::dom::NodeFilter* aFilter, mozilla::ErrorResult& rv) const;
-  already_AddRefed<mozilla::dom::TreeWalker>
-    CreateTreeWalker(nsINode& aRoot, uint32_t aWhatToShow,
-                     mozilla::dom::NodeFilterHolder aFilter,
-                     mozilla::ErrorResult& rv) const;
-
   // Deprecated WebIDL bits
   already_AddRefed<mozilla::dom::CDATASection>
     CreateCDATASection(const nsAString& aData, mozilla::ErrorResult& rv);
   already_AddRefed<mozilla::dom::Attr>
     CreateAttribute(const nsAString& aName, mozilla::ErrorResult& rv);
   already_AddRefed<mozilla::dom::Attr>
     CreateAttributeNS(const nsAString& aNamespaceURI,
                       const nsAString& aQualifiedName,
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -1771,18 +1771,17 @@ nsINode::ReplaceWith(const Sequence<Owni
 void
 nsINode::Remove()
 {
   nsCOMPtr<nsINode> parent = GetParentNode();
   if (!parent) {
     return;
   }
 
-  IgnoredErrorResult err;
-  parent->RemoveChild(*this, err);
+  parent->RemoveChild(*this, IgnoreErrors());
 }
 
 Element*
 nsINode::GetFirstElementChild() const
 {
   for (nsIContent* child = GetFirstChild();
        child;
        child = child->GetNextSibling()) {
--- a/dom/base/nsMimeTypeArray.cpp
+++ b/dom/base/nsMimeTypeArray.cpp
@@ -169,18 +169,17 @@ void
 nsMimeTypeArray::EnsurePluginMimeTypes()
 {
   if (!mMimeTypes.IsEmpty() || !mWindow) {
     return;
   }
 
   RefPtr<Navigator> navigator = mWindow->Navigator();
 
-  IgnoredErrorResult rv;
-  nsPluginArray *pluginArray = navigator->GetPlugins(rv);
+  nsPluginArray *pluginArray = navigator->GetPlugins(IgnoreErrors());
   if (!pluginArray) {
     return;
   }
 
   pluginArray->GetMimeTypes(mMimeTypes);
   pluginArray->GetCTPMimeTypes(mCTPMimeTypes);
 }
 
--- a/dom/base/nsTraversal.cpp
+++ b/dom/base/nsTraversal.cpp
@@ -5,76 +5,64 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsTraversal.h"
 
 #include "nsIDOMNode.h"
 #include "nsError.h"
 #include "nsINode.h"
 #include "mozilla/AutoRestore.h"
+#include "mozilla/dom/NodeFilterBinding.h"
 
 #include "nsGkAtoms.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsTraversal::nsTraversal(nsINode *aRoot,
                          uint32_t aWhatToShow,
-                         NodeFilterHolder aFilter) :
+                         NodeFilter* aFilter) :
     mRoot(aRoot),
     mWhatToShow(aWhatToShow),
-    mFilter(Move(aFilter)),
+    mFilter(aFilter),
     mInAcceptNode(false)
 {
     NS_ASSERTION(aRoot, "invalid root in call to nsTraversal constructor");
 }
 
 nsTraversal::~nsTraversal()
 {
     /* destructor code */
 }
 
 /*
  * Tests if and how a node should be filtered. Uses mWhatToShow and
  * mFilter to test the node.
  * @param aNode     Node to test
  * @param aResult   Whether we succeeded
- * @returns         Filtervalue. See nsIDOMNodeFilter.idl
+ * @returns         Filtervalue. See NodeFilter.webidl
  */
 int16_t
 nsTraversal::TestNode(nsINode* aNode, mozilla::ErrorResult& aResult)
 {
     if (mInAcceptNode) {
         aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
         return 0;
     }
 
     uint16_t nodeType = aNode->NodeType();
 
     if (nodeType <= 12 && !((1 << (nodeType-1)) & mWhatToShow)) {
-        return nsIDOMNodeFilter::FILTER_SKIP;
+        return NodeFilterBinding::FILTER_SKIP;
     }
 
-    if (!mFilter.GetISupports()) {
+    if (!mFilter) {
         // No filter, just accept
-        return nsIDOMNodeFilter::FILTER_ACCEPT;
+        return NodeFilterBinding::FILTER_ACCEPT;
     }
 
-    if (mFilter.HasWebIDLCallback()) {
-        AutoRestore<bool> inAcceptNode(mInAcceptNode);
-        mInAcceptNode = true;
-        // No need to pass in an execution reason, since the generated default,
-        // "NodeFilter.acceptNode", is pretty much exactly what we'd say anyway.
-        return mFilter.GetWebIDLCallback()->
-            AcceptNode(*aNode, aResult, nullptr,
-                       CallbackObject::eRethrowExceptions);
-    }
-
-    nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(aNode);
     AutoRestore<bool> inAcceptNode(mInAcceptNode);
     mInAcceptNode = true;
-    int16_t filtered;
-    nsresult rv = mFilter.GetXPCOMCallback()->AcceptNode(domNode, &filtered);
-    if (NS_FAILED(rv)) {
-        aResult.Throw(rv);
-    }
-    return filtered;
+    // No need to pass in an execution reason, since the generated default,
+    // "NodeFilter.acceptNode", is pretty much exactly what we'd say anyway.
+    return mFilter->AcceptNode(*aNode, aResult, nullptr,
+                               CallbackObject::eRethrowExceptions);
 }
--- a/dom/base/nsTraversal.h
+++ b/dom/base/nsTraversal.h
@@ -1,48 +1,46 @@
 /* -*- 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/. */
 
 /*
- * Implementation of DOM Traversal's nsIDOMTreeWalker
+ * Implementation of common traversal methods for TreeWalker and NodeIterator.
  */
 
 #ifndef nsTraversal_h___
 #define nsTraversal_h___
 
 #include "nsCOMPtr.h"
-#include "nsIDocument.h" // for NodeFilterHolder
 #include "mozilla/dom/CallbackObject.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/NodeFilterBinding.h"
-#include "nsIDOMNodeFilter.h"
 
 class nsINode;
 
 class nsTraversal
 {
 public:
     nsTraversal(nsINode *aRoot,
                 uint32_t aWhatToShow,
-                mozilla::dom::NodeFilterHolder aFilter);
+                mozilla::dom::NodeFilter* aFilter);
     virtual ~nsTraversal();
 
 protected:
     nsCOMPtr<nsINode> mRoot;
     uint32_t mWhatToShow;
-    mozilla::dom::NodeFilterHolder mFilter;
+    RefPtr<mozilla::dom::NodeFilter> mFilter;
     bool mInAcceptNode;
 
     /*
      * Tests if and how a node should be filtered. Uses mWhatToShow and
      * mFilter to test the node.
      * @param aNode     Node to test
      * @param aResult   Whether we succeeded
-     * @returns         Filtervalue. See nsIDOMNodeFilter.idl
+     * @returns         Filtervalue. See NodeFilter.webidl
      */
     int16_t TestNode(nsINode* aNode, mozilla::ErrorResult& aResult);
 };
 
 #endif
 
--- a/dom/base/test/chrome/cpows_parent.xul
+++ b/dom/base/test/chrome/cpows_parent.xul
@@ -243,17 +243,17 @@
 
         // This does work because we create a CPOW for isEqualNode that stays
         // alive as long as we have a reference to the first CPOW (so as long
         // as it's detectable).
         is(savedElement.isEqualNode, savedElement.isEqualNode, "webidl function identity works");
 
         let walker = Components.classes["@mozilla.org/inspector/deep-tree-walker;1"]
                                .createInstance(Components.interfaces.inIDeepTreeWalker);
-        const SHOW_ELEMENT = Components.interfaces.nsIDOMNodeFilter.SHOW_ELEMENT;
+        const SHOW_ELEMENT = NodeFilter.SHOW_ELEMENT;
         walker.showAnonymousContent = true;
         walker.showSubDocuments = false;
 
         try {
           walker.init(savedElement, SHOW_ELEMENT);
           ok(false, "expected exception passing CPOW to C++");
         } catch (e) {
           is(e.result, Components.results.NS_ERROR_XPC_CANT_PASS_CPOW_TO_NATIVE,
--- a/dom/base/test/chrome/test_bug635835.xul
+++ b/dom/base/test/chrome/test_bug635835.xul
@@ -14,17 +14,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <body xmlns="http://www.w3.org/1999/xhtml">
   <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=635835"
      target="_blank">Mozilla Bug 635835</a>
   </body>
 
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
 SimpleTest.waitForExplicitFinish();
-const SHOW_ALL = Components.interfaces.nsIDOMNodeFilter.SHOW_ALL;
+const SHOW_ALL = NodeFilter.SHOW_ALL;
 
 addLoadEvent(function() {
   var walker = document.createTreeWalker(document, SHOW_ALL, null);
   try {
     walker.currentNode = {};
     walker.nextNode();
   }
   catch (e) {
--- a/dom/base/test/test_treewalker_nextsibling.xml
+++ b/dom/base/test/test_treewalker_nextsibling.xml
@@ -15,20 +15,19 @@
 var passedNodes = new WeakMap();
 function setPass(aNode) {
   passedNodes.set(aNode, true);
 }
 
 SimpleTest.waitForExplicitFinish();
 
 window.addEventListener("load", function() {
-  const nsIDOMNodeFilter = SpecialPowers.Ci.nsIDOMNodeFilter;
   var walker = document.createTreeWalker(
     document,
-    nsIDOMNodeFilter.SHOW_TEXT | nsIDOMNodeFilter.SHOW_DOCUMENT,
+    NodeFilter.SHOW_TEXT | NodeFilter.SHOW_DOCUMENT,
     null
   );
   setPass(walker.firstChild());
   while (walker.nextSibling()) {
     setPass(walker.currentNode);
   }
 
 /*
@@ -38,17 +37,17 @@ is substantially different from the same
 document. Nodes that are siblings in the TreeWalker view may be children of
 different, widely separated nodes in the original view. For instance, consider a
 NodeFilter that skips all nodes except for Text nodes and the root node of a
 document. In the logical view that results, all text nodes will be siblings and
 appear as direct children of the root node, no matter how deeply nested the
 structure of the original document.
 */
 
-  walker2 = document.createTreeWalker(document, nsIDOMNodeFilter.SHOW_TEXT, null);
+  walker2 = document.createTreeWalker(document, NodeFilter.SHOW_TEXT, null);
   while (walker2.nextNode()) {
     var cNode = walker2.currentNode;
     ok(passedNodes.get(cNode), "Every text node should appear: " + walker2.currentNode.nodeValue);
     walker.currentNode = cNode;
     var parent = walker.parentNode();
     is(parent, document, "parent of text node should be document");
 
     // Check nextSibling's previousSibling.
--- a/dom/base/test/unit/test_isequalnode.js
+++ b/dom/base/test/unit/test_isequalnode.js
@@ -368,20 +368,20 @@ function test_isEqualNode_null()
   }
 }
 
 function test_isEqualNode_wholeDoc()
 {
   doc = ParseFile("isequalnode_data.xml");
   var doc2 = ParseFile("isequalnode_data.xml");
   var tw1 =
-    doc.createTreeWalker(doc, Components.interfaces.nsIDOMNodeFilter.SHOW_ALL,
+    doc.createTreeWalker(doc, 0xFFFFFFFF /* NodeFilter.SHOW_ALL */,
                          null);
   var tw2 =
-    doc2.createTreeWalker(doc2, Components.interfaces.nsIDOMNodeFilter.SHOW_ALL,
+    doc2.createTreeWalker(doc2, 0xFFFFFFFF /* NodeFilter.SHOW_ALL */,
                           null);
   do {
     check_eq_nodes(tw1.currentNode, tw2.currentNode);
     tw1.nextNode();
   } while(tw2.nextNode());
 }
 
 // UTILITY FUNCTIONS
--- a/dom/base/test/unit/test_range.js
+++ b/dom/base/test/unit/test_range.js
@@ -4,23 +4,23 @@
 
 const C_i = Components.interfaces;
 
 const UNORDERED_TYPE = C_i.nsIDOMXPathResult.ANY_UNORDERED_NODE_TYPE;
 
 /**
  * Determine if the data node has only ignorable white-space.
  *
- * @return nsIDOMNodeFilter.FILTER_SKIP if it does.
- * @return nsIDOMNodeFilter.FILTER_ACCEPT otherwise.
+ * @return NodeFilter.FILTER_SKIP if it does.
+ * @return NodeFilter.FILTER_ACCEPT otherwise.
  */
 function isWhitespace(aNode) {
   return ((/\S/).test(aNode.nodeValue)) ?
-         C_i.nsIDOMNodeFilter.FILTER_SKIP :
-         C_i.nsIDOMNodeFilter.FILTER_ACCEPT;
+         3 /* NodeFilter.FILTER_SKIP */ :
+         1 /* NodeFilter.FILTER_ACCEPT */;
 }
 
 /**
  * Create a DocumentFragment with cloned children equaling a node's children.
  *
  * @param aNode The node to copy from.
  *
  * @return DocumentFragment node.
@@ -77,57 +77,56 @@ function evalXPathInDocumentFragment(aCo
   var childIndex = 1;
   var bracketIndex = prefix.indexOf("[");
   if (bracketIndex != -1) {
     childIndex = Number(prefix.substring(bracketIndex + 1, prefix.indexOf("]")));
     Assert.ok(childIndex > 0);
     prefix = prefix.substr(0, bracketIndex);
   }
 
-  var targetType = C_i.nsIDOMNodeFilter.SHOW_ELEMENT;
+  var targetType = 1 /* NodeFilter.SHOW_ELEMENT */;
   var targetNodeName = prefix;
   if (prefix.indexOf("processing-instruction(") == 0) {
-    targetType = C_i.nsIDOMNodeFilter.SHOW_PROCESSING_INSTRUCTION;
+    targetType = 0x40 /* NodeFilter.SHOW_PROCESSING_INSTRUCTION */;
     targetNodeName = prefix.substring(prefix.indexOf("(") + 2, prefix.indexOf(")") - 1);
   }
   switch (prefix) {
     case "text()":
-      targetType = C_i.nsIDOMNodeFilter.SHOW_TEXT |
-                   C_i.nsIDOMNodeFilter.SHOW_CDATA_SECTION;
+      targetType = 4 | 8 /* NodeFilter.SHOW_TEXT | NodeFilter.SHOW_CDATA_SECTION*/;
       targetNodeName = null;
       break;
     case "comment()":
-      targetType = C_i.nsIDOMNodeFilter.SHOW_COMMENT;
+      targetType = 0x80 /* NodeFilter.SHOW_COMMENT */;
       targetNodeName = null;
       break;
     case "node()":
-      targetType = C_i.nsIDOMNodeFilter.SHOW_ALL;
+      targetType = 0xFFFFFFFF /* NodeFilter.SHOW_ALL */;
       targetNodeName = null;
   }
 
   var filter = {
     count: 0,
 
-    // nsIDOMNodeFilter
+    // NodeFilter
     acceptNode: function acceptNode(aNode) {
       if (aNode.parentNode != aContextNode) {
         // Don't bother looking at kids either.
-        return C_i.nsIDOMNodeFilter.FILTER_REJECT;
+        return 2 /* NodeFilter.FILTER_REJECT */;
       }
 
       if (targetNodeName && targetNodeName != aNode.nodeName) {
-        return C_i.nsIDOMNodeFilter.FILTER_SKIP;
+        return 3 /* NodeFilter.FILTER_SKIP */;
       }
 
       this.count++;
       if (this.count != childIndex) {
-        return C_i.nsIDOMNodeFilter.FILTER_SKIP;
+        return 3 /* NodeFilter.FILTER_SKIP */;
       }
 
-      return C_i.nsIDOMNodeFilter.FILTER_ACCEPT;
+      return 1 /* NodeFilter.FILTER_ACCEPT */;
     }
   };
 
   // Look for the node matching the step from the document fragment.
   var walker = aContextNode.ownerDocument.createTreeWalker(
                  aContextNode,
                  targetType,
                  filter);
@@ -178,18 +177,18 @@ function getParsedDocument(aPath) {
 
 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,
-                                    C_i.nsIDOMNodeFilter.SHOW_TEXT |
-                                    C_i.nsIDOMNodeFilter.SHOW_CDATA_SECTION,
+                                    4 | 8 /* NodeFilter.SHOW_TEXT |
+					     NodeFilter.SHOW_CDATA_SECTION */,
                                     isWhitespace);
   while (walker.nextNode()) {
     var parent = walker.currentNode.parentNode;
     parent.removeChild(walker.currentNode);
     walker.currentNode = parent;
   }
 
   // Clean out mandatory splits between nodes.
@@ -273,17 +272,17 @@ function do_extract_test(doc) {
       Assert.ok(extractFrag.isEqualNode(cutFragment));
     } else {
       Assert.equal(extractFrag.firstChild, null);
     }
     Assert.ok(baseFrag.isEqualNode(resultFrag));
 
     dump("Ensure the original nodes weren't extracted - test " + i + "\n\n");
     var walker = doc.createTreeWalker(baseFrag,
-				      C_i.nsIDOMNodeFilter.SHOW_ALL,
+				      0xFFFFFFFF /* NodeFilter.SHOW_ALL */,
 				      null);
     var foundStart = false;
     var foundEnd = false;
     do {
       if (walker.currentNode == startContainer) {
         foundStart = true;
       }
 
@@ -306,17 +305,17 @@ function do_extract_test(doc) {
     baseRange = getRange(baseSource, baseFrag);
     var startContainer = baseRange.startContainer;
     var endContainer = baseRange.endContainer;
     baseRange.deleteContents();
     Assert.ok(baseFrag.isEqualNode(resultFrag));
 
     dump("Ensure the original nodes weren't deleted - test " + i + "\n\n");
     walker = doc.createTreeWalker(baseFrag,
-                                  C_i.nsIDOMNodeFilter.SHOW_ALL,
+                                  0xFFFFFFFF /* NodeFilter.SHOW_ALL */,
                                   null);
     foundStart = false;
     foundEnd = false;
     do {
       if (walker.currentNode == startContainer) {
         foundStart = true;
       }
 
--- a/dom/base/test/unit/test_treewalker.js
+++ b/dom/base/test/unit/test_treewalker.js
@@ -13,14 +13,14 @@ function run_test()
 function test_treeWalker_currentNode()
 {
   var XHTMLDocString = '<html xmlns="http://www.w3.org/1999/xhtml">';
   XHTMLDocString += '<body><input/>input</body></html>';
 
   var doc = ParseXML(XHTMLDocString);
 
   var body = doc.getElementsByTagName("body")[0];
-  var filter = I.nsIDOMNodeFilter.SHOW_ELEMENT | I.nsIDOMNodeFilter.SHOW_TEXT;
+  var filter = 1 | 4 /* NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT */;
   var walker = doc.createTreeWalker(body, filter, null);
   walker.currentNode = body.firstChild;
   walker.nextNode();
 }
 
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -15886,28 +15886,28 @@ class CGCallback(CGClass):
         # exception.
         args.append(Argument("JSCompartment*", "aCompartment", "nullptr"))
         # And now insert our template argument.
         argsWithoutThis = list(args)
         args.insert(0, Argument("const T&",  "thisVal"))
         argsWithoutRv.insert(0, Argument("const T&",  "thisVal"))
 
         argnamesWithoutThisAndRv = [arg.name for arg in argsWithoutThisAndRv]
-        argnamesWithoutThisAndRv.insert(rvIndex, "rv");
+        argnamesWithoutThisAndRv.insert(rvIndex, "IgnoreErrors()");
         # If we just leave things like that, and have no actual arguments in the
         # IDL, we will end up trying to call the templated "without rv" overload
         # with "rv" as the thisVal.  That's no good.  So explicitly append the
         # aExceptionHandling and aCompartment values we need to end up matching
         # the signature of our non-templated "with rv" overload.
         argnamesWithoutThisAndRv.extend(["eReportExceptions", "nullptr"])
 
         argnamesWithoutRv = [arg.name for arg in argsWithoutRv]
         # Note that we need to insert at rvIndex + 1, since we inserted a
         # thisVal arg at the start.
-        argnamesWithoutRv.insert(rvIndex + 1, "rv")
+        argnamesWithoutRv.insert(rvIndex + 1, "IgnoreErrors()")
 
         errorReturn = method.getDefaultRetval()
 
         setupCall = fill(
             """
             MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!");
             if (!aExecutionReason) {
               aExecutionReason = "${executionReason}";
@@ -15941,24 +15941,22 @@ class CGCallback(CGClass):
             return ${methodName}(${callArgs});
             """,
             setupCall=setupCall,
             errorReturn=errorReturn,
             methodName=method.name,
             callArgs=", ".join(argnamesWithoutThis))
         bodyWithThisWithoutRv = fill(
             """
-            IgnoredErrorResult rv;
             return ${methodName}(${callArgs});
             """,
             methodName=method.name,
             callArgs=", ".join(argnamesWithoutRv))
         bodyWithoutThisAndRv = fill(
             """
-            IgnoredErrorResult rv;
             return ${methodName}(${callArgs});
             """,
             methodName=method.name,
             callArgs=", ".join(argnamesWithoutThisAndRv))
 
         return [ClassMethod(method.name, method.returnType, args,
                             bodyInHeader=True,
                             templateArgs=["typename T"],
--- a/dom/bindings/ErrorResult.h
+++ b/dom/bindings/ErrorResult.h
@@ -597,16 +597,31 @@ binding_danger::TErrorResult<CleanupPoli
 // A class for use when an ErrorResult should just automatically be ignored.
 // This doesn't inherit from ErrorResult so we don't make two separate calls to
 // SuppressException.
 class IgnoredErrorResult :
     public binding_danger::TErrorResult<binding_danger::JustSuppressCleanupPolicy>
 {
 };
 
+// A class for use when an ErrorResult should just automatically be
+// ignored.  This is designed to be passed as a temporary only, like
+// so:
+//
+//    foo->Bar(IgnoreErrors());
+class IgnoreErrors {
+public:
+  operator ErrorResult&() && { return mInner; }
+private:
+  // We don't use an ErrorResult member here so we don't make two separate calls
+  // to SuppressException (one from us, one from the ErrorResult destructor
+  // after asserting).
+  binding_danger::TErrorResult<binding_danger::JustSuppressCleanupPolicy> mInner;
+};
+
 namespace dom {
 namespace binding_detail {
 class FastErrorResult :
     public mozilla::binding_danger::TErrorResult<
       mozilla::binding_danger::JustAssertCleanupPolicy>
 {
 };
 } // namespace binding_detail
--- a/dom/clients/manager/ClientSource.cpp
+++ b/dom/clients/manager/ClientSource.cpp
@@ -398,18 +398,17 @@ ClientSource::SetController(const Servic
   nsPIDOMWindowInner* window = GetInnerWindow();
   if (window) {
     swc = window->Navigator()->ServiceWorker();
   }
 
   // TODO: Also self.navigator.serviceWorker on workers when its exposed there
 
   if (swc && nsContentUtils::IsSafeToRunScript()) {
-    IgnoredErrorResult ignored;
-    swc->ControllerChanged(ignored);
+    swc->ControllerChanged(IgnoreErrors());
   }
 }
 
 RefPtr<ClientOpPromise>
 ClientSource::Control(const ClientControlledArgs& aArgs)
 {
   NS_ASSERT_OWNINGTHREAD(ClientSource);
 
--- a/dom/clients/manager/ClientSourceOpChild.cpp
+++ b/dom/clients/manager/ClientSourceOpChild.cpp
@@ -49,17 +49,17 @@ ClientSourceOpChild::DoSourceOp(Method a
   // they encounter an error they should just immediately resolve or reject
   // the promise as appropriate.
   MOZ_DIAGNOSTIC_ASSERT(promise);
 
   // Capture 'this' is safe here because we disconnect the promise
   // ActorDestroy() which ensures nethier lambda is called if the
   // actor is destroyed before the source operation completes.
   promise->Then(target, __func__,
-    [this, aArgs] (const mozilla::dom::ClientOpResult& aResult) {
+    [this] (const mozilla::dom::ClientOpResult& aResult) {
       mPromiseRequestHolder.Complete();
       Unused << PClientSourceOpChild::Send__delete__(this, aResult);
     },
     [this] (nsresult aRv) {
       mPromiseRequestHolder.Complete();
       Unused << PClientSourceOpChild::Send__delete__(this, aRv);
     })->Track(mPromiseRequestHolder);
 }
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -2730,18 +2730,17 @@ Console::MaybeExecuteDumpFunctionForTrac
   message.AppendLiteral("\n");
   ExecuteDumpFunction(message);
 }
 
 void
 Console::ExecuteDumpFunction(const nsAString& aMessage)
 {
   if (mDumpFunction) {
-    IgnoredErrorResult rv;
-    mDumpFunction->Call(aMessage, rv);
+    mDumpFunction->Call(aMessage);
     return;
   }
 
   NS_ConvertUTF16toUTF8 str(aMessage);
   MOZ_LOG(nsContentUtils::DOMDumpLog(), LogLevel::Debug, ("%s", str.get()));
 #ifdef ANDROID
   __android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", str.get());
 #endif
--- a/dom/events/DOMEventTargetHelper.cpp
+++ b/dom/events/DOMEventTargetHelper.cpp
@@ -355,42 +355,40 @@ DOMEventTargetHelper::WantsUntrusted(boo
   // We can let listeners on workers to always handle all the events.
   *aRetVal = (doc && !nsContentUtils::IsChromeDoc(doc)) || !NS_IsMainThread();
   return rv;
 }
 
 void
 DOMEventTargetHelper::EventListenerAdded(nsAtom* aType)
 {
-  IgnoredErrorResult rv;
-  EventListenerWasAdded(Substring(nsDependentAtomString(aType), 2), rv);
+  EventListenerWasAdded(Substring(nsDependentAtomString(aType), 2),
+                        IgnoreErrors());
   MaybeUpdateKeepAlive();
 }
 
 void
 DOMEventTargetHelper::EventListenerAdded(const nsAString& aType)
 {
-  IgnoredErrorResult rv;
-  EventListenerWasAdded(aType, rv);
+  EventListenerWasAdded(aType, IgnoreErrors());
   MaybeUpdateKeepAlive();
 }
 
 void
 DOMEventTargetHelper::EventListenerRemoved(nsAtom* aType)
 {
-  IgnoredErrorResult rv;
-  EventListenerWasRemoved(Substring(nsDependentAtomString(aType), 2), rv);
+  EventListenerWasRemoved(Substring(nsDependentAtomString(aType), 2),
+                          IgnoreErrors());
   MaybeUpdateKeepAlive();
 }
 
 void
 DOMEventTargetHelper::EventListenerRemoved(const nsAString& aType)
 {
-  IgnoredErrorResult rv;
-  EventListenerWasRemoved(aType, rv);
+  EventListenerWasRemoved(aType, IgnoreErrors());
   MaybeUpdateKeepAlive();
 }
 
 void
 DOMEventTargetHelper::KeepAliveIfHasListenersFor(const nsAString& aType)
 {
   mKeepingAliveTypes.mStrings.AppendElement(aType);
   MaybeUpdateKeepAlive();
--- a/dom/events/DataTransferItemList.cpp
+++ b/dom/events/DataTransferItemList.cpp
@@ -573,19 +573,18 @@ DataTransferItemList::GenerateFiles(File
 
   uint32_t count = Length();
   for (uint32_t i = 0; i < count; i++) {
     bool found;
     RefPtr<DataTransferItem> item = IndexedGetter(i, found);
     MOZ_ASSERT(found);
 
     if (item->Kind() == DataTransferItem::KIND_FILE) {
-      IgnoredErrorResult rv;
-      RefPtr<File> file = item->GetAsFile(*aFilesPrincipal, rv);
-      if (NS_WARN_IF(rv.Failed() || !file)) {
+      RefPtr<File> file = item->GetAsFile(*aFilesPrincipal, IgnoreErrors());
+      if (NS_WARN_IF(!file)) {
         continue;
       }
       aFiles->Append(file);
     }
   }
 }
 
 } // namespace mozilla
--- a/dom/fetch/InternalHeaders.cpp
+++ b/dom/fetch/InternalHeaders.cpp
@@ -344,18 +344,17 @@ public:
     : mInternalHeaders(aInternalHeaders)
   {
     MOZ_DIAGNOSTIC_ASSERT(mInternalHeaders);
   }
 
   NS_IMETHOD
   VisitHeader(const nsACString& aHeader, const nsACString& aValue) override
   {
-    IgnoredErrorResult result;
-    mInternalHeaders->Append(aHeader, aValue, result);
+    mInternalHeaders->Append(aHeader, aValue, IgnoreErrors());
     return NS_OK;
   }
 };
 
 NS_IMPL_ISUPPORTS(FillHeaders, nsIHttpHeaderVisitor)
 
 } // namespace
 
--- a/dom/html/HTMLButtonElement.cpp
+++ b/dom/html/HTMLButtonElement.cpp
@@ -458,18 +458,17 @@ HTMLButtonElement::SaveState()
 
   return NS_OK;
 }
 
 bool
 HTMLButtonElement::RestoreState(nsPresState* aState)
 {
   if (aState && aState->IsDisabledSet() && !aState->GetDisabled()) {
-    IgnoredErrorResult rv;
-    SetDisabled(false, rv);
+    SetDisabled(false, IgnoreErrors());
   }
 
   return false;
 }
 
 EventStates
 HTMLButtonElement::IntrinsicState() const
 {
--- a/dom/html/HTMLImageElement.cpp
+++ b/dom/html/HTMLImageElement.cpp
@@ -490,18 +490,17 @@ HTMLImageElement::AfterMaybeChangeAttr(i
     if (InResponsiveMode()) {
       // per spec, full selection runs when this changes, even though
       // it doesn't directly affect the source selection
       QueueImageLoadTask(true);
     } else if (OwnerDoc()->ShouldLoadImages()) {
       // Bug 1076583 - We still use the older synchronous algorithm in
       // non-responsive mode. Force a new load of the image with the
       // new cross origin policy
-      IgnoredErrorResult error;
-      ForceReload(aNotify, error);
+      ForceReload(aNotify, IgnoreErrors());
     }
   }
 }
 
 nsresult
 HTMLImageElement::GetEventTargetParent(EventChainPreVisitor& aVisitor)
 {
   // We handle image element with attribute ismap in its corresponding frame
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -743,18 +743,17 @@ nsColorPickerShownCallback::UpdateIntern
 
   nsAutoString oldValue;
   if (aTrustedUpdate) {
     valueChanged = true;
   } else {
     mInput->GetValue(oldValue, CallerType::System);
   }
 
-  IgnoredErrorResult rv;
-  mInput->SetValue(aColor, CallerType::System, rv);
+  mInput->SetValue(aColor, CallerType::System, IgnoreErrors());
 
   if (!aTrustedUpdate) {
     nsAutoString newValue;
     mInput->GetValue(newValue, CallerType::System);
     if (!oldValue.Equals(newValue)) {
       valueChanged = true;
     }
   }
@@ -1888,25 +1887,23 @@ HTMLInputElement::GetList() const
 }
 
 void
 HTMLInputElement::SetValue(Decimal aValue, CallerType aCallerType)
 {
   MOZ_ASSERT(!aValue.isInfinity(), "aValue must not be Infinity!");
 
   if (aValue.isNaN()) {
-    IgnoredErrorResult rv;
-    SetValue(EmptyString(), aCallerType, rv);
+    SetValue(EmptyString(), aCallerType, IgnoreErrors());
     return;
   }
 
   nsAutoString value;
   mInputType->ConvertNumberToString(aValue, value);
-  IgnoredErrorResult rv;
-  SetValue(value, aCallerType, rv);
+  SetValue(value, aCallerType, IgnoreErrors());
 }
 
 Nullable<Date>
 HTMLInputElement::GetValueAsDate(ErrorResult& aRv)
 {
   if (!IsDateTimeInputType(mType)) {
     return Nullable<Date>();
   }
@@ -6686,18 +6683,17 @@ HTMLInputElement::RestoreState(nsPresSta
         // before the type change.)
         SetValueInternal(inputState->GetValue(),
                          nsTextEditorState::eSetValue_Notify);
         break;
     }
   }
 
   if (aState->IsDisabledSet() && !aState->GetDisabled()) {
-    IgnoredErrorResult ignored;
-    SetDisabled(false, ignored);
+    SetDisabled(false, IgnoreErrors());
   }
 
   return restoredCheckedState;
 }
 
 bool
 HTMLInputElement::AllowDrop()
 {
--- a/dom/html/HTMLScriptElement.cpp
+++ b/dom/html/HTMLScriptElement.cpp
@@ -185,18 +185,17 @@ HTMLScriptElement::GetScriptType(nsAStri
 
   aType.Assign(type);
   return true;
 }
 
 void
 HTMLScriptElement::GetScriptText(nsAString& text)
 {
-  IgnoredErrorResult rv;
-  GetText(text, rv);
+  GetText(text, IgnoreErrors());
 }
 
 void
 HTMLScriptElement::GetScriptCharset(nsAString& charset)
 {
   GetCharset(charset);
 }
 
--- a/dom/html/HTMLSelectElement.cpp
+++ b/dom/html/HTMLSelectElement.cpp
@@ -1462,18 +1462,17 @@ HTMLSelectElement::RestoreState(nsPresSt
     RestoreStateTo(state);
 
     // Don't flush, if the frame doesn't exist yet it doesn't care if
     // we're reset or not.
     DispatchContentReset();
   }
 
   if (aState->IsDisabledSet() && !aState->GetDisabled()) {
-    IgnoredErrorResult rv;
-    SetDisabled(false, rv);
+    SetDisabled(false, IgnoreErrors());
   }
 
   return false;
 }
 
 void
 HTMLSelectElement::RestoreStateTo(SelectState* aNewSelected)
 {
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -637,18 +637,17 @@ HTMLTableElement::CreateTHead()
 
       if (refNode->IsHTMLElement() &&
           !refNode->IsHTMLElement(nsGkAtoms::caption) &&
           !refNode->IsHTMLElement(nsGkAtoms::colgroup)) {
         break;
       }
     }
 
-    IgnoredErrorResult rv;
-    nsINode::InsertBefore(*head, refNode, rv);
+    nsINode::InsertBefore(*head, refNode, IgnoreErrors());
   }
   return head.forget();
 }
 
 void
 HTMLTableElement::DeleteTHead()
 {
   HTMLTableSectionElement* tHead = GetTHead();
@@ -700,19 +699,18 @@ HTMLTableElement::CreateCaption()
     nsContentUtils::QNameChanged(mNodeInfo, nsGkAtoms::caption,
                                  getter_AddRefs(nodeInfo));
 
     caption = NS_NewHTMLTableCaptionElement(nodeInfo.forget());
     if (!caption) {
       return nullptr;
     }
 
-    IgnoredErrorResult rv;
     nsCOMPtr<nsINode> firsChild = nsINode::GetFirstChild();
-    nsINode::InsertBefore(*caption, firsChild, rv);
+    nsINode::InsertBefore(*caption, firsChild, IgnoreErrors());
   }
   return caption.forget();
 }
 
 void
 HTMLTableElement::DeleteCaption()
 {
   HTMLTableCaptionElement* caption = GetCaption();
@@ -741,18 +739,17 @@ HTMLTableElement::CreateTBody()
        child;
        child = child->GetPreviousSibling()) {
     if (child->IsHTMLElement(nsGkAtoms::tbody)) {
       referenceNode = child->GetNextSibling();
       break;
     }
   }
 
-  IgnoredErrorResult rv;
-  nsINode::InsertBefore(*newBody, referenceNode, rv);
+  nsINode::InsertBefore(*newBody, referenceNode, IgnoreErrors());
 
   return newBody.forget();
 }
 
 already_AddRefed<nsGenericHTMLElement>
 HTMLTableElement::InsertRow(int32_t aIndex, ErrorResult& aError)
 {
   /* get the ref row at aIndex
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -784,18 +784,17 @@ HTMLTextAreaElement::SetValueFromSetRang
                           nsTextEditorState::eSetValue_ByContent |
                           nsTextEditorState::eSetValue_Notify);
 }
 
 nsresult
 HTMLTextAreaElement::Reset()
 {
   nsAutoString resetVal;
-  IgnoredErrorResult res;
-  GetDefaultValue(resetVal, res);
+  GetDefaultValue(resetVal, IgnoreErrors());
   SetValueChanged(false);
 
   nsresult rv = SetValueInternal(resetVal,
                                  nsTextEditorState::eSetValue_Internal);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
@@ -886,18 +885,17 @@ HTMLTextAreaElement::RestoreState(nsPres
     nsAutoString data;
     state->GetData(data);
     ErrorResult rv;
     SetValue(data, rv);
     ENSURE_SUCCESS(rv, false);
   }
 
   if (aState->IsDisabledSet() && !aState->GetDisabled()) {
-    IgnoredErrorResult rv;
-    SetDisabled(false, rv);
+    SetDisabled(false, IgnoreErrors());
   }
 
   return false;
 }
 
 EventStates
 HTMLTextAreaElement::IntrinsicState() const
 {
@@ -1307,18 +1305,17 @@ HTMLTextAreaElement::GetRows()
   }
 
   return DEFAULT_ROWS_TEXTAREA;
 }
 
 NS_IMETHODIMP_(void)
 HTMLTextAreaElement::GetDefaultValueFromContent(nsAString& aValue)
 {
-  IgnoredErrorResult rv;
-  GetDefaultValue(aValue, rv);
+  GetDefaultValue(aValue, IgnoreErrors());
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTextAreaElement::ValueChanged() const
 {
   return mValueChanged;
 }
 
--- a/dom/html/ImageDocument.cpp
+++ b/dom/html/ImageDocument.cpp
@@ -363,26 +363,20 @@ ImageDocument::ShrinkToFit()
       classList->Remove(NS_LITERAL_STRING("overflowingVertical"), ignored);
     }
     ignored.SuppressException();
     return;
   }
 
   // Keep image content alive while changing the attributes.
   RefPtr<HTMLImageElement> image = HTMLImageElement::FromContent(mImageContent);
-  {
-    IgnoredErrorResult ignored;
-    image->SetWidth(std::max(1, NSToCoordFloor(GetRatio() * mImageWidth)),
-                    ignored);
-  }
-  {
-    IgnoredErrorResult ignored;
-    image->SetHeight(std::max(1, NSToCoordFloor(GetRatio() * mImageHeight)),
-                     ignored);
-  }
+  image->SetWidth(std::max(1, NSToCoordFloor(GetRatio() * mImageWidth)),
+                  IgnoreErrors());
+  image->SetHeight(std::max(1, NSToCoordFloor(GetRatio() * mImageHeight)),
+                   IgnoreErrors());
 
   // The view might have been scrolled when zooming in, scroll back to the
   // origin now that we're showing a shrunk-to-window version.
   ScrollImageTo(0, 0, false);
 
   if (!mImageContent) {
     // ScrollImageTo flush destroyed our content.
     return;
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -2035,22 +2035,20 @@ nsTextEditorState::UnbindFromFrame(nsTex
   // Save our selection state if needed.
   // Note that GetSelectionRange will attempt to work with our selection
   // controller, so we should make sure we do it before we start doing things
   // like destroying our editor (if we have one), tearing down the selection
   // controller, and so forth.
   if (!IsSelectionCached()) {
     // Go ahead and cache it now.
     uint32_t start = 0, end = 0;
-    IgnoredErrorResult rangeRv;
-    GetSelectionRange(&start, &end, rangeRv);
+    GetSelectionRange(&start, &end, IgnoreErrors());
 
-    IgnoredErrorResult dirRv;
     nsITextControlFrame::SelectionDirection direction =
-      GetSelectionDirection(dirRv);
+      GetSelectionDirection(IgnoreErrors());
 
     SelectionProperties& props = GetSelectionProperties();
     props.SetStart(start);
     props.SetEnd(end);
     props.SetDirection(direction);
     HTMLInputElement* number = GetParentNumberControl(aFrame);
     if (number) {
       // If we are inside a number control, cache the selection on the
deleted file mode 100644
--- a/dom/interfaces/traversal/moz.build
+++ /dev/null
@@ -1,17 +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", "DOM: Core & HTML")
-
-XPIDL_SOURCES += [
-    'nsIDOMNodeFilter.idl',
-    'nsIDOMNodeIterator.idl',
-    'nsIDOMTreeWalker.idl',
-]
-
-XPIDL_MODULE = 'dom_traversal'
-
deleted file mode 100644
--- a/dom/interfaces/traversal/nsIDOMNodeFilter.idl
+++ /dev/null
@@ -1,35 +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 "domstubs.idl"
-
-[scriptable, function, uuid(e4723748-1dd1-11b2-8ee6-866a532a6237)]
-// Introduced in DOM Level 2:
-interface nsIDOMNodeFilter : nsISupports
-{
-  // Constants returned by acceptNode
-  const short               FILTER_ACCEPT                  = 1;
-  const short               FILTER_REJECT                  = 2;
-  const short               FILTER_SKIP                    = 3;
-
-
-  // Constants for whatToShow
-  const unsigned long       SHOW_ALL                       = 0xFFFFFFFF;
-  const unsigned long       SHOW_ELEMENT                   = 0x00000001;
-  const unsigned long       SHOW_ATTRIBUTE                 = 0x00000002;
-  const unsigned long       SHOW_TEXT                      = 0x00000004;
-  const unsigned long       SHOW_CDATA_SECTION             = 0x00000008;
-  const unsigned long       SHOW_ENTITY_REFERENCE          = 0x00000010;
-  const unsigned long       SHOW_ENTITY                    = 0x00000020;
-  const unsigned long       SHOW_PROCESSING_INSTRUCTION    = 0x00000040;
-  const unsigned long       SHOW_COMMENT                   = 0x00000080;
-  const unsigned long       SHOW_DOCUMENT                  = 0x00000100;
-  const unsigned long       SHOW_DOCUMENT_TYPE             = 0x00000200;
-  const unsigned long       SHOW_DOCUMENT_FRAGMENT         = 0x00000400;
-  const unsigned long       SHOW_NOTATION                  = 0x00000800;
-
-  short              acceptNode(in nsIDOMNode n);
-};
deleted file mode 100644
--- a/dom/interfaces/traversal/nsIDOMNodeIterator.idl
+++ /dev/null
@@ -1,27 +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 "domstubs.idl"
-
-interface nsIDOMNodeFilter;
-
-[uuid(a86bdac9-ff89-4c94-8160-4fe86733bab8)]
-// Introduced in DOM Level 2, updated to DOM Level 4:
-interface nsIDOMNodeIterator : nsISupports
-{
-  readonly attribute nsIDOMNode       root;
-  readonly attribute unsigned long    whatToShow;
-  readonly attribute nsIDOMNodeFilter filter;
-  nsIDOMNode         nextNode()
-                                        raises(DOMException);
-  nsIDOMNode         previousNode()
-                                        raises(DOMException);
-  void               detach();
-
-  // WebKit extensions, convenient for debugging.
-  readonly attribute nsIDOMNode referenceNode;
-  readonly attribute boolean    pointerBeforeReferenceNode;
-};
deleted file mode 100644
--- a/dom/interfaces/traversal/nsIDOMTreeWalker.idl
+++ /dev/null
@@ -1,27 +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 "domstubs.idl"
-
-interface nsIDOMNodeFilter;
-
-[uuid(c4ffa159-237c-4dde-b0ba-20b9f9270cf6)]
-// Introduced in DOM Level 2:
-interface nsIDOMTreeWalker : nsISupports {
-  readonly attribute nsIDOMNode       root;
-  readonly attribute unsigned long    whatToShow;
-  readonly attribute nsIDOMNodeFilter filter;
-           attribute nsIDOMNode       currentNode;
-                                        // raises(DOMException) on setting
-
-  nsIDOMNode         parentNode();
-  nsIDOMNode         firstChild();
-  nsIDOMNode         lastChild();
-  nsIDOMNode         previousSibling();
-  nsIDOMNode         nextSibling();
-  nsIDOMNode         previousNode();
-  nsIDOMNode         nextNode();
-};
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -667,18 +667,17 @@ void AudioContext::DisconnectFromOwner()
 void
 AudioContext::Shutdown()
 {
   mIsShutDown = true;
 
   // We don't want to touch promises if the global is going away soon.
   if (!mIsDisconnecting) {
     if (!mIsOffline) {
-      IgnoredErrorResult dummy;
-      RefPtr<Promise> ignored = Close(dummy);
+      RefPtr<Promise> ignored = Close(IgnoreErrors());
     }
 
     for (auto p : mPromiseGripArray) {
       p->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
     }
 
     mPromiseGripArray.Clear();
   }
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -15,17 +15,16 @@ JAR_MANIFESTS += ['jar.mn']
 
 interfaces = [
     'base',
     'canvas',
     'core',
     'html',
     'events',
     'sidebar',
-    'traversal',
     'range',
     'xbl',
     'xpath',
     'xul',
     'security',
     'storage',
     'offline',
     'geolocation',
--- a/dom/promise/PromiseDebugging.cpp
+++ b/dom/promise/PromiseDebugging.cpp
@@ -272,34 +272,32 @@ PromiseDebugging::FlushUncaughtRejection
     if (!promise) {
       continue;
     }
 
     for (size_t j = 0; j < observers.Length(); ++j) {
       RefPtr<UncaughtRejectionObserver> obs =
         static_cast<UncaughtRejectionObserver*>(observers[j].get());
 
-      IgnoredErrorResult err;
-      obs->OnLeftUncaught(promise, err);
+      obs->OnLeftUncaught(promise, IgnoreErrors());
     }
     JSAutoCompartment ac(cx, promise);
     Promise::ReportRejectedPromise(cx, promise);
   }
   storage->mUncaughtRejections.clear();
 
   // Notify observers of consumed Promise.
 
   for (size_t i = 0; i < consumed.length(); i++) {
     JS::RootedObject promise(cx, consumed[i]);
 
     for (size_t j = 0; j < observers.Length(); ++j) {
       RefPtr<UncaughtRejectionObserver> obs =
         static_cast<UncaughtRejectionObserver*>(observers[j].get());
 
-      IgnoredErrorResult err;
-      obs->OnConsumed(promise, err);
+      obs->OnConsumed(promise, IgnoreErrors());
     }
   }
   storage->mConsumedRejections.clear();
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/serviceworkers/ServiceWorkerEvents.cpp
+++ b/dom/serviceworkers/ServiceWorkerEvents.cpp
@@ -732,17 +732,17 @@ RespondWithHandler::ResolvedCallback(JSC
                                                           mScriptSpec,
                                                           responseURL,
                                                           Move(closure));
 
   nsCOMPtr<nsIInputStream> body;
   ir->GetUnfilteredBody(getter_AddRefs(body));
   // Errors and redirects may not have a body.
   if (body) {
-    IgnoredErrorResult error;
+    ErrorResult error;
     response->SetBodyUsed(aCx, error);
     if (NS_WARN_IF(error.Failed())) {
       autoCancel.SetCancelErrorResult(aCx, error);
       return;
     }
   }
 
   MOZ_ALWAYS_SUCCEEDS(worker->DispatchToMainThread(startRunnable.forget()));
--- a/dom/serviceworkers/ServiceWorkerScriptCache.cpp
+++ b/dom/serviceworkers/ServiceWorkerScriptCache.cpp
@@ -613,19 +613,18 @@ private:
     ir->SetURLList(aCN->URLList());
 
     ir->InitChannelInfo(aCN->GetChannelInfo());
     UniquePtr<PrincipalInfo> principalInfo = aCN->TakePrincipalInfo();
     if (principalInfo) {
       ir->SetPrincipalInfo(Move(principalInfo));
     }
 
-    IgnoredErrorResult ignored;
     RefPtr<InternalHeaders> internalHeaders = aCN->GetInternalHeaders();
-    ir->Headers()->Fill(*(internalHeaders.get()), ignored);
+    ir->Headers()->Fill(*(internalHeaders.get()), IgnoreErrors());
 
     RefPtr<Response> response =
       new Response(aCache->GetGlobalObject(), ir, nullptr);
 
     RequestOrUSVString request;
     request.SetAsUSVString().Rebind(aCN->URL().Data(), aCN->URL().Length());
 
     // For now we have to wait until the Put Promise is fulfilled before we can
--- a/dom/svg/SVGAnimationElement.cpp
+++ b/dom/svg/SVGAnimationElement.cpp
@@ -381,18 +381,17 @@ SVGAnimationElement::ActivateByHyperlink
       AnimationNeedsResample();
       // As with SVGSVGElement::SetCurrentTime, we need to trigger
       // a synchronous sample now.
       FlushAnimations();
     }
     // else, silently fail. We mustn't be part of an SVG document fragment that
     // is attached to the document tree so there's nothing we can do here
   } else {
-    IgnoredErrorResult rv;
-    BeginElement(rv);
+    BeginElement(IgnoreErrors());
   }
 }
 
 //----------------------------------------------------------------------
 // Implementation helpers
 
 nsSMILTimeContainer*
 SVGAnimationElement::GetTimeContainer()
--- a/dom/svg/SVGUseElement.cpp
+++ b/dom/svg/SVGUseElement.cpp
@@ -253,19 +253,19 @@ SVGUseElement::CreateAnonymousContent()
         return nullptr;
       }
     }
   }
 
   nsNodeInfoManager* nodeInfoManager =
     targetContent->OwnerDoc() == OwnerDoc() ?
       nullptr : OwnerDoc()->NodeInfoManager();
-  IgnoredErrorResult rv;
   nsCOMPtr<nsINode> newnode =
-    nsNodeUtils::Clone(targetContent, true, nodeInfoManager, nullptr, rv);
+    nsNodeUtils::Clone(targetContent, true, nodeInfoManager, nullptr,
+                       IgnoreErrors());
   nsCOMPtr<nsIContent> newcontent = do_QueryInterface(newnode);
 
   if (!newcontent)
     return nullptr;
 
   if (newcontent->IsAnyOfSVGElements(nsGkAtoms::svg, nsGkAtoms::symbol)) {
     nsSVGElement *newElement = static_cast<nsSVGElement*>(newcontent.get());
 
--- a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
+++ b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
@@ -12,32 +12,32 @@
 #include "mozilla/dom/HTMLAnchorElement.h"
 #include "mozilla/dom/HTMLAreaElement.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/HTMLLinkElement.h"
 #include "mozilla/dom/HTMLObjectElement.h"
 #include "mozilla/dom/HTMLOptionElement.h"
 #include "mozilla/dom/HTMLSharedElement.h"
 #include "mozilla/dom/HTMLTextAreaElement.h"
+#include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/dom/TreeWalker.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsContentCID.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDOMAttributeMap.h"
 #include "nsFrameLoader.h"
 #include "nsIComponentRegistrar.h"
 #include "nsIContent.h"
 #include "nsIDOMComment.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLMediaElement.h"
 #include "nsIDOMNode.h"
-#include "nsIDOMNodeFilter.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
 #include "nsIDocumentEncoder.h"
 #include "nsILoadContext.h"
 #include "nsIProtocolHandler.h"
@@ -691,18 +691,17 @@ PersistNodeFixup::FixupAttribute(nsINode
     NS_ConvertASCIItoUTF16 namespaceURI(aNamespaceURI);
     RefPtr<dom::Attr> attr = attrMap->GetNamedItemNS(namespaceURI, attribute);
     nsresult rv = NS_OK;
     if (attr) {
         nsString uri;
         attr->GetValue(uri);
         rv = FixupURI(uri);
         if (NS_SUCCEEDED(rv)) {
-            IgnoredErrorResult err;
-            attr->SetValue(uri, err);
+            attr->SetValue(uri, IgnoreErrors());
         }
     }
 
     return rv;
 }
 
 nsresult
 PersistNodeFixup::FixupAnchor(nsINode *aNode)
@@ -744,18 +743,17 @@ PersistNodeFixup::FixupAnchor(nsINode *a
         nsCOMPtr<nsIURI> newURI;
         nsresult rv = NS_NewURI(getter_AddRefs(newURI), oldCValue,
                                 mParent->GetCharacterSet(), relativeURI);
         if (NS_SUCCEEDED(rv) && newURI) {
             newURI->SetUserPass(EmptyCString());
             nsAutoCString uriSpec;
             rv = newURI->GetSpec(uriSpec);
             NS_ENSURE_SUCCESS(rv, rv);
-            IgnoredErrorResult err;
-            attr->SetValue(NS_ConvertUTF8toUTF16(uriSpec), err);
+            attr->SetValue(NS_ConvertUTF8toUTF16(uriSpec), IgnoreErrors());
         }
     }
 
     return NS_OK;
 }
 
 static void
 AppendXMLAttr(const nsAString& key, const nsAString& aValue, nsAString& aBuffer)
@@ -1123,29 +1121,26 @@ PersistNodeFixup::FixupNode(nsINode* aNo
                 case NS_FORM_INPUT_NUMBER:
                 case NS_FORM_INPUT_RANGE:
                 case NS_FORM_INPUT_DATE:
                 case NS_FORM_INPUT_TIME:
                 case NS_FORM_INPUT_COLOR:
                     nodeAsInput->GetValue(valueStr, dom::CallerType::System);
                     // Avoid superfluous value="" serialization
                     if (valueStr.IsEmpty()) {
-                      IgnoredErrorResult ignored;
-                      outElt->RemoveAttribute(valueAttr, ignored);
+                      outElt->RemoveAttribute(valueAttr, IgnoreErrors());
                     } else {
-                      IgnoredErrorResult ignored;
-                      outElt->SetAttribute(valueAttr, valueStr, ignored);
+                      outElt->SetAttribute(valueAttr, valueStr, IgnoreErrors());
                     }
                     break;
                 case NS_FORM_INPUT_CHECKBOX:
                 case NS_FORM_INPUT_RADIO:
                     {
                         bool checked = nodeAsInput->Checked();
-                        IgnoredErrorResult ignored;
-                        outElt->SetDefaultChecked(checked, ignored);
+                        outElt->SetDefaultChecked(checked, IgnoreErrors());
                     }
                     break;
                 default:
                     break;
             }
         }
         return rv;
     }
@@ -1155,31 +1150,29 @@ PersistNodeFixup::FixupNode(nsINode* aNo
         nsresult rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut) {
             // Tell the document encoder to serialize the text child we create below
             *aSerializeCloneKids = true;
 
             nsAutoString valueStr;
             nodeAsTextArea->GetValue(valueStr);
 
-            IgnoredErrorResult err;
-            (*aNodeOut)->SetTextContent(valueStr, err);
+            (*aNodeOut)->SetTextContent(valueStr, IgnoreErrors());
         }
         return rv;
     }
 
     dom::HTMLOptionElement* nodeAsOption = dom::HTMLOptionElement::FromContent(content);
     if (nodeAsOption) {
         nsresult rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut) {
             dom::HTMLOptionElement* outElt =
                 dom::HTMLOptionElement::FromContent((*aNodeOut)->AsContent());
             bool selected = nodeAsOption->Selected();
-            IgnoredErrorResult ignored;
-            outElt->SetDefaultSelected(selected, ignored);
+            outElt->SetDefaultSelected(selected, IgnoreErrors());
         }
         return rv;
     }
 
     return NS_OK;
 }
 
 } // unnamed namespace
@@ -1188,41 +1181,43 @@ NS_IMETHODIMP
 WebBrowserPersistLocalDocument::ReadResources(nsIWebBrowserPersistResourceVisitor* aVisitor)
 {
     nsresult rv = NS_OK;
     nsCOMPtr<nsIWebBrowserPersistResourceVisitor> visitor = aVisitor;
 
     NS_ENSURE_TRUE(mDocument, NS_ERROR_FAILURE);
 
     ErrorResult err;
-    nsCOMPtr<nsIDOMTreeWalker> walker =
+    RefPtr<dom::TreeWalker> walker =
         mDocument->CreateTreeWalker(*mDocument,
-            nsIDOMNodeFilter::SHOW_ELEMENT |
-            nsIDOMNodeFilter::SHOW_DOCUMENT |
-            nsIDOMNodeFilter::SHOW_PROCESSING_INSTRUCTION,
+            dom::NodeFilterBinding::SHOW_ELEMENT |
+            dom::NodeFilterBinding::SHOW_DOCUMENT |
+            dom::NodeFilterBinding::SHOW_PROCESSING_INSTRUCTION,
             nullptr, err);
 
     if (NS_WARN_IF(err.Failed())) {
         return err.StealNSResult();
     }
     MOZ_ASSERT(walker);
 
     RefPtr<ResourceReader> reader = new ResourceReader(this, aVisitor);
-    nsCOMPtr<nsIDOMNode> currentNode;
-    walker->GetCurrentNode(getter_AddRefs(currentNode));
-    while (currentNode) {
-        rv = reader->OnWalkDOMNode(currentNode);
+    nsCOMPtr<nsINode> currentNode = walker->CurrentNode();
+    do {
+        rv = reader->OnWalkDOMNode(currentNode->AsDOMNode());
         if (NS_WARN_IF(NS_FAILED(rv))) {
             break;
         }
-        rv = walker->NextNode(getter_AddRefs(currentNode));
-        if (NS_WARN_IF(NS_FAILED(rv))) {
+
+        ErrorResult err;
+        currentNode = walker->NextNode(err);
+        if (NS_WARN_IF(err.Failed())) {
+            err.SuppressException();
             break;
         }
-    }
+    } while (currentNode);
     reader->DocumentDone(rv);
     // If NS_FAILED(rv), it was / will be reported by an EndVisit call
     // via DocumentDone.  This method must return a failure if and
     // only if visitor won't be invoked.
     return NS_OK;
 }
 
 static uint32_t
--- a/dom/webidl/PeerConnectionImpl.webidl
+++ b/dom/webidl/PeerConnectionImpl.webidl
@@ -48,53 +48,60 @@ interface PeerConnectionImpl  {
   [Throws]
   boolean checkNegotiationNeeded();
   [Throws]
   void insertDTMF(TransceiverImpl transceiver, DOMString tones,
                   optional unsigned long duration = 100,
                   optional unsigned long interToneGap = 70);
   [Throws]
   DOMString getDTMFToneBuffer(RTCRtpSender sender);
+  [Throws]
   sequence<RTCRtpSourceEntry> getRtpSources(MediaStreamTrack track,
                                             DOMHighResTimeStamp rtpSourceNow);
   DOMHighResTimeStamp getNowInRtpSourceReferenceTime();
 
   [Throws]
   void replaceTrackNoRenegotiation(TransceiverImpl transceiverImpl,
                                    MediaStreamTrack? withTrack);
   [Throws]
   void closeStreams();
 
+  [Throws]
   void addRIDExtension(MediaStreamTrack recvTrack, unsigned short extensionId);
+  [Throws]
   void addRIDFilter(MediaStreamTrack recvTrack, DOMString rid);
 
   // Inserts CSRC data for the RtpSourceObserver for testing
+  [Throws]
   void insertAudioLevelForContributingSource(MediaStreamTrack recvTrack,
                                              unsigned long source,
                                              DOMHighResTimeStamp timestamp,
                                              boolean hasLevel,
                                              byte level);
 
+  [Throws]
   void enablePacketDump(unsigned long level,
                         mozPacketDumpType type,
                         boolean sending);
 
+  [Throws]
   void disablePacketDump(unsigned long level,
                          mozPacketDumpType type,
                          boolean sending);
 
   /* As the ICE candidates roll in this one should be called each time
    * in order to keep the candidate list up-to-date for the next SDP-related
    * call PeerConnectionImpl does not parse ICE candidates, just sticks them
    * into the SDP.
    */
   [Throws]
   void addIceCandidate(DOMString candidate, DOMString mid, unsigned short level);
 
   /* Puts the SIPCC engine back to 'kIdle', shuts down threads, deletes state */
+  [Throws]
   void close();
 
   /* Notify DOM window if this plugin crash is ours. */
   boolean pluginCrash(unsigned long long pluginId, DOMString name);
 
   /* Attributes */
   /* This provides the implementation with the certificate it uses to
    * authenticate itself.  The JS side must set this before calling
@@ -110,16 +117,17 @@ interface PeerConnectionImpl  {
   readonly attribute DOMString currentRemoteDescription;
   readonly attribute DOMString pendingRemoteDescription;
 
   readonly attribute PCImplIceConnectionState iceConnectionState;
   readonly attribute PCImplIceGatheringState iceGatheringState;
   readonly attribute PCImplSignalingState signalingState;
   attribute DOMString id;
 
+  [SetterThrows]
   attribute DOMString peerIdentity;
   readonly attribute boolean privacyRequested;
 
   /* Data channels */
   [Throws]
   DataChannel createDataChannel(DOMString label, DOMString protocol,
     unsigned short type, boolean ordered,
     unsigned short maxTime, unsigned short maxNum,
--- a/dom/webidl/Worker.webidl
+++ b/dom/webidl/Worker.webidl
@@ -8,17 +8,16 @@
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera
  * Software ASA.
  * You are granted a license to use, reproduce and create derivative works of
  * this document.
  */
 
 [Constructor(USVString scriptURL, optional WorkerOptions options),
- Func="mozilla::dom::WorkerPrivate::WorkerAvailable",
  Exposed=(Window,DedicatedWorker,SharedWorker,System)]
 interface Worker : EventTarget {
   void terminate();
 
   [Throws]
   void postMessage(any message, optional sequence<object> transfer = []);
 
   attribute EventHandler onmessage;
--- a/dom/workers/ScriptLoader.cpp
+++ b/dom/workers/ScriptLoader.cpp
@@ -1644,18 +1644,17 @@ CacheCreator::DeleteCache()
 {
   AssertIsOnMainThread();
 
   // This is called when the load is canceled which can occur before
   // mCacheStorage is initialized.
   if (mCacheStorage) {
     // It's safe to do this while Cache::Match() and Cache::Put() calls are
     // running.
-    IgnoredErrorResult rv;
-    RefPtr<Promise> promise = mCacheStorage->Delete(mCacheName, rv);
+    RefPtr<Promise> promise = mCacheStorage->Delete(mCacheName, IgnoreErrors());
 
     // We don't care to know the result of the promise object.
   }
 
   // Always call this here to ensure the loaders array is cleared.
   FailLoaders(NS_ERROR_FAILURE);
 }
 
@@ -1776,23 +1775,22 @@ CacheScriptLoader::ResolvedCallback(JSCo
   rv = UNWRAP_OBJECT(Response, &obj, response);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     Fail(rv);
     return;
   }
 
   InternalHeaders* headers = response->GetInternalHeaders();
 
-  IgnoredErrorResult ignored;
   headers->Get(NS_LITERAL_CSTRING("content-security-policy"),
-               mCSPHeaderValue, ignored);
+               mCSPHeaderValue, IgnoreErrors());
   headers->Get(NS_LITERAL_CSTRING("content-security-policy-report-only"),
-               mCSPReportOnlyHeaderValue, ignored);
+               mCSPReportOnlyHeaderValue, IgnoreErrors());
   headers->Get(NS_LITERAL_CSTRING("referrer-policy"),
-               mReferrerPolicyHeaderValue, ignored);
+               mReferrerPolicyHeaderValue, IgnoreErrors());
 
   nsCOMPtr<nsIInputStream> inputStream;
   response->GetBody(getter_AddRefs(inputStream));
   mChannelInfo = response->GetChannelInfo();
   const UniquePtr<PrincipalInfo>& pInfo = response->GetPrincipalInfo();
   if (pInfo) {
     mPrincipalInfo = mozilla::MakeUnique<PrincipalInfo>(*pInfo);
   }
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -68,18 +68,16 @@
 #endif
 
 // JS_MaybeGC will run once every second during normal execution.
 #define PERIODIC_GC_TIMER_DELAY_SEC 1
 
 // A shrinking GC will run five seconds after the last event is processed.
 #define IDLE_GC_TIMER_DELAY_SEC 5
 
-#define PREF_WORKERS_ENABLED "dom.workers.enabled"
-
 static mozilla::LazyLogModule sWorkerPrivateLog("WorkerPrivate");
 static mozilla::LazyLogModule sWorkerTimeoutsLog("WorkerTimeouts");
 
 mozilla::LogModule*
 WorkerLog()
 {
   return sWorkerPrivateLog;
 }
@@ -2965,34 +2963,16 @@ WorkerPrivate::Constructor(const GlobalO
                            ErrorResult& aRv)
 {
   return WorkerPrivate::Constructor(aGlobal, aScriptURL, false,
                                     WorkerTypeDedicated,
                                     aOptions.mName, nullptr, aRv);
 }
 
 // static
-bool
-WorkerPrivate::WorkerAvailable(JSContext* aCx, JSObject* /* unused */)
-{
-  // If we're already on a worker workers are clearly enabled.
-  if (!NS_IsMainThread()) {
-    return true;
-  }
-
-  // If our caller is chrome, workers are always available.
-  if (nsContentUtils::IsSystemCaller(aCx)) {
-    return true;
-  }
-
-  // Else check the pref.
-  return Preferences::GetBool(PREF_WORKERS_ENABLED);
-}
-
-// static
 already_AddRefed<ChromeWorkerPrivate>
 ChromeWorkerPrivate::Constructor(const GlobalObject& aGlobal,
                                  const nsAString& aScriptURL,
                                  ErrorResult& aRv)
 {
   return WorkerPrivate::Constructor(aGlobal, aScriptURL, true,
                                     WorkerTypeDedicated, EmptyString(),
                                     nullptr, aRv)
--- a/dom/workers/WorkerPrivate.h
+++ b/dom/workers/WorkerPrivate.h
@@ -973,19 +973,16 @@ public:
               WorkerLoadInfo* aLoadInfo, ErrorResult& aRv);
 
   static already_AddRefed<WorkerPrivate>
   Constructor(JSContext* aCx, const nsAString& aScriptURL, bool aIsChromeWorker,
               WorkerType aWorkerType, const nsAString& aWorkerName,
               const nsACString& aServiceWorkerScope,
               WorkerLoadInfo* aLoadInfo, ErrorResult& aRv);
 
-  static bool
-  WorkerAvailable(JSContext* /* unused */, JSObject* /* unused */);
-
   enum LoadGroupBehavior
   {
     InheritLoadGroup,
     OverrideLoadGroup
   };
 
   static nsresult
   GetLoadInfo(JSContext* aCx, nsPIDOMWindowInner* aWindow,
--- a/dom/workers/test/chrome.ini
+++ b/dom/workers/test/chrome.ini
@@ -47,17 +47,16 @@ support-files =
   filePosting_worker.js
   fileReadSlice_worker.js
   fileReaderSyncErrors_worker.js
   fileReaderSync_worker.js
   fileSlice_worker.js
   fileSubWorker_worker.js
   file_worker.js
   sharedWorker_privateBrowsing.js
-  workersDisabled_worker.js
 
 [test_WorkerDebugger.initialize.xul]
 [test_WorkerDebugger.postMessage.xul]
 [test_WorkerDebugger.xul]
 [test_WorkerDebuggerGlobalScope.createSandbox.xul]
 [test_WorkerDebuggerGlobalScope.enterEventLoop.xul]
 [test_WorkerDebuggerGlobalScope.reportError.xul]
 skip-if = (os == 'linux') # Bug 1244697
@@ -76,11 +75,10 @@ skip-if = (os == 'linux') # Bug 1244409
 [test_fileBlobPosting.xul]
 [test_fileBlobSubWorker.xul]
 [test_filePosting.xul]
 [test_fileReadSlice.xul]
 [test_fileReaderSync.xul]
 [test_fileReaderSyncErrors.xul]
 [test_fileSlice.xul]
 [test_fileSubWorker.xul]
-[test_workersDisabled.xul]
 [test_bug1062920.xul]
 [test_sharedWorker_privateBrowsing.html]
--- a/dom/workers/test/mochitest.ini
+++ b/dom/workers/test/mochitest.ini
@@ -67,17 +67,16 @@ support-files =
   threadErrors_worker1.js
   threadErrors_worker2.js
   threadErrors_worker3.js
   threadErrors_worker4.js
   threadTimeouts_worker.js
   throwingOnerror_worker.js
   timeoutTracing_worker.js
   transferable_worker.js
-  workersDisabled_worker.js
   test_worker_interfaces.js
   worker_driver.js
   worker_wrapper.js
   bug1060621_worker.js
   bug1062920_worker.js
   bug1104064_worker.js
   worker_consoleAndBlobs.js
   bug1132395_sharedWorker.js
@@ -180,17 +179,16 @@ support-files =
 [test_threadErrors.html]
 [test_threadTimeouts.html]
 [test_throwingOnerror.html]
 [test_timeoutTracing.html]
 [test_transferable.html]
 [test_worker_interfaces.html]
 [test_worker_interfaces_secureContext.html]
 scheme=https
-[test_workersDisabled.html]
 [test_referrer.html]
 [test_referrer_header_worker.html]
 [test_importScripts_3rdparty.html]
 [test_sharedWorker_ports.html]
 [test_sharedWorker_lifetime.html]
 [test_navigator_workers_hardwareConcurrency.html]
 [test_bug1278777.html]
 [test_setTimeoutWith0.html]
deleted file mode 100644
--- a/dom/workers/test/test_workersDisabled.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js">
-    </script>
-    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  </head>
-  <body>
-    <script type="text/javascript">
-      SimpleTest.waitForExplicitFinish();
-
-      const enabledPref = "dom.workers.enabled";
-
-      is(SpecialPowers.getBoolPref(enabledPref), true,
-         "Workers should be enabled.");
-
-      SpecialPowers.pushPrefEnv({"set": [[enabledPref, false]]}, test1);
-
-      function test1() {
-        ok(!("Worker" in window), "Worker constructor should not be available.");
-
-        var exception;
-        try {
-          var worker = new Worker("workersDisabled_worker.js");
-        }
-        catch(e) {
-          exception = e;
-        }
-
-        ok(exception, "Shouldn't be able to make a worker.");
-
-        SpecialPowers.pushPrefEnv({"set": [[enabledPref, true]]}, test2);
-      }
-
-      function test2() {
-        ok(("Worker" in window), "Worker constructor should be available.");
-
-        const message = "Hi";
-
-        var worker = new Worker("workersDisabled_worker.js");
-        worker.onmessage = function(event) {
-          is(event.data, message, "Good message.");
-          SimpleTest.finish();
-        }
-        worker.postMessage(message);
-      }
-    </script>
-  </body>
-</html>
-
deleted file mode 100644
--- a/dom/workers/test/test_workersDisabled.xul
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<window title="DOM Worker Threads Test"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="test();">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-  <script type="application/javascript" src="dom_worker_helper.js"/>
-
-  <script type="application/javascript">
-  <![CDATA[
-    function test()
-    {
-      const enabledPref = "dom.workers.enabled";
-      const message = "Hi";
-
-      var prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                            .getService(Components.interfaces.nsIPrefBranch);
-      is(prefs.getBoolPref(enabledPref), true, "Workers should be enabled.");
-
-      prefs.setBoolPref(enabledPref, false);
-
-      ok("Worker" in window, "Worker constructor should be available.");
-      ok("ChromeWorker" in window,
-         "ChromeWorker constructor should be available.");
-
-      var worker = new ChromeWorker("workersDisabled_worker.js");
-      worker.onmessage = function(event) {
-        is(event.data, message, "Good message.");
-        prefs.clearUserPref(enabledPref);
-        finish();
-      }
-      worker.postMessage(message);
-
-      waitForWorkerFinish();
-    }
-  ]]>
-  </script>
-
-  <body xmlns="http://www.w3.org/1999/xhtml">
-    <p id="display"></p>
-    <div id="content" style="display:none;"></div>
-    <pre id="test"></pre>
-  </body>
-  <label id="test-result"/>
-</window>
deleted file mode 100644
--- a/dom/workers/test/workersDisabled_worker.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-onmessage = function(event) {
-  postMessage(event.data);
-}
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -316,19 +316,19 @@ nsXBLBinding::GenerateAnonymousContent()
   // using the attribute-setting shorthand hack.
   uint32_t contentCount = content->GetChildCount();
 
   // Plan to build the content by default.
   bool hasContent = (contentCount > 0);
   if (hasContent) {
     nsIDocument* doc = mBoundElement->OwnerDoc();
 
-    IgnoredErrorResult rv;
     nsCOMPtr<nsINode> clonedNode =
-      nsNodeUtils::Clone(content, true, doc->NodeInfoManager(), nullptr, rv);
+      nsNodeUtils::Clone(content, true, doc->NodeInfoManager(), nullptr,
+                         IgnoreErrors());
     // FIXME: Bug 1399558, Why is this code OK assuming that nsNodeUtils::Clone
     // never fails?
     mContent = clonedNode->AsElement();
 
     // Search for <xbl:children> elements in the XBL content. In the presence
     // of multiple default insertion points, we use the last one in document
     // order.
     for (nsIContent* child = mContent; child; child = child->GetNextNode(mContent)) {
--- a/dom/xbl/nsXBLPrototypeHandler.cpp
+++ b/dom/xbl/nsXBLPrototypeHandler.cpp
@@ -670,18 +670,17 @@ nsXBLPrototypeHandler::GetController(Eve
   // XXX Fix this so there's a generic interface that describes controllers,
   // This code should have no special knowledge of what objects might have controllers.
   nsCOMPtr<nsIControllers> controllers;
 
   nsCOMPtr<nsIContent> targetContent(do_QueryInterface(aTarget));
   RefPtr<nsXULElement> xulElement =
     nsXULElement::FromContentOrNull(targetContent);
   if (xulElement) {
-    IgnoredErrorResult rv;
-    controllers = xulElement->GetControllers(rv);
+    controllers = xulElement->GetControllers(IgnoreErrors());
   }
 
   if (!controllers) {
     HTMLTextAreaElement* htmlTextArea = HTMLTextAreaElement::FromContent(targetContent);
     if (htmlTextArea)
       htmlTextArea->GetControllers(getter_AddRefs(controllers));
   }
 
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -874,18 +874,17 @@ nsXULElement::RemoveChildAt_Deprecated(u
           }
         }
 
         nsCOMPtr<nsIDOMXULSelectControlItemElement> curItem;
         controlElement->GetCurrentItem(getter_AddRefs(curItem));
         nsCOMPtr<nsIContent> curNode = do_QueryInterface(curItem);
         if (curNode && nsContentUtils::ContentIsDescendantOf(curNode, oldKid)) {
             // Current item going away
-            IgnoredErrorResult ignored;
-            nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(ignored);
+            nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(IgnoreErrors());
             listBox = do_QueryInterface(box);
             if (listBox && oldKidElem) {
               listBox->GetIndexOfItem(oldKidElem, &newCurrentIndex);
             }
 
             // If any of this fails, we'll just set the current item to null
             if (newCurrentIndex == -1)
               newCurrentIndex = -2;
@@ -969,18 +968,17 @@ nsXULElement::RemoveChildNode(nsIContent
           }
         }
 
         nsCOMPtr<nsIDOMXULSelectControlItemElement> curItem;
         controlElement->GetCurrentItem(getter_AddRefs(curItem));
         nsCOMPtr<nsIContent> curNode = do_QueryInterface(curItem);
         if (curNode && nsContentUtils::ContentIsDescendantOf(curNode, aKid)) {
             // Current item going away
-            IgnoredErrorResult ignored;
-            nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(ignored);
+            nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(IgnoreErrors());
             listBox = do_QueryInterface(box);
             if (listBox && oldKidElem) {
               listBox->GetIndexOfItem(oldKidElem, &newCurrentIndex);
             }
 
             // If any of this fails, we'll just set the current item to null
             if (newCurrentIndex == -1)
               newCurrentIndex = -2;
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -4297,21 +4297,21 @@ EditorBase::SplitNodeDeep(nsIContent& aM
     nsIContent* currentRightNode = atStartOfRightNode.GetContainerAsContent();
 
     // If the split point is middle of the node or the node is not a text node
     // and we're allowed to create empty element node, split it.
     if ((aSplitAtEdges == SplitAtEdges::eAllowToCreateEmptyContainer &&
          !atStartOfRightNode.GetContainerAsText()) ||
         (!atStartOfRightNode.IsStartOfContainer() &&
          !atStartOfRightNode.IsEndOfContainer())) {
-      IgnoredErrorResult error;
+      ErrorResult error;
       nsCOMPtr<nsIContent> newLeftNode =
         SplitNode(atStartOfRightNode.AsRaw(), error);
       if (NS_WARN_IF(error.Failed())) {
-        return SplitNodeResult(NS_ERROR_FAILURE);
+        return SplitNodeResult(error.StealNSResult());
       }
 
       if (currentRightNode == &aMostAncestorToSplit) {
         // Actually, we split aMostAncestorToSplit.
         return SplitNodeResult(newLeftNode, &aMostAncestorToSplit);
       }
 
       // Then, try to split its parent before current node.
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -6641,21 +6641,21 @@ HTMLEditRules::GetNodesFromPoint(
                  EditAction aOperation,
                  nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
                  TouchContent aTouchContent)
 {
   if (NS_WARN_IF(!aPoint.IsSet())) {
     return NS_ERROR_INVALID_ARG;
   }
   RefPtr<nsRange> range = new nsRange(aPoint.GetContainer());
-  IgnoredErrorResult error;
+  ErrorResult error;
   range->SetStart(aPoint, error);
-  if (NS_WARN_IF(error.Failed())) {
-    MOZ_ASSERT(!error.Failed());
-  }
+  // error will assert on failure, because we are not cleaning it up,
+  // but we're asserting in that case anyway.
+  MOZ_ASSERT(!error.Failed());
 
   // Expand the range to include adjacent inlines
   PromoteRange(*range, aOperation);
 
   // Make array of ranges
   nsTArray<RefPtr<nsRange>> arrayOfRanges;
 
   // Stuff new opRange into array
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -2093,18 +2093,17 @@ HTMLEditor::CreateDOMFragmentFromPaste(c
                      aTrustedInput);
   NS_ENSURE_SUCCESS(rv, rv);
   NS_ENSURE_TRUE(fragment, NS_ERROR_FAILURE);
 
   RemoveBodyAndHead(*fragment);
 
   if (contextAsNode) {
     // unite the two trees
-    IgnoredErrorResult ignored;
-    contextLeafAsContent->AppendChild(*fragment, ignored);
+    contextLeafAsContent->AppendChild(*fragment, IgnoreErrors());
     fragment = contextAsNode;
   }
 
   rv = StripFormattingNodes(*fragment, true);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // If there was no context, then treat all of the data we did get as the
   // pasted data.
--- a/editor/libeditor/TextEditRules.cpp
+++ b/editor/libeditor/TextEditRules.cpp
@@ -11,32 +11,32 @@
 #include "mozilla/EditAction.h"
 #include "mozilla/EditorDOMPoint.h"
 #include "mozilla/EditorUtils.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TextComposition.h"
 #include "mozilla/TextEditor.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/NodeIterator.h"
 #include "mozilla/dom/Selection.h"
 #include "nsAString.h"
 #include "nsCOMPtr.h"
 #include "nsCRT.h"
 #include "nsCRTGlue.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsIContent.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMNode.h"
-#include "nsIDOMNodeFilter.h"
 #include "nsNameSpaceManager.h"
 #include "nsINode.h"
 #include "nsIPlaintextEditor.h"
 #include "nsISupportsBase.h"
 #include "nsLiteralString.h"
 #include "nsTextNode.h"
 #include "nsUnicharUtils.h"
 #include "nsIHTMLCollection.h"
@@ -524,21 +524,19 @@ GetTextNode(Selection* selection)
   nsCOMPtr<nsINode> selNode;
   nsresult rv =
     EditorBase::GetStartNodeAndOffset(selection,
                                       getter_AddRefs(selNode), &selOffset);
   NS_ENSURE_SUCCESS(rv, nullptr);
   if (!EditorBase::IsTextNode(selNode)) {
     // This should be the root node, walk the tree looking for text nodes
     RefPtr<NodeIterator> iter =
-      new NodeIterator(selNode, nsIDOMNodeFilter::SHOW_TEXT,
-                       NodeFilterHolder());
+      new NodeIterator(selNode, NodeFilterBinding::SHOW_TEXT, nullptr);
     while (!EditorBase::IsTextNode(selNode)) {
-      IgnoredErrorResult rv;
-      selNode = iter->NextNode(rv);
+      selNode = iter->NextNode(IgnoreErrors());
       if (!selNode) {
         return nullptr;
       }
     }
   }
   return selNode.forget();
 }
 #ifdef DEBUG
--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp
@@ -533,17 +533,16 @@ NS_INTERFACE_MAP_BEGIN(mozInlineSpellChe
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(mozInlineSpellChecker)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(mozInlineSpellChecker)
 
 NS_IMPL_CYCLE_COLLECTION(mozInlineSpellChecker,
                          mTextEditor,
                          mSpellCheck,
-                         mTreeWalker,
                          mCurrentSelectionAnchorNode)
 
 mozInlineSpellChecker::SpellCheckingState
   mozInlineSpellChecker::gCanEnableSpellChecking =
   mozInlineSpellChecker::SpellCheck_Uninitialized;
 
 mozInlineSpellChecker::mozInlineSpellChecker() :
     mNumWordsInSpellSelection(0),
--- a/extensions/spellcheck/src/mozInlineSpellChecker.h
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.h
@@ -3,17 +3,16 @@
  * 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_mozInlineSpellChecker_h
 #define mozilla_mozInlineSpellChecker_h
 
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMEventListener.h"
-#include "nsIDOMTreeWalker.h"
 #include "nsIEditorSpellCheck.h"
 #include "nsIInlineSpellChecker.h"
 #include "nsRange.h"
 #include "nsWeakReference.h"
 
 class InitEditorSpellCheckCallback;
 class mozInlineSpellWordUtil;
 class mozInlineSpellChecker;
@@ -125,17 +124,16 @@ private:
   enum SpellCheckingState { SpellCheck_Uninitialized = -1,
                             SpellCheck_NotAvailable = 0,
                             SpellCheck_Available = 1};
   static SpellCheckingState gCanEnableSpellChecking;
 
   RefPtr<mozilla::TextEditor> mTextEditor;
   RefPtr<mozilla::EditorSpellCheck> mSpellCheck;
   RefPtr<mozilla::EditorSpellCheck> mPendingSpellCheck;
-  nsCOMPtr<nsIDOMTreeWalker> mTreeWalker;
   nsCOMPtr<mozISpellI18NUtil> mConverter;
 
   int32_t mNumWordsInSpellSelection;
   int32_t mMaxNumWordsInSpellSelection;
 
   // How many misspellings we can add at once. This is often less than the max
   // total number of misspellings. When you have a large textarea prepopulated
   // with text with many misspellings, we can hit this limit. By making it
--- a/ipc/glue/IPCMessageUtils.h
+++ b/ipc/glue/IPCMessageUtils.h
@@ -63,16 +63,22 @@ struct void_t {
   bool operator==(const void_t&) const { return true; }
 };
 struct null_t {
   bool operator==(const null_t&) const { return true; }
 };
 
 struct SerializedStructuredCloneBuffer final
 {
+  SerializedStructuredCloneBuffer() {}
+  SerializedStructuredCloneBuffer(const SerializedStructuredCloneBuffer& aOther)
+  {
+    *this = aOther;
+  }
+
   SerializedStructuredCloneBuffer&
   operator=(const SerializedStructuredCloneBuffer& aOther)
   {
     data.Clear();
     auto iter = aOther.data.Iter();
     while (!iter.Done()) {
       data.WriteBytes(iter.Data(), iter.RemainingInSegment());
       iter.Advance(aOther.data, iter.RemainingInSegment());
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -4,17 +4,17 @@
 
 import os, re, sys
 from copy import deepcopy
 from collections import OrderedDict
 
 import ipdl.ast
 import ipdl.builtin
 from ipdl.cxx.ast import *
-from ipdl.type import ActorType, TypeVisitor, builtinHeaderIncludes
+from ipdl.type import ActorType, UnionType, TypeVisitor, builtinHeaderIncludes
 
 ##-----------------------------------------------------------------------------
 ## "Public" interface to lowering
 ##
 class LowerToCxx:
     def lower(self, tu, segmentcapacitydict):
         '''returns |[ header: File ], [ cpp : File ]| representing the
 lowered form of |tu|'''
@@ -597,23 +597,32 @@ def _cxxConstRefType(ipdltype, side):
     return t
 
 def _cxxTypeNeedsMove(ipdltype):
     return ipdltype.isIPDL() and (ipdltype.isArray() or
                                   ipdltype.isShmem() or
                                   ipdltype.isByteBuf() or
                                   ipdltype.isEndpoint())
 
+def _cxxTypeCanMove(ipdltype):
+    return not (ipdltype.isIPDL() and ipdltype.isActor())
+
 def _cxxMoveRefType(ipdltype, side):
     t = _cxxBareType(ipdltype, side)
     if _cxxTypeNeedsMove(ipdltype):
         t.ref = 2
         return t
     return _cxxConstRefType(ipdltype, side)
 
+def _cxxForceMoveRefType(ipdltype, side):
+    assert _cxxTypeCanMove(ipdltype)
+    t = _cxxBareType(ipdltype, side)
+    t.ref = 2
+    return t
+
 def _cxxPtrToType(ipdltype, side):
     t = _cxxBareType(ipdltype, side)
     if ipdltype.isIPDL() and ipdltype.isActor():
         t.ptr = 0
         t.ptrptr = 1
         return t
     t.ptr = 1
     return t
@@ -692,50 +701,50 @@ necessarily a C++ reference."""
         """Return this decl's C++ Type with outparam semantics."""
         t = self.bareType(side)
         if self.ipdltype.isIPDL() and self.ipdltype.isActor():
             t.ptr = 0;  t.ptrptr = 1
             return t
         t.ptr = 1
         return t
 
+    def forceMoveType(self, side):
+        """Return this decl's C++ Type with forced move semantics."""
+        assert _cxxTypeCanMove(self.ipdltype)
+        return _cxxForceMoveRefType(self.ipdltype, side)
+
 ##--------------------------------------------------
 
 class HasFQName:
     def fqClassName(self):
         return self.decl.type.fullname()
 
 class _CompoundTypeComponent(_HybridDecl):
     def __init__(self, ipdltype, name, side, ct):
         _HybridDecl.__init__(self, ipdltype, name)
         self.side = side
         self.special = _hasVisibleActor(ipdltype)
-        self.recursive = ct.decl.type.mutuallyRecursiveWith(ipdltype)
-
-    def internalType(self):
-        if self.recursive:
-            return self.ptrToType()
-        else:
-            return self.bareType()
 
     # @override the following methods to pass |self.side| instead of
     # forcing the caller to remember which side we're declared to
     # represent.
     def bareType(self, side=None):
         return _HybridDecl.bareType(self, self.side)
     def refType(self, side=None):
         return _HybridDecl.refType(self, self.side)
     def constRefType(self, side=None):
         return _HybridDecl.constRefType(self, self.side)
     def ptrToType(self, side=None):
         return _HybridDecl.ptrToType(self, self.side)
     def constPtrToType(self, side=None):
         return _HybridDecl.constPtrToType(self, self.side)
     def inType(self, side=None):
         return _HybridDecl.inType(self, self.side)
+    def forceMoveType(self, side=None):
+        return _HybridDecl.forceMoveType(self, self.side)
 
 
 class StructDecl(ipdl.ast.StructDecl, HasFQName):
     @staticmethod
     def upgrade(structDecl):
         assert isinstance(structDecl, ipdl.ast.StructDecl)
         structDecl.__class__ = StructDecl
 
@@ -760,18 +769,16 @@ class _StructField(_CompoundTypeComponen
         if self.ipdltype.isIPDL() and self.ipdltype.isActor():
             expr = ExprCast(expr, self.bareType(), const=1)
         return expr
 
     def refExpr(self, thisexpr=None):
         ref = self.memberVar()
         if thisexpr is not None:
             ref = ExprSelect(thisexpr, '.', ref.name)
-        if self.recursive:
-            ref = ExprDeref(ref)
         return ref
 
     def constRefExpr(self, thisexpr=None):
         # sigh, gross hack
         refexpr = self.refExpr(thisexpr)
         if 'Shmem' == self.ipdltype.name():
             refexpr = ExprCast(refexpr, Type('Shmem', ref=1), const=1)
         if 'ByteBuf' == self.ipdltype.name():
@@ -781,32 +788,16 @@ class _StructField(_CompoundTypeComponen
         return refexpr
 
     def argVar(self):
         return ExprVar('_'+ self.name)
 
     def memberVar(self):
         return ExprVar(self.name + '_')
 
-    def initStmts(self):
-        if self.recursive:
-            return [ StmtExpr(ExprAssn(self.memberVar(),
-                                       ExprNew(self.bareType()))) ]
-        elif self.ipdltype.isIPDL() and self.ipdltype.isActor():
-            return [ StmtExpr(ExprAssn(self.memberVar(),
-                                       ExprLiteral.NULL)) ]
-        else:
-            return []
-
-    def destructStmts(self):
-        if self.recursive:
-            return [ StmtExpr(ExprDelete(self.memberVar())) ]
-        else:
-            return []
-
 
 class UnionDecl(ipdl.ast.UnionDecl, HasFQName):
     def callType(self, var=None):
         func = ExprVar('type')
         if var is not None:
             func = ExprSelect(var, '.', func.name)
         return ExprCall(func)
 
@@ -828,25 +819,36 @@ IPDL union type."""
         _CompoundTypeComponent.__init__(self, ipdltype, 'V'+ flatname, side, ud)
         self.flattypename = flatname
         if special:
             if other is not None:
                 self.other = other
             else:
                 self.other = _UnionMember(ipdltype, ud, _otherSide(side), self)
 
+        # To create a finite object with a mutually recursive type, a union must
+        # be present somewhere in the recursive loop. Because of that we only
+        # need to care about introducing indirections inside unions.
+        self.recursive = ud.decl.type.mutuallyRecursiveWith(ipdltype)
+
     def enum(self):
         return 'T' + self.flattypename
 
     def pqEnum(self):
         return self.ud.name +'::'+ self.enum()
 
     def enumvar(self):
         return ExprVar(self.enum())
 
+    def internalType(self):
+        if self.recursive:
+            return self.ptrToType()
+        else:
+            return self.bareType()
+
     def unionType(self):
         """Type used for storage in generated C union decl."""
         if self.recursive:
             return self.ptrToType()
         else:
             return Type('mozilla::AlignedStorage2', T=self.internalType())
 
     def unionValue(self):
@@ -1483,17 +1485,30 @@ class _GenerateProtocolCode(ipdl.ast.Vis
 
         if len(aggregateTypeIncludes) != 0:
             hf.addthing(Whitespace.NL)
             hf.addthings([ Whitespace("// Headers for typedefs"), Whitespace.NL ])
 
             for headername in sorted(iter(aggregateTypeIncludes)):
                 hf.addthing(CppDirective('include', '"' + headername + '"'))
 
-        ipdl.ast.Visitor.visitTranslationUnit(self, tu)
+        # Manually run Visitor.visitTranslationUnit. For dependency resolution
+        # we need to handle structs and unions separately.
+        for cxxInc in tu.cxxIncludes:
+            cxxInc.accept(self)
+        for inc in tu.includes:
+            inc.accept(self)
+        self.generateStructsAndUnions(tu)
+        for using in tu.builtinUsing:
+            using.accept(self)
+        for using in tu.using:
+            using.accept(self)
+        if tu.protocol:
+            tu.protocol.accept(self)
+
         if tu.filetype == 'header':
             self.cppIncludeHeaders.append(_ipdlhHeaderName(tu))
 
         hf.addthing(Whitespace.NL)
         hf.addthings(_includeGuardEnd(hf))
 
         cf = self.cppfile
         cf.addthings((
@@ -1517,46 +1532,66 @@ class _GenerateProtocolCode(ipdl.ast.Vis
     def visitBuiltinCxxInclude(self, inc):
         self.hdrfile.addthing(CppDirective('include', '"'+ inc.file +'"'))
 
     def visitInclude(self, inc):
         if inc.tu.filetype == 'header':
             self.hdrfile.addthing(CppDirective(
                     'include', '"'+ _ipdlhHeaderName(inc.tu) +'.h"'))
 
-    def processStructOrUnionClass(self, su, which, forwarddecls, cls):
-        clsdecl, methoddefns = _splitClassDeclDefn(cls)
-
-        self.hdrfile.addthings(
-            [  Whitespace.NL ]
-            + forwarddecls
-            + [ Whitespace("""
+    def generateStructsAndUnions(self, tu):
+        '''Generate the definitions for all structs and unions. This will
+        re-order the declarations if needed in the C++ code such that
+        dependencies have already been defined.'''
+        decls = OrderedDict()
+        for su in tu.structsAndUnions:
+            if isinstance(su, StructDecl):
+                which = 'struct'
+                forwarddecls, fulldecltypes, cls = _generateCxxStruct(su)
+            else:
+                assert isinstance(su, UnionDecl)
+                which = 'union'
+                forwarddecls, fulldecltypes, cls = _generateCxxUnion(su)
+
+            clsdecl, methoddefns = _splitClassDeclDefn(cls)
+
+            # Store the declarations in the decls map so we can emit in
+            # dependency order.
+            decls[su.decl.type] = (
+                fulldecltypes,
+                [  Whitespace.NL ]
+                + forwarddecls
+                + [ Whitespace("""
 //-----------------------------------------------------------------------------
 // Declaration of the IPDL type |%s %s|
 //
 """% (which, su.name)),
-                _putInNamespaces(clsdecl, su.namespaces),
-            ])
-
-        self.structUnionDefns.extend([
-            Whitespace("""
+                    _putInNamespaces(clsdecl, su.namespaces),
+                ])
+
+            self.structUnionDefns.extend([
+                Whitespace("""
 //-----------------------------------------------------------------------------
 // Method definitions for the IPDL type |%s %s|
 //
 """% (which, su.name)),
-            _putInNamespaces(methoddefns, su.namespaces),
-        ])
-
-    def visitStructDecl(self, sd):
-        return self.processStructOrUnionClass(sd, 'struct',
-                                              *_generateCxxStruct(sd))
-
-    def visitUnionDecl(self, ud):
-        return self.processStructOrUnionClass(ud, 'union',
-                                              *_generateCxxUnion(ud))
+                _putInNamespaces(methoddefns, su.namespaces),
+            ])
+
+        # Generate the declarations structs in dependency order.
+        def gen_struct(deps, defn):
+            for dep in deps:
+                if dep in decls:
+                    d, t = decls[dep]
+                    del decls[dep]
+                    gen_struct(d, t)
+            self.hdrfile.addthings(defn)
+        while len(decls) > 0:
+            _, (d, t) = decls.popitem(False)
+            gen_struct(d, t)
 
     def visitProtocol(self, p):
         self.cppIncludeHeaders.append(_protocolHeaderName(self.protocol, ''))
 
         # Forward declare our own actors.
         self.hdrfile.addthings([
             Whitespace.NL,
             _makeForwardDeclForActor(p.decl.type, 'Parent'),
@@ -1801,24 +1836,26 @@ def _generateMessageConstructor(md, segm
                                       flags ])))
 
     return func
 
 ##--------------------------------------------------
 
 class _ComputeTypeDeps(TypeVisitor):
     '''Pass that gathers the C++ types that a particular IPDL type
-(recursively) depends on.  There are two kinds of dependencies: (i)
+(recursively) depends on.  There are three kinds of dependencies: (i)
 types that need forward declaration; (ii) types that need a |using|
-stmt.  Some types generate both kinds.'''
+stmt; (iii) IPDL structs or unions which must be fully declared
+before this struct.  Some types generate multiple kinds.'''
 
     def __init__(self, fortype, unqualifiedTypedefs=False):
         ipdl.type.TypeVisitor.__init__(self)
         self.usingTypedefs = [ ]
         self.forwardDeclStmts = [ ]
+        self.fullDeclTypes = [ ]
         self.fortype = fortype
         self.unqualifiedTypedefs = unqualifiedTypedefs
 
     def maybeTypedef(self, fqname, name):
         if fqname != name or self.unqualifiedTypedefs:
             self.usingTypedefs.append(Typedef(Type(fqname), name))
 
     def visitImportedCxxType(self, t):
@@ -1842,18 +1879,22 @@ stmt.  Some types generate both kinds.''
             _makeForwardDeclForActor(t.protocol, 'child'), Whitespace.NL
         ])
 
     def visitStructOrUnionType(self, su, defaultVisit):
         if su in self.visited or su == self.fortype: return
         self.visited.add(su)
         self.maybeTypedef(su.fullname(), su.name())
 
-        if su.mutuallyRecursiveWith(self.fortype):
+        # Mutually recursive fields in unions are behind indirection, so we only
+        # need a forward decl, and don't need a full type declaration.
+        if isinstance(self.fortype, UnionType) and self.fortype.mutuallyRecursiveWith(su):
             self.forwardDeclStmts.append(_makeForwardDecl(su))
+        else:
+            self.fullDeclTypes.append(su)
 
         return defaultVisit(self, su)
 
     def visitStructType(self, t):
         return self.visitStructOrUnionType(t, TypeVisitor.visitStructType)
 
     def visitUnionType(self, t):
         return self.visitStructOrUnionType(t, TypeVisitor.visitUnionType)
@@ -1886,87 +1927,61 @@ def _generateCxxStruct(sd):
     ''' '''
     # compute all the typedefs and forward decls we need to make
     gettypedeps = _ComputeTypeDeps(sd.decl.type)
     for f in sd.fields:
         f.ipdltype.accept(gettypedeps)
 
     usingTypedefs = gettypedeps.usingTypedefs
     forwarddeclstmts = gettypedeps.forwardDeclStmts
+    fulldecltypes = gettypedeps.fullDeclTypes
 
     struct = Class(sd.name, final=1)
     struct.addstmts([ Label.PRIVATE ]
                     + usingTypedefs
                     + [ Whitespace.NL, Label.PUBLIC ])
 
     constreftype = Type(sd.name, const=1, ref=1)
-    initvar = ExprVar('Init')
-    callinit = ExprCall(initvar)
-    assignvar = ExprVar('Assign')
 
     def fieldsAsParamList():
         return [ Decl(f.inType(), f.argVar().name) for f in sd.fields ]
 
     def assignFromOther(oexpr):
         return ExprCall(assignvar,
                         args=[ f.initExpr(oexpr) for f in sd.fields ])
 
     # If this is an empty struct (no fields), then the default ctor
     # and "create-with-fields" ctors are equivalent.  So don't bother
     # with the default ctor.
     if len(sd.fields):
         # Struct()
-        defctor = ConstructorDefn(ConstructorDecl(sd.name))
-        defctor.addstmt(StmtExpr(callinit))
-        defctor.memberinits = []
-        for f in sd.fields:
-          # Only generate default values for primitives.
-          if not (f.ipdltype.isCxx() and f.ipdltype.isAtom()):
-            continue
-          defctor.memberinits.append(ExprMemberInit(f.memberVar()))
+        defctor = ConstructorDefn(ConstructorDecl(sd.name, force_inline=1))
+
+        # We want to explicitly default-construct every member of the struct.
+        # This will initialize all primitives which wouldn't be initialized
+        # normally to their default values, and will initialize any actor member
+        # pointers to the correct default value of `nullptr`. Other C++ types
+        # with custom constructors must also provide a default constructor.
+        defctor.memberinits = [ ExprMemberInit(f.memberVar()) for f in sd.fields ]
         struct.addstmts([ defctor, Whitespace.NL ])
 
     # Struct(const field1& _f1, ...)
     valctor = ConstructorDefn(ConstructorDecl(sd.name,
                                               params=fieldsAsParamList(),
                                               force_inline=1))
-    valctor.addstmts([
-        StmtExpr(callinit),
-        StmtExpr(ExprCall(assignvar,
-                          args=[ f.argVar() for f in sd.fields ]))
-    ])
+    valctor.memberinits = [ ExprMemberInit(f.memberVar(),
+                                           args=[ f.argVar() ])
+                            for f in sd.fields ]
     struct.addstmts([ valctor, Whitespace.NL ])
 
-    # Struct(const Struct& _o)
-    ovar = ExprVar('_o')
-    copyctor = ConstructorDefn(ConstructorDecl(
-        sd.name,
-        params=[ Decl(constreftype, ovar.name) ],
-        force_inline=1))
-    copyctor.addstmts([
-        StmtExpr(callinit),
-        StmtExpr(assignFromOther(ovar))
-    ])
-    struct.addstmts([ copyctor, Whitespace.NL ])
-
-    # ~Struct()
-    dtor = DestructorDefn(DestructorDecl(sd.name))
-    for f in sd.fields:
-        dtor.addstmts(f.destructStmts())
-    struct.addstmts([ dtor, Whitespace.NL ])
-
-    # Struct& operator=(const Struct& _o)
-    opeq = MethodDefn(MethodDecl(
-        'operator=',
-        params=[ Decl(constreftype, ovar.name) ],
-        force_inline=1))
-    opeq.addstmt(StmtExpr(assignFromOther(ovar)))
-    struct.addstmts([ opeq, Whitespace.NL ])
+    # The default copy, move, and assignment constructors, and the default
+    # destructor, will do the right thing.
 
     # bool operator==(const Struct& _o)
+    ovar = ExprVar('_o')
     opeqeq = MethodDefn(MethodDecl(
         'operator==',
         params=[ Decl(constreftype, ovar.name) ],
         ret=Type.BOOL,
         const=1))
     for f in sd.fields:
         ifneq = StmtIf(ExprNot(
             ExprBinary(ExprCall(f.getMethod()), '==',
@@ -2001,41 +2016,28 @@ def _generateCxxStruct(sd):
         getconst = MethodDefn(getconstdecl)
         getconst.addstmt(StmtReturn(f.constRefExpr()))
 
         struct.addstmts([ get, getconst, Whitespace.NL ])
 
     # private:
     struct.addstmt(Label.PRIVATE)
 
-    # Init()
-    init = MethodDefn(MethodDecl(initvar.name))
-    for f in sd.fields:
-        init.addstmts(f.initStmts())
-    struct.addstmts([ init, Whitespace.NL ])
-
-    # Assign(const field1& _f1, ...)
-    assign = MethodDefn(MethodDecl(assignvar.name,
-                                   params=fieldsAsParamList()))
-    assign.addstmts([ StmtExpr(ExprAssn(f.refExpr(), f.argVar()))
+    # members
+    struct.addstmts([ StmtDecl(Decl(f.bareType(), f.memberVar().name))
                       for f in sd.fields ])
-    struct.addstmts([ assign, Whitespace.NL ])
-
-    # members
-    struct.addstmts([ StmtDecl(Decl(f.internalType(), f.memberVar().name))
-                      for f in sd.fields ])
-
-    return forwarddeclstmts, struct
+
+    return forwarddeclstmts, fulldecltypes, struct
 
 ##--------------------------------------------------
 
 def _generateCxxUnion(ud):
     # This Union class basically consists of a type (enum) and a
     # union for storage.  The union can contain POD and non-POD
-    # types.  Each type needs a copy ctor, assignment operator,
+    # types.  Each type needs a copy/move ctor, assignment operators,
     # and dtor.
     #
     # Rather than templating this class and only providing
     # specializations for the types we support, which is slightly
     # "unsafe" in that C++ code can add additional specializations
     # without the IPDL compiler's knowledge, we instead explicitly
     # implement non-templated methods for each supported type.
     #
@@ -2050,28 +2052,31 @@ def _generateCxxUnion(ud):
     #  - entry in the type enum
     #  - entry in the storage union
     #  - [type]ptr() method to get a type* from the underlying union
     #  - same as above to get a const type*
     #  - typedef to hack around placement delete limitations
     # (public)
     #  - placement delete case for dtor
     #  - copy ctor
+    #  - move ctor
     #  - case in generic copy ctor
-    #  - operator= impl
+    #  - copy operator= impl
+    #  - move operator= impl
     #  - case in generic operator=
     #  - operator [type&]
     #  - operator [const type&] const
     #  - [type&] get_[type]()
     #  - [const type&] get_[type]() const
     #
     cls = Class(ud.name, final=1)
     # const Union&, i.e., Union type with inparam semantics
     inClsType = Type(ud.name, const=1, ref=1)
     refClsType = Type(ud.name, ref=1)
+    rvalueRefClsType = Type(ud.name, ref=2)
     typetype = Type('Type')
     valuetype = Type('Value')
     mtypevar = ExprVar('mType')
     mvaluevar = ExprVar('mValue')
     maybedtorvar = ExprVar('MaybeDestroy')
     assertsanityvar = ExprVar('AssertSanity')
     tnonevar = ExprVar('T__None')
     tlastvar = ExprVar('T__Last')
@@ -2088,23 +2093,27 @@ def _generateCxxUnion(ud):
     def callMaybeDestroy(newTypeVar):
         return ExprCall(maybedtorvar, args=[ newTypeVar ])
 
     def maybeReconstruct(memb, newTypeVar):
         ifdied = StmtIf(callMaybeDestroy(newTypeVar))
         ifdied.addifstmt(StmtExpr(memb.callCtor()))
         return ifdied
 
+    def voidCast(expr):
+        return ExprCast(expr, Type.VOID, static=1)
+
     # compute all the typedefs and forward decls we need to make
     gettypedeps = _ComputeTypeDeps(ud.decl.type)
     for c in ud.components:
         c.ipdltype.accept(gettypedeps)
 
     usingTypedefs = gettypedeps.usingTypedefs
     forwarddeclstmts = gettypedeps.forwardDeclStmts
+    fulldecltypes = gettypedeps.fullDeclTypes
 
     # the |Type| enum, used to switch on the discunion's real type
     cls.addstmt(Label.PUBLIC)
     typeenum = TypeEnum(typetype.name)
     typeenum.addId(tnonevar.name, 0)
     firstid = ud.components[0].enum()
     typeenum.addId(firstid, 1)
     for c in ud.components[1:]:
@@ -2206,26 +2215,35 @@ def _generateCxxUnion(ud):
     cls.addstmts([
         Label.PUBLIC,
         ConstructorDefn(
             ConstructorDecl(ud.name, force_inline=1),
             memberinits=[ ExprMemberInit(mtypevar, [ tnonevar ]) ]),
         Whitespace.NL
     ])
 
-    # Union(const T&) copy ctors
+    # Union(const T&) copy & Union(T&&) move ctors
     othervar = ExprVar('aOther')
     for c in ud.components:
         copyctor = ConstructorDefn(ConstructorDecl(
             ud.name, params=[ Decl(c.inType(), othervar.name) ]))
         copyctor.addstmts([
             StmtExpr(c.callCtor(othervar)),
             StmtExpr(ExprAssn(mtypevar, c.enumvar())) ])
         cls.addstmts([ copyctor, Whitespace.NL ])
 
+        if not _cxxTypeCanMove(c.ipdltype):
+            continue
+        movector = ConstructorDefn(ConstructorDecl(
+            ud.name, params=[ Decl(c.forceMoveType(), othervar.name) ]))
+        movector.addstmts([
+            StmtExpr(c.callCtor(ExprMove(othervar))),
+            StmtExpr(ExprAssn(mtypevar, c.enumvar())) ])
+        cls.addstmts([ movector, Whitespace.NL ])
+
     # Union(const Union&) copy ctor
     copyctor = ConstructorDefn(ConstructorDecl(
         ud.name, params=[ Decl(inClsType, othervar.name) ]))
     othertype = ud.callType(othervar)
     copyswitch = StmtSwitch(othertype)
     for c in ud.components:
         copyswitch.addcase(
             CaseLabel(c.enum()),
@@ -2242,46 +2260,101 @@ def _generateCxxUnion(ud):
         StmtBlock([ _logicError('unreached'), StmtReturn() ]))
     copyctor.addstmts([
         StmtExpr(callAssertSanity(uvar=othervar)),
         copyswitch,
         StmtExpr(ExprAssn(mtypevar, othertype))
     ])
     cls.addstmts([ copyctor, Whitespace.NL ])
 
+    # Union(Union&&) move ctor
+    movector = ConstructorDefn(ConstructorDecl(
+        ud.name, params=[ Decl(rvalueRefClsType, othervar.name) ]))
+    othertypevar = ExprVar("t")
+    moveswitch = StmtSwitch(othertypevar)
+    for c in ud.components:
+        case = StmtBlock()
+        if c.recursive:
+            # This is sound as we set othervar.mTypeVar to T__None after the
+            # switch. The pointer in the union will be left dangling.
+            case.addstmts([
+                # ptr_C() = other.ptr_C()
+                StmtExpr(ExprAssn(c.callGetPtr(),
+                                  ExprCall(ExprSelect(othervar, '.', ExprVar(c.getPtrName())))))
+            ])
+        else:
+            case.addstmts([
+                # new ... (Move(other.get_C()))
+                StmtExpr(c.callCtor(ExprMove(ExprCall(ExprSelect(othervar, '.', c.getTypeName()))))),
+                # other.MaybeDestroy(T__None)
+                StmtExpr(voidCast(ExprCall(ExprSelect(othervar, '.', maybedtorvar), args=[ tnonevar ]))),
+            ])
+        case.addstmts([ StmtBreak() ])
+        moveswitch.addcase(CaseLabel(c.enum()), case)
+    moveswitch.addcase(CaseLabel(tnonevar.name),
+                       StmtBlock([ StmtBreak() ]))
+    moveswitch.addcase(
+        DefaultLabel(),
+        StmtBlock([ _logicError('unreached'), StmtReturn() ]))
+    movector.addstmts([
+        StmtExpr(callAssertSanity(uvar=othervar)),
+        StmtDecl(Decl(typetype, othertypevar.name), init=ud.callType(othervar)),
+        moveswitch,
+        StmtExpr(ExprAssn(ExprSelect(othervar, '.', mtypevar), tnonevar)),
+        StmtExpr(ExprAssn(mtypevar, othertypevar))
+    ])
+    cls.addstmts([ movector, Whitespace.NL ])
+
     # ~Union()
     dtor = DestructorDefn(DestructorDecl(ud.name))
     # The void cast prevents Coverity from complaining about missing return
     # value checks.
-    dtor.addstmt(StmtExpr(ExprCast(callMaybeDestroy(tnonevar), Type.VOID,
-                                   static=1)))
+    dtor.addstmt(StmtExpr(voidCast(callMaybeDestroy(tnonevar))))
     cls.addstmts([ dtor, Whitespace.NL ])
 
     # type()
     typemeth = MethodDefn(MethodDecl('type', ret=typetype,
                                      const=1, force_inline=1))
     typemeth.addstmt(StmtReturn(mtypevar))
     cls.addstmts([ typemeth, Whitespace.NL ])
 
-    # Union& operator=(const T&) methods
+    # Union& operator= methods
     rhsvar = ExprVar('aRhs')
     for c in ud.components:
+        # Union& operator=(const T&)
         opeq = MethodDefn(MethodDecl(
             'operator=',
             params=[ Decl(c.inType(), rhsvar.name) ],
             ret=refClsType))
         opeq.addstmts([
             # might need to placement-delete old value first
             maybeReconstruct(c, c.enumvar()),
             StmtExpr(c.callOperatorEq(rhsvar)),
             StmtExpr(ExprAssn(mtypevar, c.enumvar())),
             StmtReturn(ExprDeref(ExprVar.THIS))
         ])
         cls.addstmts([ opeq, Whitespace.NL ])
 
+        # Union& operator=(T&&)
+        if not _cxxTypeCanMove(c.ipdltype):
+            continue
+
+        opeq = MethodDefn(MethodDecl(
+            'operator=',
+            params=[ Decl(c.forceMoveType(), rhsvar.name) ],
+            ret=refClsType))
+        opeq.addstmts([
+            # might need to placement-delete old value first
+            maybeReconstruct(c, c.enumvar()),
+            StmtExpr(c.callOperatorEq(ExprMove(rhsvar))),
+            StmtExpr(ExprAssn(mtypevar, c.enumvar())),
+            StmtReturn(ExprDeref(ExprVar.THIS))
+        ])
+        cls.addstmts([ opeq, Whitespace.NL ])
+
     # Union& operator=(const Union&)
     opeq = MethodDefn(MethodDecl(
         'operator=',
         params=[ Decl(inClsType, rhsvar.name) ],
         ret=refClsType))
     rhstypevar = ExprVar('t')
     opeqswitch = StmtSwitch(rhstypevar)
     for c in ud.components:
@@ -2308,16 +2381,61 @@ def _generateCxxUnion(ud):
         StmtExpr(callAssertSanity(uvar=rhsvar)),
         StmtDecl(Decl(typetype, rhstypevar.name), init=ud.callType(rhsvar)),
         opeqswitch,
         StmtExpr(ExprAssn(mtypevar, rhstypevar)),
         StmtReturn(ExprDeref(ExprVar.THIS))
     ])
     cls.addstmts([ opeq, Whitespace.NL ])
 
+    # Union& operator=(Union&&)
+    opeq = MethodDefn(MethodDecl(
+        'operator=',
+        params=[ Decl(rvalueRefClsType, rhsvar.name) ],
+        ret=refClsType))
+    rhstypevar = ExprVar('t')
+    opeqswitch = StmtSwitch(rhstypevar)
+    for c in ud.components:
+        case = StmtBlock()
+        if c.recursive:
+            case.addstmts([
+                StmtExpr(voidCast(callMaybeDestroy(tnonevar))),
+                StmtExpr(ExprAssn(c.callGetPtr(),
+                                  ExprCall(ExprSelect(rhsvar, '.', ExprVar(c.getPtrName()))))),
+            ])
+        else:
+            case.addstmts([
+                maybeReconstruct(c, rhstypevar),
+                StmtExpr(c.callOperatorEq(
+                    ExprMove(ExprCall(ExprSelect(rhsvar, '.', c.getTypeName()))))),
+                # other.MaybeDestroy(T__None)
+                StmtExpr(voidCast(ExprCall(ExprSelect(rhsvar, '.', maybedtorvar), args=[ tnonevar ]))),
+            ])
+        case.addstmts([ StmtBreak() ])
+        opeqswitch.addcase(CaseLabel(c.enum()), case)
+    opeqswitch.addcase(
+        CaseLabel(tnonevar.name),
+        # The void cast prevents Coverity from complaining about missing return
+        # value checks.
+        StmtBlock([ StmtExpr(voidCast(callMaybeDestroy(rhstypevar))),
+                    StmtBreak() ])
+    )
+    opeqswitch.addcase(
+        DefaultLabel(),
+        StmtBlock([ _logicError('unreached'), StmtBreak() ]))
+    opeq.addstmts([
+        StmtExpr(callAssertSanity(uvar=rhsvar)),
+        StmtDecl(Decl(typetype, rhstypevar.name), init=ud.callType(rhsvar)),
+        opeqswitch,
+        StmtExpr(ExprAssn(ExprSelect(rhsvar, '.', mtypevar), tnonevar)),
+        StmtExpr(ExprAssn(mtypevar, rhstypevar)),
+        StmtReturn(ExprDeref(ExprVar.THIS))
+    ])
+    cls.addstmts([ opeq, Whitespace.NL ])
+
     # bool operator==(const T&)
     for c in ud.components:
         opeqeq = MethodDefn(MethodDecl(
             'operator==',
             params=[ Decl(c.inType(), rhsvar.name) ],
             ret=Type.BOOL,
             const=1))
         opeqeq.addstmt(StmtReturn(ExprBinary(
@@ -2392,17 +2510,17 @@ def _generateCxxUnion(ud):
 
     # private vars
     cls.addstmts([
         Label.PRIVATE,
         StmtDecl(Decl(valuetype, mvaluevar.name)),
         StmtDecl(Decl(typetype, mtypevar.name))
     ])
 
-    return forwarddeclstmts, cls
+    return forwarddeclstmts, fulldecltypes, cls
 
 ##-----------------------------------------------------------------------------
 
 class _FindFriends(ipdl.ast.Visitor):
     def __init__(self):
         self.mytype = None              # ProtocolType
         self.vtype = None               # ProtocolType
         self.friends = set()            # set<ProtocolType>
--- a/js/src/devtools/rootAnalysis/annotations.js
+++ b/js/src/devtools/rootAnalysis/annotations.js
@@ -331,16 +331,17 @@ function extraRootedPointers()
 
         // These are not actually rooted, but are only used in the context of
         // AutoKeepAtoms.
         'js::frontend::TokenStream',
         'js::frontend::TokenStreamAnyChars',
 
         'mozilla::ErrorResult',
         'mozilla::IgnoredErrorResult',
+        'mozilla::IgnoreErrors',
         'mozilla::dom::binding_detail::FastErrorResult',
     ];
 }
 
 function isRootedGCPointerTypeName(name)
 {
     name = stripUCSAndNamespace(name);
 
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -729,17 +729,17 @@ class ZoneList
     ZoneList();
     ~ZoneList();
 
     bool isEmpty() const;
     Zone* front() const;
 
     void append(Zone* zone);
     void transferFrom(ZoneList& other);
-    void removeFront();
+    Zone* removeFront();
     void clear();
 
   private:
     explicit ZoneList(Zone* singleZone);
     void check() const;
 
     ZoneList(const ZoneList& other) = delete;
     ZoneList& operator=(const ZoneList& other) = delete;
--- a/js/src/gc/Zone.cpp
+++ b/js/src/gc/Zone.cpp
@@ -463,28 +463,30 @@ ZoneList::transferFrom(ZoneList& other)
     else
         head = other.head;
     tail = other.tail;
 
     other.head = nullptr;
     other.tail = nullptr;
 }
 
-void
+Zone*
 ZoneList::removeFront()
 {
     MOZ_ASSERT(!isEmpty());
     check();
 
     Zone* front = head;
     head = head->listNext_;
     if (!head)
         tail = nullptr;
 
     front->listNext_ = Zone::NotOnList;
+
+    return front;
 }
 
 void
 ZoneList::clear()
 {
     while (!isEmpty())
         removeFront();
 }
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -3398,49 +3398,53 @@ js::gc::BackgroundDecommitTask::run()
 void
 GCRuntime::sweepBackgroundThings(ZoneList& zones, LifoAlloc& freeBlocks)
 {
     freeBlocks.freeAll();
 
     if (zones.isEmpty())
         return;
 
-    // We must finalize thing kinds in the order specified by BackgroundFinalizePhases.
-    Arena* emptyArenas = nullptr;
     FreeOp fop(nullptr);
-    for (unsigned phase = 0 ; phase < ArrayLength(BackgroundFinalizePhases) ; ++phase) {
-        for (Zone* zone = zones.front(); zone; zone = zone->nextZone()) {
-            for (auto kind : BackgroundFinalizePhases[phase].kinds) {
+
+    // Sweep zones in order. The atoms zone must be finalized last as other
+    // zones may have direct pointers into it.
+    while (!zones.isEmpty()) {
+        Zone* zone = zones.removeFront();
+        Arena* emptyArenas = nullptr;
+
+        // We must finalize thing kinds in the order specified by
+        // BackgroundFinalizePhases.
+        for (auto phase : BackgroundFinalizePhases) {
+            for (auto kind : phase.kinds) {
                 Arena* arenas = zone->arenas.arenaListsToSweep(kind);
                 MOZ_RELEASE_ASSERT(uintptr_t(arenas) != uintptr_t(-1));
                 if (arenas)
                     ArenaLists::backgroundFinalize(&fop, arenas, &emptyArenas);
             }
         }
-    }
-
-    AutoLockGC lock(rt);
-
-    // Release swept arenas, dropping and reaquiring the lock every so often to
-    // avoid blocking the active thread from allocating chunks.
-    static const size_t LockReleasePeriod = 32;
-    size_t releaseCount = 0;
-    Arena* next;
-    for (Arena* arena = emptyArenas; arena; arena = next) {
-        next = arena->next;
-        rt->gc.releaseArena(arena, lock);
-        releaseCount++;
-        if (releaseCount % LockReleasePeriod == 0) {
-            lock.unlock();
-            lock.lock();
-        }
-    }
-
-    while (!zones.isEmpty())
-        zones.removeFront();
+
+        AutoLockGC lock(rt);
+
+        // Release any arenas that are now empty, dropping and reaquiring the GC
+        // lock every so often to avoid blocking the active thread from
+        // allocating chunks.
+        static const size_t LockReleasePeriod = 32;
+        size_t releaseCount = 0;
+        Arena* next;
+        for (Arena* arena = emptyArenas; arena; arena = next) {
+            next = arena->next;
+            rt->gc.releaseArena(arena, lock);
+            releaseCount++;
+            if (releaseCount % LockReleasePeriod == 0) {
+                lock.unlock();
+                lock.lock();
+            }
+        }
+    }
 }
 
 void
 GCRuntime::assertBackgroundSweepingFinished()
 {
 #ifdef DEBUG
     MOZ_ASSERT(backgroundSweepZones.ref().isEmpty());
     for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
@@ -5643,20 +5647,31 @@ GCRuntime::endSweepingSweepGroup(FreeOp*
     for (SweepGroupZonesIter zone(rt); !zone.done(); zone.next()) {
         AutoLockGC lock(rt);
         zone->changeGCState(Zone::Sweep, Zone::Finished);
         zone->threshold.updateAfterGC(zone->usage.gcBytes(), invocationKind, tunables,
                                       schedulingState, lock);
         zone->updateAllGCMallocCountersOnGCEnd(lock);
     }
 
-    /* Start background thread to sweep zones if required. */
+    /*
+     * Start background thread to sweep zones if required, sweeping the atoms
+     * zone last if present.
+     */
+    bool sweepAtomsZone = false;
     ZoneList zones;
-    for (SweepGroupZonesIter zone(rt); !zone.done(); zone.next())
-        zones.append(zone);
+    for (SweepGroupZonesIter zone(rt); !zone.done(); zone.next()) {
+        if (zone->isAtomsZone())
+            sweepAtomsZone = true;
+        else
+            zones.append(zone);
+    }
+    if (sweepAtomsZone)
+        zones.append(atomsZone);
+
     if (sweepOnBackgroundThread)
         queueZonesForBackgroundSweep(zones);
     else
         sweepBackgroundThings(zones, blocksToFreeAfterSweeping.ref());
 
     /* Reset the list of arenas marked as being allocated during sweep phase. */
     while (Arena* arena = arenasAllocatedDuringSweep) {
         arenasAllocatedDuringSweep = arena->getNextAllocDuringSweep();
--- a/js/src/vm/String-inl.h
+++ b/js/src/vm/String-inl.h
@@ -374,34 +374,42 @@ JSFlatString::finalize(js::FreeOp* fop)
     if (!isInline())
         fop->free_(nonInlineCharsRaw());
 }
 
 inline void
 JSFatInlineString::finalize(js::FreeOp* fop)
 {
     MOZ_ASSERT(getAllocKind() == js::gc::AllocKind::FAT_INLINE_STRING);
+    MOZ_ASSERT(isInline());
 
-    if (!isInline())
-        fop->free_(nonInlineCharsRaw());
+    // Nothing to do.
 }
 
 inline void
 JSAtom::finalize(js::FreeOp* fop)
 {
     MOZ_ASSERT(JSString::isAtom());
     MOZ_ASSERT(JSString::isFlat());
-    MOZ_ASSERT(getAllocKind() == js::gc::AllocKind::ATOM ||
-               getAllocKind() == js::gc::AllocKind::FAT_INLINE_ATOM);
+    MOZ_ASSERT(getAllocKind() == js::gc::AllocKind::ATOM);
 
     if (!isInline())
         fop->free_(nonInlineCharsRaw());
 }
 
 inline void
+js::FatInlineAtom::finalize(js::FreeOp* fop)
+{
+    MOZ_ASSERT(JSString::isAtom());
+    MOZ_ASSERT(getAllocKind() == js::gc::AllocKind::FAT_INLINE_ATOM);
+
+    // Nothing to do.
+}
+
+inline void
 JSExternalString::finalize(js::FreeOp* fop)
 {
     if (!JSString::isExternal()) {
         // This started out as an external string, but was turned into a
         // non-external string by JSExternalString::ensureFlat.
         MOZ_ASSERT(isFlat());
         fop->free_(nonInlineCharsRaw());
         return;
--- a/js/src/vm/String.h
+++ b/js/src/vm/String.h
@@ -1083,16 +1083,18 @@ class FatInlineAtom : public JSAtom
 
   public:
     HashNumber hash() const {
         return hash_;
     }
     void initHash(HashNumber hash) {
         hash_ = hash;
     }
+
+    inline void finalize(js::FreeOp* fop);
 };
 
 static_assert(sizeof(FatInlineAtom) == sizeof(JSFatInlineString) + sizeof(uint64_t),
               "FatInlineAtom must have size of a fat inline string + HashNumber, "
               "aligned to gc::CellAlignBytes");
 
 } // namespace js
 
--- a/layout/base/AccessibleCaretManager.cpp
+++ b/layout/base/AccessibleCaretManager.cpp
@@ -6,16 +6,17 @@
 
 #include "AccessibleCaretManager.h"
 
 #include "AccessibleCaret.h"
 #include "AccessibleCaretEventHub.h"
 #include "AccessibleCaretLogger.h"
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/TreeWalker.h"
 #include "mozilla/IMEStateManager.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Preferences.h"
 #include "nsCaret.h"
 #include "nsContainerFrame.h"
 #include "nsContentUtils.h"
@@ -1083,17 +1084,17 @@ AccessibleCaretManager::GetFrameForFirst
   nsCOMPtr<nsIContent> startContent = do_QueryInterface(startNode);
   RefPtr<nsFrameSelection> fs = GetFrameSelection();
   nsIFrame* startFrame =
     fs->GetFrameForNodeOffset(startContent, nodeOffset, hint, aOutOffset);
 
   if (!startFrame) {
     ErrorResult err;
     RefPtr<TreeWalker> walker = mPresShell->GetDocument()->CreateTreeWalker(
-      *startNode, nsIDOMNodeFilter::SHOW_ALL, nullptr, err);
+      *startNode, dom::NodeFilterBinding::SHOW_ALL, nullptr, err);
 
     if (!walker) {
       return nullptr;
     }
 
     startFrame = startContent ? startContent->GetPrimaryFrame() : nullptr;
     while (!startFrame && startNode != endNode) {
       startNode = findInFirstRangeStart ? walker->NextNode(err)
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -8382,18 +8382,17 @@ PresShell::GetCurrentItemAndPositionForE
     checkLineHeight = false;
 
     int32_t currentIndex;
     multiSelect->GetCurrentIndex(&currentIndex);
     if (currentIndex >= 0) {
       RefPtr<nsXULElement> xulElement =
         nsXULElement::FromContent(focusedContent);
       if (xulElement) {
-        IgnoredErrorResult ignored;
-        nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(ignored);
+        nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(IgnoreErrors());
         nsCOMPtr<nsITreeBoxObject> treeBox(do_QueryInterface(box));
         // Tree view special case (tree items have no frames)
         // Get the focused row and add its coordinates, which are already in pixels
         // XXX Boris, should we create a new interface so that this doesn't
         // need to know about trees? Something like nsINodelessChildCreator which
         // could provide the current focus coordinates?
         if (treeBox) {
           treeBox->EnsureRowIsVisible(currentIndex);
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -7149,18 +7149,17 @@ nsListBoxBodyFrame*
 MaybeGetListBoxBodyFrame(nsIContent* aContainer, nsIContent* aChild)
 {
   if (!aContainer)
     return nullptr;
 
   if (IsXULListBox(aContainer) &&
       aChild->IsXULElement(nsGkAtoms::listitem)) {
     RefPtr<nsXULElement> xulElement = nsXULElement::FromContent(aContainer);
-    IgnoredErrorResult ignored;
-    nsCOMPtr<nsIBoxObject> boxObject = xulElement->GetBoxObject(ignored);
+    nsCOMPtr<nsIBoxObject> boxObject = xulElement->GetBoxObject(IgnoreErrors());
     nsCOMPtr<nsPIListBoxObject> listBoxObject = do_QueryInterface(boxObject);
     if (listBoxObject) {
       return listBoxObject->GetListBoxBody(false);
     }
   }
 
   return nullptr;
 }
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug1423331-1-ref.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>Test reference for bug 1423331: Contenteditable insertion with pseudo-elements</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<style>
+#editable {
+  outline: 1px solid black;
+  width: 300px;
+  height: 100px;
+}
+#editable::before {
+  content: "Write here";
+}
+</style>
+<div id="editable" contenteditable></div>
+<script>
+SimpleTest.waitForFocus(function() {
+  document.getElementById("editable").focus();
+  document.documentElement.className = "";
+});
+</script>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug1423331-1.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>Test for bug 1423331: Contenteditable insertion with pseudo-elements</title>
+<script src="/tests/SimpleTest/EventUtils.js"></script>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<style>
+#editable {
+  outline: 1px solid black;
+  width: 300px;
+  height: 100px;
+}
+#editable::before {
+  content: "Write here";
+}
+</style>
+<div id="editable" contenteditable></div>
+<script>
+SimpleTest.waitForFocus(function() {
+  let div = document.getElementById("editable");
+  synthesizeMouseAtCenter(div, {});
+  synthesizeMouseAtCenter(div, {});
+  document.documentElement.className ="";
+});
+</script>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug1423331-2-ref.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>Test reference for bug 1423331: Contenteditable insertion with pseudo-elements</title>
+<script src="/tests/SimpleTest/EventUtils.js"></script>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<style>
+#editable {
+  outline: 1px solid black;
+  width: 300px;
+  height: 100px;
+}
+</style>
+<div id="editable" contenteditable></div>
+<script>
+SimpleTest.waitForFocus(function() {
+  let div = document.getElementById("editable");
+  div.focus();
+  synthesizeKey("x", {});
+  synthesizeKey("x", {});
+  synthesizeKey("x", {});
+  document.documentElement.className = "";
+});
+</script>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug1423331-2.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>Test for bug 1423331: Contenteditable insertion with pseudo-elements</title>
+<script src="/tests/SimpleTest/EventUtils.js"></script>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<style>
+#editable {
+  outline: 1px solid black;
+  width: 300px;
+  height: 100px;
+}
+#editable:empty::before {
+  content: "Write here";
+}
+</style>
+<div id="editable" contenteditable></div>
+<script>
+SimpleTest.waitForFocus(function() {
+  let div = document.getElementById("editable");
+  synthesizeMouseAtCenter(div, {});
+  synthesizeMouseAtCenter(div, {});
+  synthesizeKey("x", {});
+  synthesizeKey("x", {});
+  synthesizeKey("x", {});
+  document.documentElement.className = "";
+});
+</script>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug1423331-3.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>Test for bug 1423331: Contenteditable insertion with pseudo-elements</title>
+<script src="/tests/SimpleTest/EventUtils.js"></script>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<style>
+#editable {
+  outline: 1px solid black;
+  width: 300px;
+  height: 100px;
+}
+#editable::before {
+  content: "Write here";
+}
+</style>
+<div id="editable" contenteditable></div>
+<script>
+SimpleTest.waitForFocus(function() {
+  let div = document.getElementById("editable");
+  synthesizeMouse(div, 2, 2, {});
+  synthesizeMouse(div, 2, 2, {});
+  document.documentElement.className = "";
+});
+</script>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug1423331-4.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>Test for bug 1423331: Contenteditable insertion with pseudo-elements</title>
+<script src="/tests/SimpleTest/EventUtils.js"></script>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<style>
+#editable {
+  outline: 1px solid black;
+  width: 300px;
+  height: 100px;
+}
+#editable:empty::before {
+  content: "Write here";
+}
+</style>
+<div id="editable" contenteditable></div>
+<script>
+SimpleTest.waitForFocus(function() {
+  let div = document.getElementById("editable");
+  synthesizeMouse(div, 2, 2, {});
+  synthesizeMouse(div, 2, 2, {});
+  synthesizeKey("x", {});
+  synthesizeKey("x", {});
+  synthesizeKey("x", {});
+  document.documentElement.className = "";
+});
+</script>
+</html>
--- a/layout/base/tests/mochitest.ini
+++ b/layout/base/tests/mochitest.ini
@@ -305,16 +305,22 @@ support-files =
   bug1354478-5.html
   bug1354478-5-ref.html
   bug1354478-6.html
   bug1354478-6-ref.html
   bug1359411.html
   bug1359411-ref.html
   bug1415416.html
   bug1415416-ref.html
+  bug1423331-1.html
+  bug1423331-1-ref.html
+  bug1423331-2.html
+  bug1423331-2-ref.html
+  bug1423331-3.html
+  bug1423331-4.html
   image_rgrg-256x256.png
   input-invalid-ref.html
   input-maxlength-invalid-change.html
   input-maxlength-ui-invalid-change.html
   input-maxlength-ui-valid-change.html
   input-maxlength-valid-before-change.html
   input-maxlength-valid-change.html
   input-minlength-invalid-change.html
--- a/layout/base/tests/test_reftests_with_caret.html
+++ b/layout/base/tests/test_reftests_with_caret.html
@@ -189,16 +189,21 @@ var tests = [
     [ 'bug1354478-1.html' , 'bug1354478-1-ref.html'] ,
     [ 'bug1354478-2.html' , 'bug1354478-2-ref.html'] ,
     [ 'bug1354478-3.html' , 'bug1354478-3-ref.html'] ,
     [ 'bug1354478-4.html' , 'bug1354478-4-ref.html'] ,
     [ 'bug1354478-5.html' , 'bug1354478-5-ref.html'] ,
     [ 'bug1354478-6.html' , 'bug1354478-6-ref.html'] ,
     [ 'bug1359411.html'   , 'bug1359411-ref.html' ] ,
     [ 'bug1415416.html'   , 'bug1415416-ref.html' ] ,
+    [ 'bug1423331-1.html' , 'bug1423331-1-ref.html' ] ,
+    [ 'bug1423331-2.html' , 'bug1423331-2-ref.html' ] ,
+    // FIXME(bug 1434949): These two fail in some platforms.
+    // [ 'bug1423331-3.html' , 'bug1423331-1-ref.html' ] ,
+    // [ 'bug1423331-4.html' , 'bug1423331-2-ref.html' ] ,
     function() {SpecialPowers.pushPrefEnv({'clear': [['layout.accessiblecaret.enabled']]}, nextTest);} ,
 ];
 
 if (navigator.appVersion.indexOf("Android") == -1) {
   tests.push([ 'bug512295-1.html' , 'bug512295-1-ref.html' ]);
   tests.push([ 'bug512295-2.html' , 'bug512295-2-ref.html' ]);
   tests.push([ 'bug923376.html'   , 'bug923376-ref.html'   ]);
   tests.push(function() {SpecialPowers.pushPrefEnv({'set': [['layout.css.overflow-clip-box.enabled', true]]}, nextTest);});
--- a/layout/forms/nsFileControlFrame.cpp
+++ b/layout/forms/nsFileControlFrame.cpp
@@ -106,25 +106,23 @@ MakeAnonButton(nsIDocument* aDoc, const 
   }
 
   // Make sure access key and tab order for the element actually redirect to the
   // file picking button.
   RefPtr<HTMLButtonElement> buttonElement =
     HTMLButtonElement::FromContentOrNull(button);
 
   if (!aAccessKey.IsEmpty()) {
-    IgnoredErrorResult ignored;
-    buttonElement->SetAccessKey(aAccessKey, ignored);
+    buttonElement->SetAccessKey(aAccessKey, IgnoreErrors());
   }
 
   // Both elements are given the same tab index so that the user can tab
   // to the file control at the correct index, and then between the two
   // buttons.
-  IgnoredErrorResult ignored;
-  buttonElement->SetTabIndex(aInputElement->TabIndex(), ignored);
+  buttonElement->SetTabIndex(aInputElement->TabIndex(), IgnoreErrors());
 
   return button.forget();
 }
 
 nsresult
 nsFileControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
 {
   nsCOMPtr<nsIDocument> doc = mContent->GetComposedDoc();
--- a/layout/forms/nsNumberControlFrame.cpp
+++ b/layout/forms/nsNumberControlFrame.cpp
@@ -309,18 +309,17 @@ public:
     : mozilla::Runnable("FocusTextField")
     , mNumber(aNumber)
     , mTextField(aTextField)
   {}
 
   NS_IMETHOD Run() override
   {
     if (mNumber->AsElement()->State().HasState(NS_EVENT_STATE_FOCUS)) {
-      IgnoredErrorResult ignored;
-      HTMLInputElement::FromContent(mTextField)->Focus(ignored);
+      HTMLInputElement::FromContent(mTextField)->Focus(IgnoreErrors());
     }
 
     return NS_OK;
   }
 
 private:
   nsCOMPtr<nsIContent> mNumber;
   nsCOMPtr<nsIContent> mTextField;
@@ -401,18 +400,17 @@ nsNumberControlFrame::CreateAnonymousCon
   // If we're readonly, make sure our anonymous text control is too:
   nsAutoString readonly;
   if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::readonly,
                                      readonly)) {
     mTextField->SetAttr(kNameSpaceID_None, nsGkAtoms::readonly, readonly, false);
   }
 
   // Propogate our tabindex:
-  IgnoredErrorResult ignored;
-  textField->SetTabIndex(content->TabIndex(), ignored);
+  textField->SetTabIndex(content->TabIndex(), IgnoreErrors());
 
   // Initialize the text field's placeholder, if ours is set:
   nsAutoString placeholder;
   if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder,
                                      placeholder)) {
     mTextField->SetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, placeholder, false);
   }
 
@@ -596,18 +594,17 @@ nsNumberControlFrame::IsFocused() const
 }
 
 void
 nsNumberControlFrame::HandleFocusEvent(WidgetEvent* aEvent)
 {
   if (aEvent->mOriginalTarget != mTextField) {
     // Move focus to our text field
     RefPtr<HTMLInputElement> textField = HTMLInputElement::FromContent(mTextField);
-    IgnoredErrorResult ignored;
-    textField->Focus(ignored);
+    textField->Focus(IgnoreErrors());
   }
 }
 
 void
 nsNumberControlFrame::HandleSelectCall()
 {
   RefPtr<HTMLInputElement> textField = HTMLInputElement::FromContent(mTextField);
   textField->Select();
@@ -678,20 +675,19 @@ nsNumberControlFrame::SetValueOfAnonText
   // We need to update the value of our anonymous text control here. Note that
   // this must be its value, and not its 'value' attribute (the default value),
   // since the default value is ignored once a user types into the text
   // control.
   //
   // Pass NonSystem as the caller type; this should work fine for actual number
   // inputs, and be safe in case our input has a type we don't expect for some
   // reason.
-  IgnoredErrorResult rv;
   HTMLInputElement::FromContent(mTextField)->SetValue(localizedValue,
                                                       CallerType::NonSystem,
-                                                      rv);
+                                                      IgnoreErrors());
 }
 
 void
 nsNumberControlFrame::GetValueOfAnonTextControl(nsAString& aValue)
 {
   if (!mTextField) {
     aValue.Truncate();
     return;
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -4743,68 +4743,73 @@ struct MOZ_STACK_CLASS FrameContentRange
     content(aContent), start(aStart), end(aEnd) { }
   nsCOMPtr<nsIContent> content;
   int32_t start;
   int32_t end;
 };
 
 // Retrieve the content offsets of a frame
 static FrameContentRange GetRangeForFrame(nsIFrame* aFrame) {
-  nsCOMPtr<nsIContent> content, parent;
-  content = aFrame->GetContent();
+  nsIContent* content = aFrame->GetContent();
   if (!content) {
     NS_WARNING("Frame has no content");
     return FrameContentRange(nullptr, -1, -1);
   }
+
   LayoutFrameType type = aFrame->Type();
   if (type == LayoutFrameType::Text) {
     int32_t offset, offsetEnd;
     aFrame->GetOffsets(offset, offsetEnd);
     return FrameContentRange(content, offset, offsetEnd);
   }
+
   if (type == LayoutFrameType::Br) {
-    parent = content->GetParent();
+    nsIContent* parent = content->GetParent();
     int32_t beginOffset = parent->ComputeIndexOf(content);
     return FrameContentRange(parent, beginOffset, beginOffset);
   }
-  // Loop to deal with anonymous content, which has no index; this loop
-  // probably won't run more than twice under normal conditions
-  do {
-    parent  = content->GetParent();
-    if (parent) {
-      int32_t beginOffset = parent->ComputeIndexOf(content);
-      if (beginOffset >= 0)
-        return FrameContentRange(parent, beginOffset, beginOffset + 1);
-      content = parent;
-    }
-  } while (parent);
-
-  // The root content node must act differently
-  return FrameContentRange(content, 0, content->GetChildCount());
+
+  while (content->IsRootOfAnonymousSubtree()) {
+    content = content->GetParent();
+  }
+
+  nsIContent* parent = content->GetParent();
+  if (nsLayoutUtils::GetAsBlock(aFrame) || !parent) {
+    return FrameContentRange(content, 0, content->GetChildCount());
+  }
+
+  // TODO(emilio): Revise this in presence of Shadow DOM / display: contents,
+  // it's likely that we don't want to just walk the light tree, and we need to
+  // change the representation of FrameContentRange.
+  int32_t index = parent->ComputeIndexOf(content);
+  MOZ_ASSERT(index >= 0);
+  return FrameContentRange(parent, index, index + 1);
 }
 
 // The FrameTarget represents the closest frame to a point that can be selected
 // The frame is the frame represented, frameEdge says whether one end of the
 // frame is the result (in which case different handling is needed), and
 // afterFrame says which end is repersented if frameEdge is true
 struct FrameTarget {
-  FrameTarget(nsIFrame* aFrame, bool aFrameEdge, bool aAfterFrame,
-              bool aEmptyBlock = false) :
-    frame(aFrame), frameEdge(aFrameEdge), afterFrame(aAfterFrame),
-    emptyBlock(aEmptyBlock) { }
+  FrameTarget(nsIFrame* aFrame, bool aFrameEdge, bool aAfterFrame)
+    : frame(aFrame)
+    , frameEdge(aFrameEdge)
+    , afterFrame(aAfterFrame)
+  {}
+
   static FrameTarget Null() {
     return FrameTarget(nullptr, false, false);
   }
+
   bool IsNull() {
     return !frame;
   }
   nsIFrame* frame;
   bool frameEdge;
   bool afterFrame;
-  bool emptyBlock;
 };
 
 // See function implementation for information
 static FrameTarget GetSelectionClosestFrame(nsIFrame* aFrame,
                                             const nsPoint& aPoint,
                                             uint32_t aFlags);
 
 static bool SelfIsSelectable(nsIFrame* aFrame, uint32_t aFlags)
@@ -4884,21 +4889,22 @@ static FrameTarget DrillDownToSelectionF
 // This method finds the closest valid FrameTarget on a given line; if there is
 // no valid FrameTarget on the line, it returns a null FrameTarget
 static FrameTarget GetSelectionClosestFrameForLine(
                       nsBlockFrame* aParent,
                       nsBlockFrame::LineIterator aLine,
                       const nsPoint& aPoint,
                       uint32_t aFlags)
 {
-  nsIFrame *frame = aLine->mFirstChild;
   // Account for end of lines (any iterator from the block is valid)
   if (aLine == aParent->LinesEnd())
     return DrillDownToSelectionFrame(aParent, true, aFlags);
-  nsIFrame *closestFromIStart = nullptr, *closestFromIEnd = nullptr;
+  nsIFrame* frame = aLine->mFirstChild;
+  nsIFrame* closestFromIStart = nullptr;
+  nsIFrame* closestFromIEnd = nullptr;
   nscoord closestIStart = aLine->IStart(), closestIEnd = aLine->IEnd();
   WritingMode wm = aLine->mWritingMode;
   LogicalPoint pt(wm, aPoint, aLine->mContainerSize);
   bool canSkipBr = false;
   for (int32_t n = aLine->GetChildCount(); n;
        --n, frame = frame->GetNextSibling()) {
     // Skip brFrames. Can only skip if the line contains at least
     // one selectable and non-empty frame before
@@ -4947,82 +4953,77 @@ static FrameTarget GetSelectionClosestFr
                                                     const nsPoint& aPoint,
                                                     uint32_t aFlags)
 {
   nsBlockFrame* bf = nsLayoutUtils::GetAsBlock(aFrame); // used only for QI
   if (!bf)
     return FrameTarget::Null();
 
   // This code searches for the correct line
-  nsBlockFrame::LineIterator firstLine = bf->LinesBegin();
   nsBlockFrame::LineIterator end = bf->LinesEnd();
-  if (firstLine == end) {
-    nsIContent *blockContent = aFrame->GetContent();
-    if (blockContent) {
-      // Return with empty flag true.
-      return FrameTarget(aFrame, false, false, true);
-    }
-    return FrameTarget::Null();
-  }
-  nsBlockFrame::LineIterator curLine = firstLine;
+  nsBlockFrame::LineIterator curLine = bf->LinesBegin();
   nsBlockFrame::LineIterator closestLine = end;
-  // Convert aPoint into a LogicalPoint in the writing-mode of this block
-  WritingMode wm = curLine->mWritingMode;
-  LogicalPoint pt(wm, aPoint, curLine->mContainerSize);
-  while (curLine != end) {
-    // Check to see if our point lies within the line's block-direction bounds
-    nscoord BCoord = pt.B(wm) - curLine->BStart();
-    nscoord BSize = curLine->BSize();
-    if (BCoord >= 0 && BCoord < BSize) {
-      closestLine = curLine;
-      break; // We found the line; stop looking
-    }
-    if (BCoord < 0)
-      break;
-    ++curLine;
-  }
-
-  if (closestLine == end) {
-    nsBlockFrame::LineIterator prevLine = curLine.prev();
-    nsBlockFrame::LineIterator nextLine = curLine;
-    // Avoid empty lines
-    while (nextLine != end && nextLine->IsEmpty())
-      ++nextLine;
-    while (prevLine != end && prevLine->IsEmpty())
-      --prevLine;
-
-    // This hidden pref dictates whether a point above or below all lines comes
-    // up with a line or the beginning or end of the frame; 0 on Windows,
-    // 1 on other platforms by default at the writing of this code
-    int32_t dragOutOfFrame =
-      Preferences::GetInt("browser.drag_out_of_frame_style");
-
-    if (prevLine == end) {
-      if (dragOutOfFrame == 1 || nextLine == end)
-        return DrillDownToSelectionFrame(aFrame, false, aFlags);
-      closestLine = nextLine;
-    } else if (nextLine == end) {
-      if (dragOutOfFrame == 1)
-        return DrillDownToSelectionFrame(aFrame, true, aFlags);
-      closestLine = prevLine;
-    } else { // Figure out which line is closer
-      if (pt.B(wm) - prevLine->BEnd() < nextLine->BStart() - pt.B(wm))
+
+  if (curLine != end) {
+    // Convert aPoint into a LogicalPoint in the writing-mode of this block
+    WritingMode wm = curLine->mWritingMode;
+    LogicalPoint pt(wm, aPoint, curLine->mContainerSize);
+    do {
+      // Check to see if our point lies within the line's block-direction bounds
+      nscoord BCoord = pt.B(wm) - curLine->BStart();
+      nscoord BSize = curLine->BSize();
+      if (BCoord >= 0 && BCoord < BSize) {
+        closestLine = curLine;
+        break; // We found the line; stop looking
+      }
+      if (BCoord < 0)
+        break;
+      ++curLine;
+    } while (curLine != end);
+
+    if (closestLine == end) {
+      nsBlockFrame::LineIterator prevLine = curLine.prev();
+      nsBlockFrame::LineIterator nextLine = curLine;
+      // Avoid empty lines
+      while (nextLine != end && nextLine->IsEmpty())
+        ++nextLine;
+      while (prevLine != end && prevLine->IsEmpty())
+        --prevLine;
+
+      // This hidden pref dictates whether a point above or below all lines comes
+      // up with a line or the beginning or end of the frame; 0 on Windows,
+      // 1 on other platforms by default at the writing of this code
+      int32_t dragOutOfFrame =
+        Preferences::GetInt("browser.drag_out_of_frame_style");
+
+      if (prevLine == end) {
+        if (dragOutOfFrame == 1 || nextLine == end)
+          return DrillDownToSelectionFrame(aFrame, false, aFlags);
+        closestLine = nextLine;
+      } else if (nextLine == end) {
+        if (dragOutOfFrame == 1)
+          return DrillDownToSelectionFrame(aFrame, true, aFlags);
         closestLine = prevLine;
-      else
-        closestLine = nextLine;
+      } else { // Figure out which line is closer
+        if (pt.B(wm) - prevLine->BEnd() < nextLine->BStart() - pt.B(wm))
+          closestLine = prevLine;
+        else
+          closestLine = nextLine;
+      }
     }
   }
 
   do {
     FrameTarget target = GetSelectionClosestFrameForLine(bf, closestLine,
                                                          aPoint, aFlags);
     if (!target.IsNull())
       return target;
     ++closestLine;
   } while (closestLine != end);
+
   // Fall back to just targeting the last targetable place
   return DrillDownToSelectionFrame(aFrame, true, aFlags);
 }
 
 // GetSelectionClosestFrame is the helper function that calculates the closest
 // frame to the given point.
 // It doesn't completely account for offset styles, so needs to be used in
 // restricted environments.
@@ -5150,27 +5151,16 @@ nsIFrame::ContentOffsets nsIFrame::GetCo
       adjustedFrame = adjustedFrame->GetParent();
   }
 
   nsPoint adjustedPoint = aPoint + this->GetOffsetTo(adjustedFrame);
 
   FrameTarget closest =
     GetSelectionClosestFrame(adjustedFrame, adjustedPoint, aFlags);
 
-  if (closest.emptyBlock) {
-    ContentOffsets offsets;
-    NS_ASSERTION(closest.frame,
-                 "closest.frame must not be null when it's empty");
-    offsets.content = closest.frame->GetContent();
-    offsets.offset = 0;
-    offsets.secondaryOffset = 0;
-    offsets.associate = CARET_ASSOCIATE_AFTER;
-    return offsets;
-  }
-
   // If the correct offset is at one end of a frame, use offset-based
   // calculation method
   if (closest.frameEdge) {
     ContentOffsets offsets;
     FrameContentRange range = GetRangeForFrame(closest.frame);
     offsets.content = range.content;
     if (closest.afterFrame)
       offsets.offset = range.end;
@@ -8384,17 +8374,17 @@ FindBlockFrameOrBR(nsIFrame* aFrame, nsD
 }
 
 nsresult
 nsIFrame::PeekOffsetParagraph(nsPeekOffsetStruct *aPos)
 {
   nsIFrame* frame = this;
   nsContentAndOffset blockFrameOrBR;
   blockFrameOrBR.mContent = nullptr;
-  bool reachedBlockAncestor = false;
+  bool reachedBlockAncestor = !!nsLayoutUtils::GetAsBlock(frame);
 
   // Go through containing frames until reaching a block frame.
   // In each step, search the previous (or next) siblings for the closest
   // "stop frame" (a block frame or a BRFrame).
   // If found, set it to be the selection boundray and abort.
 
   if (aPos->mDirection == eDirPrevious) {
     while (!reachedBlockAncestor) {
@@ -8435,17 +8425,17 @@ nsIFrame::PeekOffsetParagraph(nsPeekOffs
         sibling = sibling->GetNextSibling();
       }
       if (blockFrameOrBR.mContent) {
         aPos->mResultContent = blockFrameOrBR.mContent;
         aPos->mContentOffset = blockFrameOrBR.mOffset;
         break;
       }
       frame = parent;
-      reachedBlockAncestor = (nsLayoutUtils::GetAsBlock(frame) != nullptr);
+      reachedBlockAncestor = !!nsLayoutUtils::GetAsBlock(frame);
     }
     if (reachedBlockAncestor) { // no "stop frame" found
       aPos->mResultContent = frame->GetContent();
       if (aPos->mResultContent)
         aPos->mContentOffset = aPos->mResultContent->GetChildCount();
     }
   }
   return NS_OK;
--- a/layout/inspector/inDOMView.cpp
+++ b/layout/inspector/inDOMView.cpp
@@ -7,30 +7,30 @@
 #include "inDOMView.h"
 
 #include "inLayoutUtils.h"
 
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsIAttribute.h"
 #include "nsIDOMNode.h"
-#include "nsIDOMNodeFilter.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsBindingManager.h"
 #include "nsNameSpaceManager.h"
 #include "nsIDocument.h"
 #include "nsIServiceManager.h"
 #include "nsITreeColumns.h"
 #include "nsITreeBoxObject.h"
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/Services.h"
 #include "mozilla/dom/InspectorUtils.h"
+#include "mozilla/dom/NodeFilterBinding.h"
 
 #ifdef ACCESSIBILITY
 #include "nsAccessibilityService.h"
 #endif
 
 using namespace mozilla;
 
 ////////////////////////////////////////////////////////////////////////
@@ -76,17 +76,17 @@ inDOMViewNode::~inDOMViewNode()
 
 ////////////////////////////////////////////////////////////////////////
 
 inDOMView::inDOMView() :
   mShowAnonymous(false),
   mShowSubDocuments(false),
   mShowWhitespaceNodes(true),
   mShowAccessibleNodes(false),
-  mWhatToShow(nsIDOMNodeFilter::SHOW_ALL)
+  mWhatToShow(dom::NodeFilterBinding::SHOW_ALL)
 {
 }
 
 inDOMView::~inDOMView()
 {
   SetRootNode(nullptr);
 }
 
@@ -125,17 +125,17 @@ inDOMView::SetRootNode(nsIDOMNode* aNode
 
   RemoveAllNodes();
 
   mRootNode = aNode;
 
   if (aNode) {
     // If we are able to show element nodes, then start with the root node
     // as the first node in the buffer
-    if (mWhatToShow & nsIDOMNodeFilter::SHOW_ELEMENT) {
+    if (mWhatToShow & dom::NodeFilterBinding::SHOW_ELEMENT) {
       // allocate new node array
       AppendNode(CreateNode(aNode, nullptr));
     } else {
       // place only the children of the root node in the buffer
       ExpandNode(-1);
     }
 
     // store an owning reference to document so that it isn't
@@ -622,17 +622,17 @@ inDOMView::AttributeChanged(nsIDocument*
                             int32_t aNameSpaceID, nsAtom* aAttribute,
                             int32_t aModType,
                             const nsAttrValue* aOldValue)
 {
   if (!mTree) {
     return;
   }
 
-  if (!(mWhatToShow & nsIDOMNodeFilter::SHOW_ATTRIBUTE)) {
+  if (!(mWhatToShow & dom::NodeFilterBinding::SHOW_ATTRIBUTE)) {
     return;
   }
 
   nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
 
   // get the dom attribute node, if there is any
   nsCOMPtr<nsIDOMElement> el(do_QueryInterface(aElement));
   RefPtr<dom::Attr> domAttr;
@@ -667,17 +667,17 @@ inDOMView::AttributeChanged(nsIDocument*
     }
     // get the number of attributes on this content node
     uint32_t attrCount = aElement->GetAttrCount();
 
     inDOMViewNode* contentNode = nullptr;
     int32_t contentRow;
     int32_t attrRow;
     if (mRootNode == el &&
-        !(mWhatToShow & nsIDOMNodeFilter::SHOW_ELEMENT)) {
+        !(mWhatToShow & dom::NodeFilterBinding::SHOW_ELEMENT)) {
       // if this view has a root node but is not displaying it,
       // it is ok to act as if the changed attribute is on the root.
       attrRow = attrCount - 1;
     } else {
       if (NS_FAILED(NodeToRow(el, &contentRow))) {
         return;
       }
       RowToNode(contentRow, &contentNode);
@@ -1153,24 +1153,24 @@ inDOMView::GetLastDescendantOf(inDOMView
 
 //////// DOM UTILITIES
 
 nsresult
 inDOMView::GetChildNodesFor(nsIDOMNode* aNode, nsCOMArray<nsIDOMNode>& aResult)
 {
   NS_ENSURE_ARG(aNode);
   // attribute nodes
-  if (mWhatToShow & nsIDOMNodeFilter::SHOW_ATTRIBUTE) {
+  if (mWhatToShow & dom::NodeFilterBinding::SHOW_ATTRIBUTE) {
     nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
     if (element) {
       AppendAttrsToArray(element->Attributes(), aResult);
     }
   }
 
-  if (mWhatToShow & nsIDOMNodeFilter::SHOW_ELEMENT) {
+  if (mWhatToShow & dom::NodeFilterBinding::SHOW_ELEMENT) {
     nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
     MOZ_ASSERT(node);
 
     nsCOMPtr<nsINodeList> kids =
       InspectorUtils::GetChildrenForNode(*node, mShowAnonymous);
     if (kids) {
       AppendKidsToArray(kids, aResult);
     }
--- a/layout/inspector/inDeepTreeWalker.cpp
+++ b/layout/inspector/inDeepTreeWalker.cpp
@@ -4,37 +4,37 @@
  * 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 "inDeepTreeWalker.h"
 #include "inLayoutUtils.h"
 
 #include "nsString.h"
 #include "nsIDOMDocument.h"
-#include "nsIDOMNodeFilter.h"
 #include "nsIDOMNodeList.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIContent.h"
 #include "ChildIterator.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/InspectorUtils.h"
+#include "mozilla/dom/NodeFilterBinding.h"
 
 /*****************************************************************************
  * This implementation does not currently operaate according to the W3C spec.
  * In particular it does NOT handle DOM mutations during the walk.  It also
  * ignores whatToShow and the filter.
  *****************************************************************************/
 
 ////////////////////////////////////////////////////
 
 inDeepTreeWalker::inDeepTreeWalker()
   : mShowAnonymousContent(false),
     mShowSubDocuments(false),
     mShowDocumentsAsNodes(false),
-    mWhatToShow(nsIDOMNodeFilter::SHOW_ALL)
+    mWhatToShow(mozilla::dom::NodeFilterBinding::SHOW_ALL)
 {
 }
 
 inDeepTreeWalker::~inDeepTreeWalker()
 {
 }
 
 NS_IMPL_ISUPPORTS(inDeepTreeWalker,
@@ -95,17 +95,16 @@ inDeepTreeWalker::Init(nsIDOMNode* aRoot
   mRoot = aRoot;
   mCurrentNode = aRoot;
   mWhatToShow = aWhatToShow;
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////
-// nsIDOMTreeWalker
 
 NS_IMETHODIMP
 inDeepTreeWalker::GetRoot(nsIDOMNode** aRoot)
 {
   *aRoot = mRoot;
   NS_IF_ADDREF(*aRoot);
   return NS_OK;
 }
@@ -113,22 +112,16 @@ inDeepTreeWalker::GetRoot(nsIDOMNode** a
 NS_IMETHODIMP
 inDeepTreeWalker::GetWhatToShow(uint32_t* aWhatToShow)
 {
   *aWhatToShow = mWhatToShow;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-inDeepTreeWalker::GetFilter(nsIDOMNodeFilter** aFilter)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
 inDeepTreeWalker::GetCurrentNode(nsIDOMNode** aCurrentNode)
 {
   *aCurrentNode = mCurrentNode;
   NS_IF_ADDREF(*aCurrentNode);
   return NS_OK;
 }
 
 already_AddRefed<nsIDOMNode>
--- a/layout/inspector/inIDeepTreeWalker.idl
+++ b/layout/inspector/inIDeepTreeWalker.idl
@@ -1,16 +1,15 @@
 /* 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 "nsISupports.idl"
 
 interface nsIDOMNode;
-interface nsIDOMNodeFilter;
 
 // Note: the iterator does not handle DOM mutations gracefully. So if
 // the underlying DOM we are iterating over is changed, the behavior
 // of the walker is undefined. (With the current implementation we
 // cache the siblings of the current node and this list is not updated
 // when a mutation occurs).
 
 [scriptable, uuid(6657e8eb-b646-48e7-993e-cfa6e96415b4)]
@@ -20,25 +19,24 @@ interface inIDeepTreeWalker : nsISupport
   attribute boolean showSubDocuments;
 
   // By default the walker skips document nodes from the iteration,
   // by setting this flag to true this behavior can be altered.
   attribute boolean showDocumentsAsNodes;
 
   void init(in nsIDOMNode aRoot, in unsigned long aWhatToShow);
 
-  // Methods and attributes from nsIDOMTreeWalker, which is not scriptable.
+  // Methods and attributes that look like TreeWalker.
   // Note: normally parentNode cannot go further up on the tree once it reached
   // the root, but setting currentNode does not have this limitation. If currentNode
   // is set to a node that does not have the root as its ancestor the walk can be
   // continued from there, and once we reach a node that is 'under' the root, the
   // limitation for the parentNode will work again.
   readonly attribute nsIDOMNode       root;
   readonly attribute unsigned long    whatToShow;
-  readonly attribute nsIDOMNodeFilter filter;
            attribute nsIDOMNode       currentNode;
 
   nsIDOMNode         parentNode();
   nsIDOMNode         firstChild();
   nsIDOMNode         lastChild();
   nsIDOMNode         previousSibling();
   nsIDOMNode         nextSibling();
   nsIDOMNode         previousNode();
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -474,28 +474,28 @@ FontFaceSet::HasRuleFontFace(FontFace* a
     if (mRuleFaces[i].mFontFace == aFontFace) {
       return true;
     }
   }
   return false;
 }
 #endif
 
-FontFaceSet*
+void
 FontFaceSet::Add(FontFace& aFontFace, ErrorResult& aRv)
 {
   FlushUserFontSet();
 
   if (aFontFace.IsInFontFaceSet(this)) {
-    return this;
+    return;
   }
 
   if (aFontFace.HasRule()) {
     aRv.Throw(NS_ERROR_DOM_INVALID_MODIFICATION_ERR);
-    return nullptr;
+    return;
   }
 
   aFontFace.AddFontFaceSet(this);
 
 #ifdef DEBUG
   for (const FontFaceRecord& rec : mNonRuleFaces) {
     MOZ_ASSERT(rec.mFontFace != &aFontFace,
                "FontFace should not occur in mNonRuleFaces twice");
@@ -508,17 +508,16 @@ FontFaceSet::Add(FontFace& aFontFace, Er
   rec->mLoadEventShouldFire =
     aFontFace.Status() == FontFaceLoadStatus::Unloaded ||
     aFontFace.Status() == FontFaceLoadStatus::Loading;
 
   mNonRuleFacesDirty = true;
   MarkUserFontSetDirty();
   mHasLoadingFontFacesIsDirty = true;
   CheckLoadingStarted();
-  return this;
 }
 
 void
 FontFaceSet::Clear()
 {
   FlushUserFontSet();
 
   if (mNonRuleFaces.IsEmpty()) {
--- a/layout/style/FontFaceSet.h
+++ b/layout/style/FontFaceSet.h
@@ -192,17 +192,17 @@ public:
                                                const nsAString& aText,
                                                mozilla::ErrorResult& aRv);
   bool Check(const nsAString& aFont,
              const nsAString& aText,
              mozilla::ErrorResult& aRv);
   mozilla::dom::Promise* GetReady(mozilla::ErrorResult& aRv);
   mozilla::dom::FontFaceSetLoadStatus Status();
 
-  FontFaceSet* Add(FontFace& aFontFace, mozilla::ErrorResult& aRv);
+  void Add(FontFace& aFontFace, mozilla::ErrorResult& aRv);
   void Clear();
   bool Delete(FontFace& aFontFace);
   bool Has(FontFace& aFontFace);
   uint32_t Size();
   already_AddRefed<mozilla::dom::FontFaceSetIterator> Entries();
   already_AddRefed<mozilla::dom::FontFaceSetIterator> Values();
   void ForEach(JSContext* aCx, FontFaceSetForEachCallback& aCallback,
                JS::Handle<JS::Value> aThisArg,
--- a/layout/xul/nsXULTooltipListener.cpp
+++ b/layout/xul/nsXULTooltipListener.cpp
@@ -461,18 +461,17 @@ nsXULTooltipListener::ShowTooltip()
 #ifdef DEBUG_crap
 static void
 GetTreeCellCoords(nsITreeBoxObject* aTreeBox, nsIContent* aSourceNode,
                   int32_t aRow, nsITreeColumn* aCol, int32_t* aX, int32_t* aY)
 {
   int32_t junk;
   aTreeBox->GetCoordsForCellItem(aRow, aCol, EmptyCString(), aX, aY, &junk, &junk);
   RefPtr<nsXULElement> xulEl = nsXULElement::FromContent(aSourceNode);
-  IgnoredErrorResult ignored;
-  nsCOMPtr<nsIBoxObject> bx = xulEl->GetBoxObject(ignored);
+  nsCOMPtr<nsIBoxObject> bx = xulEl->GetBoxObject(IgnoreErrors());
   int32_t myX, myY;
   bx->GetX(&myX);
   bx->GetY(&myY);
   *aX += myX;
   *aY += myY;
 }
 #endif
 
@@ -725,18 +724,17 @@ nsXULTooltipListener::GetSourceTreeBoxOb
 {
   *aBoxObject = nullptr;
 
   nsCOMPtr<nsIContent> sourceNode = do_QueryReferent(mSourceNode);
   if (mIsSourceTree && sourceNode) {
     RefPtr<nsXULElement> xulEl =
       nsXULElement::FromContentOrNull(sourceNode->GetParent());
     if (xulEl) {
-      IgnoredErrorResult ignored;
-      nsCOMPtr<nsIBoxObject> bx = xulEl->GetBoxObject(ignored);
+      nsCOMPtr<nsIBoxObject> bx = xulEl->GetBoxObject(IgnoreErrors());
       nsCOMPtr<nsITreeBoxObject> obx(do_QueryInterface(bx));
       if (obx) {
         *aBoxObject = obx;
         NS_ADDREF(*aBoxObject);
         return NS_OK;
       }
     }
   }
--- a/layout/xul/tree/nsTreeColFrame.cpp
+++ b/layout/xul/tree/nsTreeColFrame.cpp
@@ -167,18 +167,18 @@ nsTreeColFrame::GetTreeBoxObject()
   nsITreeBoxObject* result = nullptr;
 
   nsIContent* parent = mContent->GetParent();
   if (parent) {
     nsIContent* grandParent = parent->GetParent();
     RefPtr<nsXULElement> treeElement =
       nsXULElement::FromContentOrNull(grandParent);
     if (treeElement) {
-      IgnoredErrorResult ignored;
-      nsCOMPtr<nsIBoxObject> boxObject = treeElement->GetBoxObject(ignored);
+      nsCOMPtr<nsIBoxObject> boxObject =
+        treeElement->GetBoxObject(IgnoreErrors());
 
       nsCOMPtr<nsITreeBoxObject> treeBoxObject = do_QueryInterface(boxObject);
       result = treeBoxObject.get();
     }
   }
   return result;
 }
 
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -243,18 +243,17 @@ nsTreeContentView::GetCellProperties(int
   GetCellProperties(aRow, *col, aProps, rv);
   return rv.StealNSResult();
 }
 
 void
 nsTreeContentView::GetColumnProperties(nsTreeColumn& aColumn,
                                        nsAString& aProperties)
 {
-  IgnoredErrorResult rv;
-  RefPtr<Element> element = aColumn.GetElement(rv);
+  RefPtr<Element> element = aColumn.GetElement(IgnoreErrors());
 
   if (element) {
     element->GetAttribute(NS_LITERAL_STRING("properties"), aProperties);
   }
 }
 
 NS_IMETHODIMP
 nsTreeContentView::GetColumnProperties(nsITreeColumn* aCol, nsAString& aProps)
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -2079,17 +2079,17 @@ PeerConnectionImpl::UpdateNetworkState(b
 
 NS_IMETHODIMP
 PeerConnectionImpl::CloseStreams() {
   PC_AUTO_ENTER_API_CALL(false);
 
   return NS_OK;
 }
 
-nsresult
+NS_IMETHODIMP
 PeerConnectionImpl::SetPeerIdentity(const nsAString& aPeerIdentity)
 {
   PC_AUTO_ENTER_API_CALL(true);
   MOZ_ASSERT(!aPeerIdentity.IsEmpty());
 
   // once set, this can't be changed
   if (mPeerIdentity) {
     if (!mPeerIdentity->Equals(aPeerIdentity)) {
@@ -2572,82 +2572,70 @@ PeerConnectionImpl::GetFingerprint(char*
   char* tmp = new char[fpStr.size() + 1];
   std::copy(fpStr.begin(), fpStr.end(), tmp);
   tmp[fpStr.size()] = '\0';
 
   *fingerprint = tmp;
   return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 PeerConnectionImpl::GetLocalDescription(nsAString& aSDP)
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
   std::string localSdp = mJsepSession->GetLocalDescription(
       kJsepDescriptionPendingOrCurrent);
   aSDP = NS_ConvertASCIItoUTF16(localSdp.c_str());
-
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 PeerConnectionImpl::GetCurrentLocalDescription(nsAString& aSDP)
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
   std::string localSdp = mJsepSession->GetLocalDescription(kJsepDescriptionCurrent);
   aSDP = NS_ConvertASCIItoUTF16(localSdp.c_str());
-
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 PeerConnectionImpl::GetPendingLocalDescription(nsAString& aSDP)
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
   std::string localSdp = mJsepSession->GetLocalDescription(kJsepDescriptionPending);
   aSDP = NS_ConvertASCIItoUTF16(localSdp.c_str());
-
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 PeerConnectionImpl::GetRemoteDescription(nsAString& aSDP)
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
   std::string remoteSdp = mJsepSession->GetRemoteDescription(
       kJsepDescriptionPendingOrCurrent);
   aSDP = NS_ConvertASCIItoUTF16(remoteSdp.c_str());
-
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 PeerConnectionImpl::GetCurrentRemoteDescription(nsAString& aSDP)
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
   std::string remoteSdp = mJsepSession->GetRemoteDescription(kJsepDescriptionCurrent);
   aSDP = NS_ConvertASCIItoUTF16(remoteSdp.c_str());
-
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 PeerConnectionImpl::GetPendingRemoteDescription(nsAString& aSDP)
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
   std::string remoteSdp = mJsepSession->GetRemoteDescription(kJsepDescriptionPending);
   aSDP = NS_ConvertASCIItoUTF16(remoteSdp.c_str());
-
-  return NS_OK;
 }
 
 NS_IMETHODIMP
 PeerConnectionImpl::SignalingState(PCImplSignalingState* aState)
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
   MOZ_ASSERT(aState);
 
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -505,66 +505,66 @@ public:
   NS_IMETHODIMP_TO_ERRORRESULT(DisablePacketDump, ErrorResult& rv,
                                unsigned long level,
                                dom::mozPacketDumpType type,
                                bool sending)
   {
     rv = DisablePacketDump(level, type, sending);
   }
 
-  nsresult GetPeerIdentity(nsAString& peerIdentity)
+  void GetPeerIdentity(nsAString& peerIdentity)
   {
     if (mPeerIdentity) {
       peerIdentity = mPeerIdentity->ToString();
-      return NS_OK;
     }
 
     peerIdentity.SetIsVoid(true);
-    return NS_OK;
   }
 
   const PeerIdentity* GetPeerIdentity() const { return mPeerIdentity; }
-  nsresult SetPeerIdentity(const nsAString& peerIdentity);
+  NS_IMETHODIMP_TO_ERRORRESULT(SetPeerIdentity, ErrorResult& rv,
+			       const nsAString& peerIdentity)
+  {
+    rv = SetPeerIdentity(peerIdentity);
+  }
 
   const std::string& GetIdAsAscii() const
   {
     return mName;
   }
 
-  nsresult GetId(nsAString& id)
+  void GetId(nsAString& id)
   {
     id = NS_ConvertASCIItoUTF16(mName.c_str());
-    return NS_OK;
   }
 
-  nsresult SetId(const nsAString& id)
+  void SetId(const nsAString& id)
   {
     mName = NS_ConvertUTF16toUTF8(id).get();
-    return NS_OK;
   }
 
   // this method checks to see if we've made a promise to protect media.
   bool PrivacyRequested() const { return mPrivacyRequested; }
 
   NS_IMETHODIMP GetFingerprint(char** fingerprint);
   void GetFingerprint(nsAString& fingerprint)
   {
     char *tmp;
     GetFingerprint(&tmp);
     fingerprint.AssignASCII(tmp);
     delete[] tmp;
   }
 
-  NS_IMETHODIMP GetLocalDescription(nsAString& aSDP);
-  NS_IMETHODIMP GetCurrentLocalDescription(nsAString& aSDP);
-  NS_IMETHODIMP GetPendingLocalDescription(nsAString& aSDP);
+  void GetLocalDescription(nsAString& aSDP);
+  void GetCurrentLocalDescription(nsAString& aSDP);
+  void GetPendingLocalDescription(nsAString& aSDP);
 
-  NS_IMETHODIMP GetRemoteDescription(nsAString& aSDP);
-  NS_IMETHODIMP GetCurrentRemoteDescription(nsAString& aSDP);
-  NS_IMETHODIMP GetPendingRemoteDescription(nsAString& aSDP);
+  void GetRemoteDescription(nsAString& aSDP);
+  void GetCurrentRemoteDescription(nsAString& aSDP);
+  void GetPendingRemoteDescription(nsAString& aSDP);
 
   NS_IMETHODIMP SignalingState(mozilla::dom::PCImplSignalingState* aState);
 
   mozilla::dom::PCImplSignalingState SignalingState()
   {
     mozilla::dom::PCImplSignalingState state;
     SignalingState(&state);
     return state;
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -137,17 +137,16 @@
 @BINPATH@/components/dom_push.xpt
 #endif
 @BINPATH@/components/dom_quota.xpt
 @BINPATH@/components/dom_range.xpt
 @BINPATH@/components/dom_security.xpt
 @BINPATH@/components/dom_sidebar.xpt
 @BINPATH@/components/dom_storage.xpt
 @BINPATH@/components/dom_system.xpt
-@BINPATH@/components/dom_traversal.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
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -140,19 +140,16 @@ pref("dom.select_events.enabled", true);
 
 // Whether or not selection events on text controls are enabled
 #ifdef NIGHTLY_BUILD
 pref("dom.select_events.textcontrols.enabled", true);
 #else
 pref("dom.select_events.textcontrols.enabled", false);
 #endif
 
-// Whether or not Web Workers are enabled.
-pref("dom.workers.enabled", true);
-
 // The number of workers per domain allowed to run concurrently.
 // We're going for effectively infinite, while preventing abuse.
 pref("dom.workers.maxPerDomain", 512);
 
 pref("dom.serviceWorkers.enabled", false);
 
 // The amount of time (milliseconds) service workers keep running after each event.
 pref("dom.serviceWorkers.idle_timeout", 30000);
--- a/taskcluster/taskgraph/transforms/signing.py
+++ b/taskcluster/taskgraph/transforms/signing.py
@@ -6,16 +6,17 @@ Transform the signing task into an actua
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.util.attributes import copy_attributes_from_dependent_job
 from taskgraph.util.schema import validate_schema, Schema
 from taskgraph.util.scriptworker import (
+    add_scope_prefix,
     get_signing_cert_scope_per_platform,
     get_worker_type_for_scope,
 )
 from taskgraph.transforms.task import task_description_schema
 from voluptuous import Any, Required, Optional
 
 
 # Voluptuous uses marker objects as dictionary *keys*, but they are not
@@ -92,17 +93,19 @@ def make_task_description(config, jobs):
         attributes = dep_job.attributes
 
         signing_format_scopes = []
         formats = set([])
         for artifacts in job['upstream-artifacts']:
             for f in artifacts['formats']:
                 formats.add(f)  # Add each format only once
         for format in formats:
-            signing_format_scopes.append("project:releng:signing:format:{}".format(format))
+            signing_format_scopes.append(
+                add_scope_prefix(config, 'signing:format:{}'.format(format))
+            )
 
         treeherder = job.get('treeherder', {})
         is_nightly = dep_job.attributes.get('nightly', False)
         treeherder.setdefault('symbol', _generate_treeherder_symbol(is_nightly))
 
         dep_th_platform = dep_job.task.get('extra', {}).get(
             'treeherder', {}).get('machine', {}).get('platform', '')
         build_type = dep_job.attributes.get('build_type')
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -281,17 +281,17 @@ function takeInstrumentation() {
 
   // An iterator over an element and all of its descendants
   function* elementDescendants(element) {
     let walker = Cc["@mozilla.org/inspector/deep-tree-walker;1"].
                  createInstance(Ci.inIDeepTreeWalker);
     walker.showAnonymousContent = true;
     walker.showSubDocuments = false;
     walker.showDocumentsAsNodes = false;
-    walker.init(element, Ci.nsIDOMNodeFilter.SHOW_ELEMENT);
+    walker.init(element, 1 /* NodeFilter.SHOW_ELEMENT */);
 
     yield element;
     while (walker.nextNode()) {
       if (walker.currentNode instanceof Element) {
         yield walker.currentNode;
       }
     }
   }
--- a/testing/specialpowers/content/specialpowersAPI.js
+++ b/testing/specialpowers/content/specialpowersAPI.js
@@ -2190,17 +2190,17 @@ SpecialPowersAPI.prototype = {
     return this._pu;
   },
 
   createDOMWalker(node, showAnonymousContent) {
     node = unwrapIfWrapped(node);
     let walker = Cc["@mozilla.org/inspector/deep-tree-walker;1"].
                  createInstance(Ci.inIDeepTreeWalker);
     walker.showAnonymousContent = showAnonymousContent;
-    walker.init(node.ownerDocument, Ci.nsIDOMNodeFilter.SHOW_ALL);
+    walker.init(node.ownerDocument, 0xFFFFFFFF /* NodeFilter.SHOW_ALL */);
     walker.currentNode = node;
     return {
       get firstChild() {
         return wrapIfUnwrapped(walker.firstChild());
       },
       get lastChild() {
         return wrapIfUnwrapped(walker.lastChild());
       },
--- a/toolkit/components/viewsource/content/viewSource-content.js
+++ b/toolkit/components/viewsource/content/viewSource-content.js
@@ -535,17 +535,17 @@ var ViewSourceContent = {
     // id attributes in the format <pre id="line123">, meaning that
     // the first line in the pre element is number 123.
     // However, in the plain text case, there is only one <pre> without an id,
     // so assume line 1.
     let curLine = pre.id ? parseInt(pre.id.substring(4)) : 1;
 
     // Walk through each of the text nodes and count newlines.
     let treewalker = content.document
-        .createTreeWalker(pre, Ci.nsIDOMNodeFilter.SHOW_TEXT, null);
+        .createTreeWalker(pre, 4 /* NodeFilter.SHOW_TEXT */, null);
 
     // The column number of the first character in the current text node.
     let firstCol = 1;
 
     let found = false;
     for (let textNode = treewalker.firstChild();
          textNode && !found;
          textNode = treewalker.nextNode()) {
--- a/toolkit/content/widgets/radio.xml
+++ b/toolkit/content/widgets/radio.xml
@@ -243,19 +243,18 @@
           var radioChildren = [];
           var doc = this.ownerDocument;
 
           if (this.hasChildNodes()) {
             // Don't store the collected child nodes immediately,
             // collecting the child nodes could trigger constructors
             // which would blow away our list.
 
-            const nsIDOMNodeFilter = Components.interfaces.nsIDOMNodeFilter;
             var iterator = doc.createTreeWalker(this,
-                                                nsIDOMNodeFilter.SHOW_ELEMENT,
+						1 /* NodeFilter.SHOW_ELEMENT */,
                                                 this._filterRadioGroup);
             while (iterator.nextNode())
               radioChildren.push(iterator.currentNode);
             return this._radioChildren = radioChildren;
           }
 
           // We don't have child nodes.
           const XUL_NS = "http://www.mozilla.org/keymaster/"
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -1201,16 +1201,24 @@ GfxInfo::GetGfxDriverInfo()
     /* Disable D2D on Win8 on Intel HD Graphics on driver <= 8.15.10.2302
      * See bug 804144 and 863683
      */
     APPEND_TO_DRIVER_BLOCKLIST2( OperatingSystem::Windows8,
         (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorIntel), (GfxDeviceFamily*) GfxDriverInfo::GetDeviceFamily(IntelMobileHDGraphics),
       nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
       DRIVER_LESS_THAN_OR_EQUAL, V(8,15,10,2302), "FEATURE_FAILURE_BUG_804144" );
 
+    /* Disable D2D on Win7 on Intel HD Graphics on driver == 8.15.10.2418
+     * See bug 1433790
+     */
+    APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Windows7,
+      (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorIntel), (GfxDeviceFamily*)GfxDriverInfo::GetDeviceFamily(IntelHDGraphicsToSandyBridge),
+      nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
+      DRIVER_EQUAL, V(8, 15, 10, 2418), "FEATURE_FAILURE_BUG_1433790");
+
     /* Disable D3D11 layers on Intel G41 express graphics and Intel GM965, Intel X3100, for causing device resets.
      * See bug 1116812.
      */
     APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Windows,
         (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorIntel), (GfxDeviceFamily*) GfxDriverInfo::GetDeviceFamily(Bug1116812),
       nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
       DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_BUG_1116812" );
 
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -41,17 +41,16 @@
 #include "nsIDOMHTMLFormElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLMediaElement.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMMouseScrollEvent.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsIDOMNode.h"
-#include "nsIDOMNodeIterator.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMNotifyPaintEvent.h"
 #include "nsIDOMNSEvent.h"
 #include "nsIDOMOfflineResourceList.h"
 #include "nsIDOMPaintRequest.h"
 #include "nsIDOMParser.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsIDOMRange.h"
@@ -60,17 +59,16 @@
 #include "nsIDOMSerializer.h"
 #include "nsIDOMSimpleGestureEvent.h"
 #include "nsIDOMSVGElement.h"
 #include "nsIDOMSVGLength.h"
 #include "nsIDOMText.h"
 #include "nsIDOMTimeEvent.h"
 #include "nsIDOMTimeRanges.h"
 #include "nsIDOMTransitionEvent.h"
-#include "nsIDOMTreeWalker.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"
@@ -131,17 +129,16 @@
 #include "mozilla/dom/KeyEventBinding.h"
 #include "mozilla/dom/ListBoxObjectBinding.h"
 #include "mozilla/dom/MediaListBinding.h"
 #include "mozilla/dom/MessageEventBinding.h"
 #include "mozilla/dom/MenuBoxObjectBinding.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/dom/MouseScrollEventBinding.h"
 #include "mozilla/dom/MutationEventBinding.h"
-#include "mozilla/dom/NodeIteratorBinding.h"
 #include "mozilla/dom/NodeListBinding.h"
 #include "mozilla/dom/NodeBinding.h"
 #include "mozilla/dom/NotifyPaintEventBinding.h"
 #include "mozilla/dom/EventBinding.h"
 #include "mozilla/dom/OfflineResourceListBinding.h"
 #include "mozilla/dom/PaintRequestBinding.h"
 #include "mozilla/dom/PositionErrorBinding.h"
 #include "mozilla/dom/ProcessingInstructionBinding.h"
@@ -157,17 +154,16 @@
 #include "mozilla/dom/StyleSheetListBinding.h"
 #include "mozilla/dom/SVGElementBinding.h"
 #include "mozilla/dom/SVGLengthBinding.h"
 #include "mozilla/dom/TextBinding.h"
 #include "mozilla/dom/TimeEventBinding.h"
 #include "mozilla/dom/TimeRangesBinding.h"
 #include "mozilla/dom/TransitionEventBinding.h"
 #include "mozilla/dom/TreeBoxObjectBinding.h"
-#include "mozilla/dom/TreeWalkerBinding.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"
@@ -267,17 +263,16 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(HTMLInputElement),
   DEFINE_SHIM(HTMLMediaElement),
   DEFINE_SHIM(KeyEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIListBoxObject, ListBoxObject),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIMenuBoxObject, MenuBoxObject),
   DEFINE_SHIM(MouseEvent),
   DEFINE_SHIM(MouseScrollEvent),
   DEFINE_SHIM(MutationEvent),
-  DEFINE_SHIM(NodeIterator),
   DEFINE_SHIM(NodeList),
   DEFINE_SHIM(Node),
   DEFINE_SHIM(NotifyPaintEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMNSEvent, Event),
   DEFINE_SHIM(OfflineResourceList),
   DEFINE_SHIM(PaintRequest),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMParser, DOMParser),
   DEFINE_SHIM(ProcessingInstruction),
@@ -289,17 +284,16 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(SimpleGestureEvent),
   DEFINE_SHIM(SVGElement),
   DEFINE_SHIM(SVGLength),
   DEFINE_SHIM(Text),
   DEFINE_SHIM(TimeEvent),
   DEFINE_SHIM(TimeRanges),
   DEFINE_SHIM(TransitionEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsITreeBoxObject, TreeBoxObject),
-  DEFINE_SHIM(TreeWalker),
   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),