Fix for bug 801083 (Remove old proxy-based list bindings). r=bz.
authorPeter Van der Beken <peterv@propagandism.org>
Sat, 13 Oct 2012 14:50:24 +0200
changeset 119518 5d03feda23009d5a79a1ed880a6ff20af57dbf2b
parent 119517 404557eb178698a43e82c9f04e244258c255e61b
child 119519 92e4438ecf5e233da0243c1082e7af1758ce0672
child 119532 1e537983e72efe1f5047e28e41ac64b36907b428
push id273
push userlsblakk@mozilla.com
push dateThu, 14 Feb 2013 23:19:38 +0000
treeherdermozilla-release@c5e807a3f8b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs801083
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fix for bug 801083 (Remove old proxy-based list bindings). r=bz.
accessible/src/base/nsAccTreeWalker.cpp
accessible/src/xforms/nsXFormsAccessible.cpp
content/base/public/FragmentOrElement.h
content/base/public/nsIDOMFileList.idl
content/base/public/nsINodeList.h
content/base/src/FragmentOrElement.cpp
content/base/src/nsContentList.cpp
content/base/src/nsContentList.h
content/base/src/nsDOMFile.cpp
content/base/src/nsDOMSettableTokenList.cpp
content/base/src/nsDOMTokenList.cpp
content/base/src/nsDocument.cpp
content/base/src/nsReferencedElement.cpp
content/events/src/nsPaintRequest.cpp
content/html/content/public/nsIHTMLCollection.h
content/html/content/src/HTMLPropertiesCollection.cpp
content/html/content/src/HTMLPropertiesCollection.h
content/html/content/src/nsClientRect.cpp
content/html/content/src/nsHTMLFieldSetElement.cpp
content/html/content/src/nsHTMLFormElement.cpp
content/html/content/src/nsHTMLSelectElement.cpp
content/html/content/src/nsHTMLTableElement.cpp
content/html/content/src/nsHTMLTableRowElement.cpp
content/html/document/src/nsHTMLDocument.cpp
content/svg/content/src/DOMSVGLengthList.cpp
content/svg/content/src/DOMSVGNumberList.cpp
content/svg/content/src/DOMSVGPathSegList.cpp
content/svg/content/src/DOMSVGPointList.cpp
content/svg/content/src/DOMSVGTransformList.cpp
content/xbl/src/nsBindingManager.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsFocusManager.cpp
dom/bindings/BindingUtils.h
dom/bindings/Bindings.conf
dom/bindings/DOMJSProxyHandler.h
dom/interfaces/base/nsIDOMClientRectList.idl
dom/interfaces/core/nsIDOMDOMTokenList.idl
dom/interfaces/core/nsIDOMNodeList.idl
dom/interfaces/events/nsIDOMPaintRequestList.idl
dom/interfaces/html/nsIDOMHTMLCollection.idl
dom/interfaces/html/nsIDOMHTMLOptionsCollection.idl
dom/interfaces/html/nsIDOMHTMLPropertiesCollection.idl
dom/interfaces/html/nsIDOMPropertyNodeList.idl
dom/interfaces/svg/nsIDOMSVGLengthList.idl
dom/interfaces/svg/nsIDOMSVGNumberList.idl
dom/interfaces/svg/nsIDOMSVGPathSegList.idl
dom/interfaces/svg/nsIDOMSVGPointList.idl
dom/interfaces/svg/nsIDOMSVGTransformList.idl
editor/libeditor/text/nsPlaintextEditor.cpp
js/xpconnect/src/Makefile.in
js/xpconnect/src/XPCConvert.cpp
js/xpconnect/src/XPCJSID.cpp
js/xpconnect/src/XPCJSRuntime.cpp
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/codegen.py
js/xpconnect/src/dictionary_helper_gen.py
js/xpconnect/src/dombindings.conf
js/xpconnect/src/dombindings.cpp
js/xpconnect/src/dombindings.h
js/xpconnect/src/dombindingsgen.py
js/xpconnect/src/event_impl_gen.py
js/xpconnect/src/nsXPConnect.cpp
js/xpconnect/src/xpcpublic.h
js/xpconnect/tests/chrome/test_nodelists.xul
js/xpconnect/wrappers/FilteringWrapper.cpp
js/xpconnect/wrappers/WrapperFactory.cpp
js/xpconnect/wrappers/XrayWrapper.cpp
js/xpconnect/wrappers/XrayWrapper.h
layout/base/nsChildIterator.h
layout/base/nsFrameManager.cpp
modules/libpref/src/init/all.js
xpcom/idl-parser/xpidl.py
--- a/accessible/src/base/nsAccTreeWalker.cpp
+++ b/accessible/src/base/nsAccTreeWalker.cpp
@@ -69,17 +69,17 @@ nsAccTreeWalker::NextChildInternal(bool 
   if (!mState->childList)
     mState->childList = mState->content->GetChildren(mChildFilter);
 
   uint32_t length = 0;
   if (mState->childList)
     mState->childList->GetLength(&length);
 
   while (mState->childIdx < length) {
-    nsIContent* childNode = mState->childList->GetNodeAt(mState->childIdx);
+    nsIContent* childNode = mState->childList->Item(mState->childIdx);
     mState->childIdx++;
 
     bool isSubtreeHidden = false;
     Accessible* accessible = mWalkCache ? mDoc->GetAccessible(childNode) :
       GetAccService()->GetOrCreateAccessible(childNode, mDoc, &isSubtreeHidden);
 
     if (accessible)
       return accessible;
--- a/accessible/src/xforms/nsXFormsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsAccessible.cpp
@@ -62,17 +62,17 @@ nsXFormsAccessible::GetBoundChildElement
 
   nsINodeList* nodes = mContent->ChildNodes();
 
   uint32_t length;
   nsresult rv = nodes->GetLength(&length);
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (uint32_t index = 0; index < length; index++) {
-    nsIContent* content = nodes->GetNodeAt(index);
+    nsIContent* content = nodes->Item(index);
     if (content->NodeInfo()->Equals(aTagName) &&
         content->NodeInfo()->NamespaceEquals(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS))) {
       nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(content));
       return sXFormsService->GetValue(DOMNode, aValue);
     }
   }
 
   aValue.Truncate();
--- a/content/base/public/FragmentOrElement.h
+++ b/content/base/public/FragmentOrElement.h
@@ -57,16 +57,17 @@ public:
   virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
                                bool *triedToWrap);
 
   // nsIDOMNodeList interface
   NS_DECL_NSIDOMNODELIST
 
   // nsINodeList interface
   virtual int32_t IndexOf(nsIContent* aContent);
+  virtual nsIContent* Item(uint32_t aIndex);
 
   void DropReference()
   {
     mNode = nullptr;
   }
 
   virtual nsINode* GetParentObject()
   {
--- a/content/base/public/nsIDOMFileList.idl
+++ b/content/base/public/nsIDOMFileList.idl
@@ -2,15 +2,14 @@
 /* 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 nsIDOMFile;
 
-[scriptable, uuid(3bfef9fa-8ad3-4e49-bd62-d6cd75b29298)]
+[scriptable, uuid(283aa7b2-da81-4c72-aea2-9797b440fe34)]
 interface nsIDOMFileList : nsISupports
 {
   readonly attribute unsigned long length;
-  [getter,forward(getItemAt)] nsIDOMFile item(in unsigned long index);
-  [noscript,notxpcom,nostdcall] nsIDOMFile getItemAt(in unsigned long index);
+  nsIDOMFile item(in unsigned long index);
 };
--- a/content/base/public/nsINodeList.h
+++ b/content/base/public/nsINodeList.h
@@ -9,18 +9,18 @@
 #include "nsIDOMNodeList.h"
 #include "nsWrapperCache.h"
 
 class nsINode;
 class nsIContent;
 
 // IID for the nsINodeList interface
 #define NS_INODELIST_IID \
-{ 0xe60b773e, 0x5d20, 0x43f6, \
- { 0xb0, 0x8c, 0xfd, 0x65, 0x26, 0xce, 0xe0, 0x7a } }
+{ 0xadb5e54c, 0x6e96, 0x4102, \
+ { 0x8d, 0x40, 0xe0, 0x12, 0x3d, 0xcf, 0x48, 0x7a } }
 
 /**
  * An internal interface for a reasonably fast indexOf.
  */
 class nsINodeList : public nsIDOMNodeList,
                     public nsWrapperCache
 {
 public:
@@ -40,20 +40,17 @@ public:
   using nsIDOMNodeList::Item;
 
   uint32_t Length()
   {
     uint32_t length;
     GetLength(&length);
     return length;
   }
-  nsIContent* Item(uint32_t aIndex)
-  {
-    return GetNodeAt(aIndex);
-  }
+  virtual nsIContent* Item(uint32_t aIndex) = 0;
   nsIContent* IndexedGetter(uint32_t aIndex, bool& aFound)
   {
     nsIContent* item = Item(aIndex);
     aFound = !!item;
     return item;
   }
 };
 
--- a/content/base/src/FragmentOrElement.cpp
+++ b/content/base/src/FragmentOrElement.cpp
@@ -95,17 +95,16 @@
 #include "nsIViewManager.h"
 #include "nsIScrollableFrame.h"
 #include "nsXBLInsertionPoint.h"
 #include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
 #include "nsRuleProcessorData.h"
 #include "nsAsyncDOMEvent.h"
 #include "nsTextNode.h"
 #include "mozilla/dom/NodeListBinding.h"
-#include "dombindings.h"
 
 #ifdef MOZ_XUL
 #include "nsIXULDocument.h"
 #endif /* MOZ_XUL */
 
 #include "nsCycleCollectionParticipant.h"
 #include "nsCCUncollectableMarker.h"
 
@@ -384,48 +383,42 @@ NS_INTERFACE_TABLE_HEAD(nsChildContentLi
   NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsChildContentList)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(NodeList)
 NS_INTERFACE_MAP_END
 
 JSObject*
 nsChildContentList::WrapObject(JSContext *cx, JSObject *scope,
                                bool *triedToWrap)
 {
-  JSObject* obj = NodeListBinding::Wrap(cx, scope, this, triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::NodeList::create(cx, scope, this);
+  return NodeListBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 NS_IMETHODIMP
 nsChildContentList::GetLength(uint32_t* aLength)
 {
   *aLength = mNode ? mNode->GetChildCount() : 0;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsChildContentList::Item(uint32_t aIndex, nsIDOMNode** aReturn)
 {
-  nsINode* node = GetNodeAt(aIndex);
+  nsINode* node = Item(aIndex);
   if (!node) {
     *aReturn = nullptr;
 
     return NS_OK;
   }
 
   return CallQueryInterface(node, aReturn);
 }
 
 nsIContent*
-nsChildContentList::GetNodeAt(uint32_t aIndex)
+nsChildContentList::Item(uint32_t aIndex)
 {
   if (mNode) {
     return mNode->GetChildAt(aIndex);
   }
 
   return nullptr;
 }
 
@@ -674,17 +667,17 @@ FragmentOrElement::GetChildren(uint32_t 
   } else {
     childList = document->BindingManager()->GetContentListFor(this);
   }
 
   if (childList) {
     uint32_t length = 0;
     childList->GetLength(&length);
     for (uint32_t idx = 0; idx < length; idx++) {
-      nsIContent* child = childList->GetNodeAt(idx);
+      nsIContent* child = childList->Item(idx);
       list->AppendElement(child);
     }
   }
 
   if (frame) {
     // Append native anonymous content to the end.
     nsIAnonymousContentCreator* creator = do_QueryFrame(frame);
     if (creator) {
--- a/content/base/src/nsContentList.cpp
+++ b/content/base/src/nsContentList.cpp
@@ -16,17 +16,16 @@
 #include "nsIDocument.h"
 #include "nsGenericElement.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsContentUtils.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsGkAtoms.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 #include "mozilla/dom/NodeListBinding.h"
-#include "dombindings.h"
 
 // Form related includes
 #include "nsIDOMHTMLFormElement.h"
 
 #include "pldhash.h"
 
 #ifdef DEBUG_CONTENT_LIST
 #include "nsIContentIterator.h"
@@ -107,29 +106,29 @@ nsBaseContentList::GetLength(uint32_t* a
   *aLength = mElements.Length();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsBaseContentList::Item(uint32_t aIndex, nsIDOMNode** aReturn)
 {
-  nsISupports *tmp = GetNodeAt(aIndex);
+  nsISupports *tmp = Item(aIndex);
 
   if (!tmp) {
     *aReturn = nullptr;
 
     return NS_OK;
   }
 
   return CallQueryInterface(tmp, aReturn);
 }
 
 nsIContent*
-nsBaseContentList::GetNodeAt(uint32_t aIndex)
+nsBaseContentList::Item(uint32_t aIndex)
 {
   return mElements.SafeElementAt(aIndex);
 }
 
 
 int32_t
 nsBaseContentList::IndexOf(nsIContent *aContent, bool aDoFlush)
 {
@@ -158,39 +157,33 @@ NS_INTERFACE_MAP_END_INHERITING(nsBaseCo
 
 NS_IMPL_ADDREF_INHERITED(nsSimpleContentList, nsBaseContentList)
 NS_IMPL_RELEASE_INHERITED(nsSimpleContentList, nsBaseContentList)
 
 JSObject*
 nsSimpleContentList::WrapObject(JSContext *cx, JSObject *scope,
                                 bool *triedToWrap)
 {
-  JSObject* obj = NodeListBinding::Wrap(cx, scope, this, triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::NodeList::create(cx, scope, this);
+  return NodeListBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 // nsFormContentList
 
 nsFormContentList::nsFormContentList(nsIContent *aForm,
                                      nsBaseContentList& aContentList)
   : nsSimpleContentList(aForm)
 {
 
   // move elements that belong to mForm into this content list
 
   uint32_t i, length = 0;
   aContentList.GetLength(&length);
 
   for (i = 0; i < length; i++) {
-    nsIContent *c = aContentList.GetNodeAt(i);
+    nsIContent *c = aContentList.Item(i);
     if (c && nsContentUtils::BelongsInForm(aForm, c)) {
       AppendElement(c);
     }
   }
 }
 
 // Hashtable for storing nsContentLists
 static PLDHashTable gContentListHashTable;
@@ -298,37 +291,25 @@ const nsCacheableFuncStringContentList::
 const nsCacheableFuncStringContentList::ContentListType
   nsCacheableFuncStringHTMLCollection::sType = nsCacheableFuncStringContentList::eHTMLCollection;
 #endif
 
 JSObject*
 nsCacheableFuncStringNodeList::WrapObject(JSContext *cx, JSObject *scope,
                                           bool *triedToWrap)
 {
-  JSObject* obj = NodeListBinding::Wrap(cx, scope, this, triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::NodeList::create(cx, scope, this);
+  return NodeListBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 
 JSObject*
 nsCacheableFuncStringHTMLCollection::WrapObject(JSContext *cx, JSObject *scope,
                                                 bool *triedToWrap)
 {
-  JSObject* obj = HTMLCollectionBinding::Wrap(cx, scope, this, triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::HTMLCollection::create(cx, scope, this);
+  return HTMLCollectionBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 // Hashtable for storing nsCacheableFuncStringContentList
 static PLDHashTable gFuncStringContentListHashTable;
 
 struct FuncStringContentListHashEntry : public PLDHashEntryHdr
 {
   nsCacheableFuncStringContentList* mContentList;
@@ -536,23 +517,17 @@ nsContentList::~nsContentList()
     // Clean up mData
     (*mDestroyFunc)(mData);
   }
 }
 
 JSObject*
 nsContentList::WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap)
 {
-  JSObject* obj = HTMLCollectionBinding::Wrap(cx, scope, this, triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::HTMLCollection::create(cx, scope, this);
+  return HTMLCollectionBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 DOMCI_DATA(ContentList, nsContentList)
 
 // QueryInterface implementation for nsContentList
 NS_INTERFACE_TABLE_HEAD(nsContentList)
   NS_NODELIST_OFFSET_AND_INTERFACE_TABLE_BEGIN(nsContentList)
     NS_CONTENT_LIST_INTERFACES(nsContentList)
@@ -657,17 +632,17 @@ nsContentList::GetLength(uint32_t* aLeng
   *aLength = Length(true);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsContentList::Item(uint32_t aIndex, nsIDOMNode** aReturn)
 {
-  nsINode* node = GetNodeAt(aIndex);
+  nsINode* node = Item(aIndex);
 
   if (node) {
     return CallQueryInterface(node, aReturn);
   }
 
   *aReturn = nullptr;
 
   return NS_OK;
@@ -689,29 +664,21 @@ nsContentList::NamedItem(const nsAString
 
 nsGenericElement*
 nsContentList::GetElementAt(uint32_t aIndex)
 {
   return static_cast<nsGenericElement*>(Item(aIndex, true));
 }
 
 nsIContent*
-nsContentList::GetNodeAt(uint32_t aIndex)
+nsContentList::Item(uint32_t aIndex)
 {
   return GetElementAt(aIndex);
 }
 
-nsISupports*
-nsContentList::GetNamedItem(const nsAString& aName, nsWrapperCache **aCache)
-{
-  nsIContent *item;
-  *aCache = item = NamedItem(aName, true);
-  return item;
-}
-
 JSObject*
 nsContentList::NamedItem(JSContext* cx, const nsAString& name,
                          mozilla::ErrorResult& error)
 {
   nsIContent *item = NamedItem(name, true);
   if (!item) {
     return nullptr;
   }
--- a/content/base/src/nsContentList.h
+++ b/content/base/src/nsContentList.h
@@ -59,17 +59,18 @@ public:
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   // nsIDOMNodeList
   NS_DECL_NSIDOMNODELIST
 
   // nsINodeList
   virtual int32_t IndexOf(nsIContent* aContent);
-  
+  virtual nsIContent* Item(uint32_t aIndex);
+
   uint32_t Length() const { 
     return mElements.Length();
   }
 
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsBaseContentList)
 
   void AppendElement(nsIContent *aContent)
   {
@@ -268,17 +269,18 @@ public:
   // nsBaseContentList overrides
   virtual int32_t IndexOf(nsIContent *aContent, bool aDoFlush);
   virtual int32_t IndexOf(nsIContent* aContent);
   virtual nsINode* GetParentObject()
   {
     return mRootNode;
   }
 
-  virtual nsIContent* GetNodeAt(uint32_t aIndex);
+  virtual nsIContent* Item(uint32_t aIndex);
+  virtual nsGenericElement* GetElementAt(uint32_t index);
   virtual JSObject* NamedItem(JSContext* cx, const nsAString& name,
                               mozilla::ErrorResult& error);
 
   // nsContentList public methods
   NS_HIDDEN_(uint32_t) Length(bool aDoFlush);
   NS_HIDDEN_(nsIContent*) Item(uint32_t aIndex, bool aDoFlush);
   NS_HIDDEN_(nsIContent*) NamedItem(const nsAString& aName, bool aDoFlush);
 
--- a/content/base/src/nsDOMFile.cpp
+++ b/content/base/src/nsDOMFile.cpp
@@ -31,17 +31,16 @@
 #include "nsJSUtils.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Attributes.h"
 
 #include "plbase64.h"
 #include "prmem.h"
 #include "mozilla/dom/FileListBinding.h"
-#include "dombindings.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 // XXXkhuey the input stream that we pass out of a DOMFile
 // can outlive the actual DOMFile object.  Thus, we must
 // ensure that the buffer underlying the stream we get
 // from NS_NewByteInputStream is held alive as long as the
@@ -704,29 +703,17 @@ NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMFileList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMFileList)
 
 JSObject*
 nsDOMFileList::WrapObject(JSContext *cx, JSObject *scope,
                           bool *triedToWrap)
 {
-  JSObject* obj = FileListBinding::Wrap(cx, scope, this, triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::FileList::create(cx, scope, this);
-}
-
-nsIDOMFile*
-nsDOMFileList::GetItemAt(uint32_t aIndex)
-{
-  return Item(aIndex);
+  return FileListBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 NS_IMETHODIMP
 nsDOMFileList::GetLength(uint32_t* aLength)
 {
   *aLength = Length();
 
   return NS_OK;
--- a/content/base/src/nsDOMSettableTokenList.cpp
+++ b/content/base/src/nsDOMSettableTokenList.cpp
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Implementation of nsIDOMDOMSettableTokenList specified by HTML5.
  */
 
 #include "nsDOMSettableTokenList.h"
 #include "mozilla/dom/DOMSettableTokenListBinding.h"
-#include "dombindings.h"
 
 
 nsDOMSettableTokenList::nsDOMSettableTokenList(nsGenericElement *aElement, nsIAtom* aAttrAtom)
   : nsDOMTokenList(aElement, aAttrAtom)
 {
 }
 
 nsDOMSettableTokenList::~nsDOMSettableTokenList()
@@ -47,19 +46,11 @@ nsDOMSettableTokenList::SetValue(const n
 
   return mElement->SetAttr(kNameSpaceID_None, mAttrAtom, aValue, true);
 }
 
 JSObject*
 nsDOMSettableTokenList::WrapObject(JSContext *cx, JSObject *scope,
                                    bool *triedToWrap)
 {
-  JSObject* obj = mozilla::dom::DOMSettableTokenListBinding::Wrap(cx, scope,
-                                                                  this,
-                                                                  triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return mozilla::dom::oldproxybindings::DOMSettableTokenList::create(cx, scope,
-                                                                      this);
+  return mozilla::dom::DOMSettableTokenListBinding::Wrap(cx, scope, this,
+                                                         triedToWrap);
 }
--- a/content/base/src/nsDOMTokenList.cpp
+++ b/content/base/src/nsDOMTokenList.cpp
@@ -8,17 +8,16 @@
 
 #include "nsDOMTokenList.h"
 
 #include "nsAttrValue.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
 #include "nsGenericElement.h"
 #include "mozilla/dom/DOMTokenListBinding.h"
-#include "dombindings.h"
 #include "mozilla/ErrorResult.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsDOMTokenList::nsDOMTokenList(nsGenericElement* aElement, nsIAtom* aAttrAtom)
   : mElement(aElement),
     mAttrAtom(aAttrAtom)
@@ -308,17 +307,11 @@ nsDOMTokenList::ToString(nsAString& aRes
 {
   Stringify(aResult);
   return NS_OK;
 }
 
 JSObject*
 nsDOMTokenList::WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap)
 {
-  JSObject* obj = DOMTokenListBinding::Wrap(cx, scope, this, triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::DOMTokenList::create(cx, scope, this);
+  return DOMTokenListBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -5134,17 +5134,17 @@ nsDocument::GetAnonymousElementByAttribu
     return nullptr;
 
   uint32_t length = 0;
   nodeList->GetLength(&length);
 
   bool universalMatch = aAttrValue.EqualsLiteral("*");
 
   for (uint32_t i = 0; i < length; ++i) {
-    nsIContent* current = nodeList->GetNodeAt(i);
+    nsIContent* current = nodeList->Item(i);
     nsIContent* matchedElm =
       GetElementByAttribute(current, aAttrName, aAttrValue, universalMatch);
     if (matchedElm)
       return matchedElm;
   }
 
   return nullptr;
 }
@@ -8108,17 +8108,17 @@ nsDocument::FindImageMap(const nsAString
   const nsAString& mapName = Substring(start, end);
 
   if (!mImageMaps) {
     mImageMaps = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::map, nsGkAtoms::map);
   }
 
   uint32_t i, n = mImageMaps->Length(true);
   for (i = 0; i < n; ++i) {
-    nsIContent* map = mImageMaps->GetNodeAt(i);
+    nsIContent* map = mImageMaps->Item(i);
     if (map->AttrValueIs(kNameSpaceID_None, nsGkAtoms::id, mapName,
                          eCaseMatters) ||
         map->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, mapName,
                          eIgnoreCase)) {
       return map->AsElement();
     }
   }
 
--- a/content/base/src/nsReferencedElement.cpp
+++ b/content/base/src/nsReferencedElement.cpp
@@ -66,17 +66,17 @@ nsReferencedElement::Reset(nsIContent* a
         nsINodeList* anonymousChildren =
           doc->BindingManager()->GetAnonymousNodesFor(bindingParent);
 
         if (anonymousChildren) {
           uint32_t length;
           anonymousChildren->GetLength(&length);
           for (uint32_t i = 0; i < length && !mElement; ++i) {
             mElement =
-              nsContentUtils::MatchElementId(anonymousChildren->GetNodeAt(i), ref);
+              nsContentUtils::MatchElementId(anonymousChildren->Item(i), ref);
           }
         }
 
         // We don't have watching working yet for XBL, so bail out here.
         return;
       }
     }
   }
--- a/content/events/src/nsPaintRequest.cpp
+++ b/content/events/src/nsPaintRequest.cpp
@@ -5,17 +5,16 @@
 
 #include "nsPaintRequest.h"
 
 #include "nsDOMClassInfoID.h"
 #include "nsClientRect.h"
 #include "nsIFrame.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/PaintRequestListBinding.h"
-#include "dombindings.h"
 
 DOMCI_DATA(PaintRequest, nsPaintRequest)
 
 NS_INTERFACE_TABLE_HEAD(nsPaintRequest)
   NS_INTERFACE_TABLE1(nsPaintRequest, nsIDOMPaintRequest)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(PaintRequest)
 NS_INTERFACE_MAP_END
@@ -54,38 +53,25 @@ NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintRequestList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequestList)
 
 JSObject*
 nsPaintRequestList::WrapObject(JSContext *cx, JSObject *scope,
                                bool *triedToWrap)
 {
-  JSObject* obj = mozilla::dom::PaintRequestListBinding::Wrap(cx, scope, this,
-                                                              triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return mozilla::dom::oldproxybindings::PaintRequestList::create(cx, scope,
-                                                                  this);
+  return mozilla::dom::PaintRequestListBinding::Wrap(cx, scope, this,
+                                                     triedToWrap);
 }
 
 NS_IMETHODIMP    
 nsPaintRequestList::GetLength(uint32_t* aLength)
 {
   *aLength = Length();
   return NS_OK;
 }
 
 NS_IMETHODIMP    
 nsPaintRequestList::Item(uint32_t aIndex, nsIDOMPaintRequest** aReturn)
 {
   NS_IF_ADDREF(*aReturn = Item(aIndex));
   return NS_OK;
 }
-
-nsIDOMPaintRequest*
-nsPaintRequestList::GetItemAt(uint32_t aIndex)
-{
-  return Item(aIndex);
-}
--- a/content/html/content/public/nsIHTMLCollection.h
+++ b/content/html/content/public/nsIHTMLCollection.h
@@ -6,25 +6,26 @@
 #ifndef nsIHTMLCollection_h___
 #define nsIHTMLCollection_h___
 
 #include "nsIDOMHTMLCollection.h"
 #include "nsWrapperCache.h"
 
 struct JSContext;
 struct JSObject;
+class nsGenericElement;
 class nsINode;
 namespace mozilla {
 class ErrorResult;
 }
 
 // IID for the nsIHTMLCollection interface
 #define NS_IHTMLCOLLECTION_IID \
-{ 0x5c6012c3, 0xa816, 0x4f28, \
- { 0xab, 0x93, 0xe9, 0x8a, 0x36, 0x16, 0x88, 0xf2 } }
+{ 0x5643235d, 0x9a72, 0x4b6a, \
+ { 0xa6, 0x0c, 0x64, 0x63, 0x72, 0xb7, 0x53, 0x4a } }
 
 /**
  * An internal interface
  */
 class nsIHTMLCollection : public nsIDOMHTMLCollection
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTMLCOLLECTION_IID)
@@ -38,16 +39,17 @@ public:
   using nsIDOMHTMLCollection::NamedItem;
 
   uint32_t Length()
   {
     uint32_t length;
     GetLength(&length);
     return length;
   }
+  virtual nsGenericElement* GetElementAt(uint32_t index) = 0;
   nsGenericElement* Item(uint32_t index)
   {
     return GetElementAt(index);
   }
   nsGenericElement* IndexedGetter(uint32_t index, bool& aFound)
   {
     nsGenericElement* item = Item(index);
     aFound = !!item;
--- a/content/html/content/src/HTMLPropertiesCollection.cpp
+++ b/content/html/content/src/HTMLPropertiesCollection.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=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 "HTMLPropertiesCollection.h"
-#include "dombindings.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsGenericHTMLElement.h"
 #include "nsVariant.h"
 #include "nsDOMSettableTokenList.h"
 #include "nsAttrValue.h"
 #include "nsWrapperCacheInlines.h"
 #include "mozilla/dom/HTMLPropertiesCollectionBinding.h"
@@ -105,24 +104,17 @@ HTMLPropertiesCollection::SetDocument(ns
   mNamedItemEntries.EnumerateRead(SetPropertyListDocument, aDocument);
   mIsDirty = true;
 }
 
 JSObject*
 HTMLPropertiesCollection::WrapObject(JSContext* cx, JSObject* scope,
                                      bool* triedToWrap)
 {
-  JSObject* obj = HTMLPropertiesCollectionBinding::Wrap(cx, scope, this,
-                                                        triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::HTMLPropertiesCollection::create(cx, scope, this);
+  return HTMLPropertiesCollectionBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 NS_IMETHODIMP
 HTMLPropertiesCollection::GetLength(uint32_t* aLength)
 {
   EnsureFresh();
   *aLength = mProperties.Length();
   return NS_OK;
@@ -153,34 +145,16 @@ HTMLPropertiesCollection::NamedItem(JSCo
                                     mozilla::ErrorResult& error)
 {
   // HTMLPropertiesCollection.namedItem and the named getter call the NamedItem
   // that returns a PropertyNodeList, calling HTMLCollection.namedItem doesn't
   // make sense so this returns null.
   return nullptr;
 }
 
-nsISupports*
-HTMLPropertiesCollection::GetNamedItem(const nsAString& aName,
-                                       nsWrapperCache **aCache)
-{
-  if (!IsSupportedNamedProperty(aName)) {
-    *aCache = NULL;
-    return NULL;
-  }
-
-  nsRefPtr<PropertyNodeList> propertyList;
-  if (!mNamedItemEntries.Get(aName, getter_AddRefs(propertyList))) {
-    propertyList = new PropertyNodeList(this, mRoot, aName);
-    mNamedItemEntries.Put(aName, propertyList);
-  }
-  *aCache = propertyList;
-  return static_cast<nsIDOMPropertyNodeList*>(propertyList);
-}
-
 nsGenericElement*
 HTMLPropertiesCollection::GetElementAt(uint32_t aIndex)
 {
   EnsureFresh();
   return mProperties.SafeElementAt(aIndex);
 }
 
 nsINode*
@@ -424,17 +398,17 @@ PropertyNodeList::Item(uint32_t aIndex, 
   if (!element) {
     *aReturn = NULL;
     return NS_OK;
   }
   return CallQueryInterface(element, aReturn);
 }
 
 nsIContent*
-PropertyNodeList::GetNodeAt(uint32_t aIndex)
+PropertyNodeList::Item(uint32_t aIndex)
 {
   EnsureFresh();
   return mElements.SafeElementAt(aIndex);
 }
 
 int32_t
 PropertyNodeList::IndexOf(nsIContent* aContent)
 {
@@ -444,26 +418,19 @@ PropertyNodeList::IndexOf(nsIContent* aC
 
 nsINode*
 PropertyNodeList::GetParentObject()
 {
   return mParent;
 }
 
 JSObject*
-PropertyNodeList::WrapObject(JSContext *cx, JSObject *scope,
-                             bool *triedToWrap)
+PropertyNodeList::WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap)
 {
-  JSObject* obj = PropertyNodeListBinding::Wrap(cx, scope, this, triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::PropertyNodeList::create(cx, scope, this);
+  return PropertyNodeListBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(PropertyNodeList)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(PropertyNodeList)
   // SetDocument(nullptr) ensures that we remove ourselves as a mutation observer
   tmp->SetDocument(nullptr);
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mParent)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCollection)
--- a/content/html/content/src/HTMLPropertiesCollection.h
+++ b/content/html/content/src/HTMLPropertiesCollection.h
@@ -54,16 +54,18 @@ class HTMLPropertiesCollection : public 
   friend class PropertyStringList;
 public:
   HTMLPropertiesCollection(nsGenericHTMLElement* aRoot);
   virtual ~HTMLPropertiesCollection();
 
   virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
                                bool *triedToWrap);
 
+  virtual nsGenericElement* GetElementAt(uint32_t aIndex);
+
   NS_IMETHOD NamedItem(const nsAString& aName, nsIDOMNode** aResult);
   void SetDocument(nsIDocument* aDocument);
   nsINode* GetParentObject();
   virtual JSObject* NamedItem(JSContext* cx, const nsAString& name,
                               mozilla::ErrorResult& error);
   PropertyNodeList* NamedItem(const nsAString& aName);
   PropertyNodeList* NamedGetter(const nsAString& aName, bool& aFound)
   {
@@ -136,16 +138,17 @@ public:
   virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
                                bool *triedToWrap);
 
   void SetDocument(nsIDocument* aDocument);
 
   void GetValues(JSContext* aCx, nsTArray<JS::Value >& aResult,
                  ErrorResult& aError);
 
+  virtual nsIContent* Item(uint32_t aIndex);
   NS_DECL_NSIDOMPROPERTYNODELIST
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(PropertyNodeList,
                                                          nsINodeList)
 
   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
--- a/content/html/content/src/nsClientRect.cpp
+++ b/content/html/content/src/nsClientRect.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsClientRect.h"
 #include "nsContentUtils.h"
 #include "nsDOMClassInfoID.h"
 
 #include "nsPresContext.h"
 #include "mozilla/dom/ClientRectListBinding.h"
-#include "dombindings.h"
 
 DOMCI_DATA(ClientRect, nsClientRect)
 
 NS_INTERFACE_TABLE_HEAD(nsClientRect)
   NS_INTERFACE_TABLE1(nsClientRect, nsIDOMClientRect)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ClientRect)
 NS_INTERFACE_MAP_END
@@ -93,33 +92,21 @@ nsClientRectList::GetLength(uint32_t* aL
 
 NS_IMETHODIMP    
 nsClientRectList::Item(uint32_t aIndex, nsIDOMClientRect** aReturn)
 {
   NS_IF_ADDREF(*aReturn = Item(aIndex));
   return NS_OK;
 }
 
-nsIDOMClientRect*
-nsClientRectList::GetItemAt(uint32_t aIndex)
-{
-  return Item(aIndex);
-}
-
 JSObject*
 nsClientRectList::WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap)
 {
-  JSObject* obj = mozilla::dom::ClientRectListBinding::Wrap(cx, scope, this,
-                                                            triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return mozilla::dom::oldproxybindings::ClientRectList::create(cx, scope, this);
+  return mozilla::dom::ClientRectListBinding::Wrap(cx, scope, this,
+                                                   triedToWrap);
 }
 
 static double
 RoundFloat(double aValue)
 {
   return floor(aValue + 0.5);
 }
 
--- a/content/html/content/src/nsHTMLFieldSetElement.cpp
+++ b/content/html/content/src/nsHTMLFieldSetElement.cpp
@@ -94,17 +94,17 @@ nsHTMLFieldSetElement::AfterSetAttr(int3
       nsINode::GetFirstChild()) {
     if (!mElements) {
       mElements = new nsContentList(this, MatchListedElements, nullptr, nullptr,
                                     true);
     }
 
     uint32_t length = mElements->Length(true);
     for (uint32_t i=0; i<length; ++i) {
-      static_cast<nsGenericHTMLFormElement*>(mElements->GetNodeAt(i))
+      static_cast<nsGenericHTMLFormElement*>(mElements->Item(i))
         ->FieldSetDisabledChanged(aNotify);
     }
   }
 
   return nsGenericHTMLFormElement::AfterSetAttr(aNameSpaceID, aName,
                                                 aValue, aNotify);
 }
 
@@ -225,13 +225,13 @@ nsHTMLFieldSetElement::NotifyElementsFor
    */
   if (!mElements) {
     mElements = new nsContentList(this, MatchListedElements, nullptr, nullptr,
                                   true);
   }
 
   uint32_t length = mElements->Length(true);
   for (uint32_t i = 0; i < length; ++i) {
-    static_cast<nsGenericHTMLFormElement*>(mElements->GetNodeAt(i))
+    static_cast<nsGenericHTMLFormElement*>(mElements->Item(i))
       ->FieldSetFirstLegendChanged(aNotify);
   }
 }
 
--- a/content/html/content/src/nsHTMLFormElement.cpp
+++ b/content/html/content/src/nsHTMLFormElement.cpp
@@ -47,17 +47,16 @@
 
 #include "mozAutoDocUpdate.h"
 #include "nsIHTMLCollection.h"
 
 #include "nsIConstraintValidation.h"
 
 #include "nsIDOMHTMLButtonElement.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
-#include "dombindings.h"
 #include "nsSandboxFlags.h"
 
 using namespace mozilla::dom;
 
 static const int NS_FORM_CONTROL_LIST_HASHTABLE_SIZE = 16;
 
 static const uint8_t NS_FORM_AUTOCOMPLETE_ON  = 1;
 static const uint8_t NS_FORM_AUTOCOMPLETE_OFF = 0;
@@ -88,16 +87,17 @@ public:
 
   void DropFormReference();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   // nsIDOMHTMLCollection interface
   NS_DECL_NSIDOMHTMLCOLLECTION
 
+  virtual nsGenericElement* GetElementAt(uint32_t index);
   virtual nsINode* GetParentObject()
   {
     return mForm;
   }
 
   virtual JSObject* NamedItem(JSContext* cx, const nsAString& name,
                               mozilla::ErrorResult& error);
 
@@ -120,23 +120,17 @@ public:
    * @return NS_OK or NS_ERROR_OUT_OF_MEMORY.
    */
   nsresult GetSortedControls(nsTArray<nsGenericHTMLFormElement*>& aControls) const;
 
   // nsWrapperCache
   virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
                                bool *triedToWrap)
   {
-    JSObject* obj = HTMLCollectionBinding::Wrap(cx, scope, this, triedToWrap);
-    if (obj || *triedToWrap) {
-      return obj;
-    }
-
-    *triedToWrap = true;
-    return oldproxybindings::HTMLCollection::create(cx, scope, this);
+    return HTMLCollectionBinding::Wrap(cx, scope, this, triedToWrap);
   }
 
   nsHTMLFormElement* mForm;  // WEAK - the form owns me
 
   nsTArray<nsGenericHTMLFormElement*> mElements;  // Holds WEAK references - bug 36639
 
   // This array holds on to all form controls that are not contained
   // in mElements (form.elements in JS, see ShouldBeInFormControl()).
@@ -1943,17 +1937,17 @@ nsHTMLFormElement::GetNextRadioButton(co
     if (aPrevious) {
       if (--index < 0) {
         index = numRadios -1;
       }
     }
     else if (++index >= (int32_t)numRadios) {
       index = 0;
     }
-    radio = do_QueryInterface(radioGroup->GetNodeAt(index));
+    radio = do_QueryInterface(radioGroup->Item(index));
     if (!radio)
       continue;
 
     // XXXbz why is this formControl check needed, exactly?
     formControl = do_QueryInterface(radio);
     if (!formControl || formControl->GetType() != NS_FORM_INPUT_RADIO)
       continue;
 
@@ -2340,17 +2334,17 @@ nsFormControlList::AddElementToTable(nsG
 
       NS_ASSERTION(list->Length() > 1,
                    "List should have been converted back to a single element");
 
       // Fast-path appends; this check is ok even if the child is
       // already in the list, since if it tests true the child would
       // have come at the end of the list, and the PositionIsBefore
       // will test false.
-      if (nsContentUtils::PositionIsBefore(list->GetNodeAt(list->Length() - 1), aChild)) {
+      if (nsContentUtils::PositionIsBefore(list->Item(list->Length() - 1), aChild)) {
         list->AppendElement(aChild);
         return NS_OK;
       }
 
       // If a control has a name equal to its id, it could be in the
       // list already.
       if (list->IndexOf(aChild) != -1) {
         return NS_OK;
@@ -2361,17 +2355,17 @@ nsFormControlList::AddElementToTable(nsG
       uint32_t first = 0;
       uint32_t last = list->Length() - 1;
       uint32_t mid;
       
       // Stop when there is only one index in our range
       while (last != first) {
         mid = (first + last) / 2;
           
-        if (nsContentUtils::PositionIsBefore(aChild, list->GetNodeAt(mid)))
+        if (nsContentUtils::PositionIsBefore(aChild, list->Item(mid)))
           last = mid;
         else
           first = mid + 1;
       }
 
       list->InsertElementAt(aChild, first);
     }
   }
@@ -2430,17 +2424,17 @@ nsFormControlList::RemoveElementFromTabl
 
   if (!length) {
     // If the list is empty we remove if from our hash, this shouldn't
     // happen tho
     mNameLookupTable.Remove(aName);
   } else if (length == 1) {
     // Only one element left, replace the list in the hash with the
     // single element.
-    nsIContent* node = list->GetNodeAt(0);
+    nsIContent* node = list->Item(0);
     if (node) {
       mNameLookupTable.Put(aName, node);
     }
   }
 
   return NS_OK;
 }
 
@@ -2524,24 +2518,16 @@ nsFormControlList::GetSortedControls(nsT
 nsGenericElement*
 nsFormControlList::GetElementAt(uint32_t aIndex)
 {
   FlushPendingNotifications();
 
   return mElements.SafeElementAt(aIndex, nullptr);
 }
 
-nsISupports*
-nsFormControlList::GetNamedItem(const nsAString& aName, nsWrapperCache **aCache)
-{
-  nsISupports *item = NamedItemInternal(aName, true);
-  *aCache = nullptr;
-  return item;
-}
-
 JSObject*
 nsFormControlList::NamedItem(JSContext* cx, const nsAString& name,
                              mozilla::ErrorResult& error)
 {
   nsISupports *item = NamedItemInternal(name, true);
   if (!item) {
     return nullptr;
   }
--- a/content/html/content/src/nsHTMLSelectElement.cpp
+++ b/content/html/content/src/nsHTMLSelectElement.cpp
@@ -31,17 +31,16 @@
 
 #include "nsError.h"
 #include "nsServiceManagerUtils.h"
 #include "nsRuleData.h"
 #include "nsEventDispatcher.h"
 #include "mozilla/dom/Element.h"
 #include "mozAutoDocUpdate.h"
 #include "mozilla/dom/HTMLOptionsCollectionBinding.h"
-#include "dombindings.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS1(nsSelectState, nsSelectState)
 NS_DEFINE_STATIC_IID_ACCESSOR(nsSelectState, NS_SELECT_STATE_IID)
 
 //----------------------------------------------------------------------
@@ -2009,23 +2008,17 @@ NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsHTMLOptionCollection)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsHTMLOptionCollection)
 
 
 JSObject*
 nsHTMLOptionCollection::WrapObject(JSContext *cx, JSObject *scope,
                                    bool *triedToWrap)
 {
-  JSObject* obj = HTMLOptionsCollectionBinding::Wrap(cx, scope, this, triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return oldproxybindings::HTMLOptionsCollection::create(cx, scope, this);
+  return HTMLOptionsCollectionBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 NS_IMETHODIMP
 nsHTMLOptionCollection::GetLength(uint32_t* aLength)
 {
   *aLength = mElements.Length();
 
   return NS_OK;
@@ -2165,25 +2158,16 @@ GetNamedItemHelper(nsTArray<nsRefPtr<nsH
                               eCaseMatters))) {
       return content;
     }
   }
 
   return nullptr;
 }
 
-nsISupports*
-nsHTMLOptionCollection::GetNamedItem(const nsAString& aName,
-                                     nsWrapperCache **aCache)
-{
-  nsINode *item = GetNamedItemHelper(mElements, aName);
-  *aCache = item;
-  return item;
-}
-
 nsINode*
 nsHTMLOptionCollection::GetParentObject()
 {
   return mSelect;
 }
 
 NS_IMETHODIMP
 nsHTMLOptionCollection::NamedItem(const nsAString& aName,
--- a/content/html/content/src/nsHTMLTableElement.cpp
+++ b/content/html/content/src/nsHTMLTableElement.cpp
@@ -21,17 +21,16 @@
 #include "nsRuleData.h"
 #include "nsStyleContext.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsIDOMElement.h"
 #include "nsIHTMLCollection.h"
 #include "nsHTMLStyleSheet.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
-#include "dombindings.h"
 
 using namespace mozilla;
 
 /* ------------------------------ TableRowsCollection -------------------------------- */
 /**
  * This class provides a late-bound collection of rows in a table.
  * mParent is NOT ref-counted to avoid circular references
  */
@@ -40,41 +39,35 @@ class TableRowsCollection : public nsIHT
 {
 public:
   TableRowsCollection(nsHTMLTableElement *aParent);
   virtual ~TableRowsCollection();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIDOMHTMLCOLLECTION
 
+  virtual nsGenericElement* GetElementAt(uint32_t aIndex);
   virtual nsINode* GetParentObject()
   {
     return mParent;
   }
 
   virtual JSObject* NamedItem(JSContext* cx, const nsAString& name,
                               ErrorResult& error);
 
   NS_IMETHOD    ParentDestroyed();
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TableRowsCollection)
 
   // nsWrapperCache
   virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
                                bool *triedToWrap)
   {
-    JSObject* obj = mozilla::dom::HTMLCollectionBinding::Wrap(cx, scope, this,
-                                                              triedToWrap);
-    if (obj || *triedToWrap) {
-      return obj;
-    }
-
-    *triedToWrap = true;
-    return mozilla::dom::oldproxybindings::HTMLCollection::create(cx, scope,
-                                                                  this);
+    return mozilla::dom::HTMLCollectionBinding::Wrap(cx, scope, this,
+                                                     triedToWrap);
   }
 
 protected:
   // Those rows that are not in table sections
   nsHTMLTableElement* mParent;
   nsRefPtr<nsContentList> mOrphanRows;  
 };
 
@@ -140,26 +133,26 @@ NS_INTERFACE_MAP_END
         do { /* gives scoping */                                     \
           _code                                                      \
         } while (0);                                                 \
       }                                                              \
       /* TBodies */                                                  \
       nsContentList *_tbodies = mParent->TBodies();                  \
       nsINode * _node;                                               \
       uint32_t _tbodyIndex = 0;                                      \
-      _node = _tbodies->GetNodeAt(_tbodyIndex);                      \
+      _node = _tbodies->Item(_tbodyIndex);                           \
       while (_node) {                                                \
         rowGroup = do_QueryInterface(_node);                         \
         if (rowGroup) {                                              \
           rowGroup->GetRows(getter_AddRefs(rows));                   \
           do { /* gives scoping */                                   \
             _code                                                    \
           } while (0);                                               \
         }                                                            \
-        _node = _tbodies->GetNodeAt(++_tbodyIndex);                  \
+        _node = _tbodies->Item(++_tbodyIndex);                       \
       }                                                              \
       /* orphan rows */                                              \
       rows = mOrphanRows;                                            \
       do { /* gives scoping */                                       \
         _code                                                        \
       } while (0);                                                   \
       /* TFoot */                                                    \
       rowGroup = mParent->GetTFoot();                                \
@@ -245,76 +238,62 @@ TableRowsCollection::Item(uint32_t aInde
     *aReturn = nullptr;
 
     return NS_OK;
   }
 
   return CallQueryInterface(node, aReturn);
 }
 
-static nsISupports*
-GetNamedItemInRowGroup(nsIDOMHTMLCollection* aRows, const nsAString& aName,
-                       nsWrapperCache** aCache)
-{
-  nsCOMPtr<nsIHTMLCollection> rows = do_QueryInterface(aRows);
-  if (rows) {
-    return rows->GetNamedItem(aName, aCache);
-  }
-
-  return nullptr;
-}
-
-nsISupports* 
-TableRowsCollection::GetNamedItem(const nsAString& aName,
-                                  nsWrapperCache** aCache)
-{
-  DO_FOR_EACH_ROWGROUP(
-    nsISupports* item = GetNamedItemInRowGroup(rows, aName, aCache);
-    if (item) {
-      return item;
-    }
-  );
-  *aCache = nullptr;
-  return nullptr;
-}
-
 JSObject*
 TableRowsCollection::NamedItem(JSContext* cx, const nsAString& name,
                                ErrorResult& error)
 {
-  nsWrapperCache* cache;
   DO_FOR_EACH_ROWGROUP(
-    nsISupports* item = GetNamedItemInRowGroup(rows, name, &cache);
-    if (item) {
-      JSObject* wrapper = GetWrapper();
-      JSAutoCompartment ac(cx, wrapper);
-      JS::Value v;
-      if (!mozilla::dom::WrapObject(cx, wrapper, item, cache, nullptr, &v)) {
-        error.Throw(NS_ERROR_FAILURE);
+    nsCOMPtr<nsIHTMLCollection> collection = do_QueryInterface(rows);
+    if (collection) {
+      // We'd like to call the nsIHTMLCollection::NamedItem that returns a
+      // JSObject*, but that relies on collection having a cached wrapper, which
+      // we can't guarantee here.
+      nsCOMPtr<nsIDOMNode> item;
+      error = collection->NamedItem(name, getter_AddRefs(item));
+      if (error.Failed()) {
         return nullptr;
       }
-      return &v.toObject();
+      if (item) {
+        JSObject* wrapper = GetWrapper();
+        JSAutoCompartment ac(cx, wrapper);
+        JS::Value v;
+        if (!mozilla::dom::WrapObject(cx, wrapper, item, &v)) {
+          error.Throw(NS_ERROR_FAILURE);
+          return nullptr;
+        }
+        return &v.toObject();
+      }
     }
   );
   return nullptr;
 }
 
 NS_IMETHODIMP 
 TableRowsCollection::NamedItem(const nsAString& aName,
                                nsIDOMNode** aReturn)
 {
-  nsWrapperCache *cache;
-  nsISupports* item = GetNamedItem(aName, &cache);
-  if (!item) {
-    *aReturn = nullptr;
+  DO_FOR_EACH_ROWGROUP(
+    nsCOMPtr<nsIHTMLCollection> collection = do_QueryInterface(rows);
+    if (collection) {
+      nsresult rv = collection->NamedItem(aName, aReturn);
+      if (NS_FAILED(rv) || *aReturn) {
+        return rv;
+      }
+    }
+  );
 
-    return NS_OK;
-  }
-
-  return CallQueryInterface(item, aReturn);
+  *aReturn = nullptr;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 TableRowsCollection::ParentDestroyed()
 {
   // see comment in destructor, do NOT release mParent!
   mParent = nullptr;
 
--- a/content/html/content/src/nsHTMLTableRowElement.cpp
+++ b/content/html/content/src/nsHTMLTableRowElement.cpp
@@ -139,21 +139,21 @@ nsHTMLTableRowElement::GetRowIndex(int32
   nsCOMPtr<nsIDOMHTMLTableElement> table = GetTable();
   if (!table) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDOMHTMLCollection> rows;
   table->GetRows(getter_AddRefs(rows));
 
-  uint32_t numRows;
-  rows->GetLength(&numRows);
+  nsCOMPtr<nsIHTMLCollection> coll = do_QueryInterface(rows);
+  uint32_t numRows = coll->Length();
 
   for (uint32_t i = 0; i < numRows; i++) {
-    if (rows->GetElementAt(i) == this) {
+    if (coll->GetElementAt(i) == this) {
       *aValue = i;
       break;
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -163,20 +163,20 @@ nsHTMLTableRowElement::GetSectionRowInde
   nsCOMPtr<nsIDOMHTMLTableSectionElement> section = GetSection();
   if (!section) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDOMHTMLCollection> rows;
   section->GetRows(getter_AddRefs(rows));
 
-  uint32_t numRows;
-  rows->GetLength(&numRows);
+  nsCOMPtr<nsIHTMLCollection> coll = do_QueryInterface(rows);
+  uint32_t numRows = coll->Length();
   for (uint32_t i = 0; i < numRows; i++) {
-    if (rows->GetElementAt(i) == this) {
+    if (coll->GetElementAt(i) == this) {
       *aValue = i;
       break;
     }
   }
 
   return NS_OK;
 }
 
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -1035,17 +1035,17 @@ nsHTMLDocument::GetBody()
     return body;
   }
 
   // The document is most likely a frameset document so look for the
   // outer most frameset element
   nsRefPtr<nsContentList> nodeList =
     NS_GetContentList(this, kNameSpaceID_XHTML, NS_LITERAL_STRING("frameset"));
 
-  return nodeList->GetNodeAt(0);
+  return nodeList->Item(0);
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::GetBody(nsIDOMHTMLElement** aBody)
 {
   *aBody = nullptr;
 
   nsIContent *body = GetBody();
@@ -2091,17 +2091,17 @@ nsHTMLDocument::ResolveName(const nsAStr
     list->GetLength(&length);
   }
 
   if (length > 0) {
     if (length == 1) {
       // Only one element in the list, return the element instead of
       // returning the list
 
-      nsIContent *node = list->GetNodeAt(0);
+      nsIContent *node = list->Item(0);
       if (!aForm || nsContentUtils::BelongsInForm(aForm, node)) {
         NS_ADDREF(*aResult = node);
         *aCache = node;
       }
 
       return NS_OK;
     }
 
@@ -2119,17 +2119,17 @@ nsHTMLDocument::ResolveName(const nsAStr
       uint32_t len;
       fc_list->GetLength(&len);
 
       if (len < 2) {
         // After the nsFormContentList is done filtering there's either
         // nothing or one element in the list.  Return that element, or null
         // if there's no element in the list.
 
-        nsIContent *node = fc_list->GetNodeAt(0);
+        nsIContent *node = fc_list->Item(0);
 
         NS_IF_ADDREF(*aResult = node);
         *aCache = node;
 
         delete fc_list;
 
         return NS_OK;
       }
--- a/content/svg/content/src/DOMSVGLengthList.cpp
+++ b/content/svg/content/src/DOMSVGLengthList.cpp
@@ -6,17 +6,16 @@
 #include "nsSVGElement.h"
 #include "DOMSVGLengthList.h"
 #include "DOMSVGLength.h"
 #include "nsError.h"
 #include "SVGAnimatedLengthList.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/SVGLengthListBinding.h"
-#include "dombindings.h"
 
 // See the comment in this file's header.
 
 // local helper functions
 namespace {
 
 using mozilla::DOMSVGLength;
 
@@ -72,31 +71,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLengthList)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGLengthList)
 NS_INTERFACE_MAP_END
 
 JSObject*
 DOMSVGLengthList::WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap)
 {
-  JSObject* obj = mozilla::dom::SVGLengthListBinding::Wrap(cx, scope, this,
-                                                           triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return mozilla::dom::oldproxybindings::SVGLengthList::create(cx, scope, this);
-}
-
-nsIDOMSVGLength*
-DOMSVGLengthList::GetItemAt(uint32_t aIndex)
-{
-  ErrorResult rv;
-  return GetItem(aIndex, rv);
+  return mozilla::dom::SVGLengthListBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 void
 DOMSVGLengthList::InternalListLengthWillChange(uint32_t aNewLength)
 {
   uint32_t oldLength = mItems.Length();
 
   if (aNewLength > DOMSVGLength::MaxListIndex()) {
--- a/content/svg/content/src/DOMSVGNumberList.cpp
+++ b/content/svg/content/src/DOMSVGNumberList.cpp
@@ -6,17 +6,16 @@
 #include "nsSVGElement.h"
 #include "DOMSVGNumberList.h"
 #include "DOMSVGNumber.h"
 #include "nsError.h"
 #include "SVGAnimatedNumberList.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/SVGNumberListBinding.h"
-#include "dombindings.h"
 
 // See the comment in this file's header.
 
 namespace mozilla {
 
 // local helper functions
 namespace {
 
@@ -73,31 +72,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGNumberList)
 NS_INTERFACE_MAP_END
 
 
 JSObject*
 DOMSVGNumberList::WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap)
 {
-  JSObject* obj = mozilla::dom::SVGNumberListBinding::Wrap(cx, scope, this,
-                                                           triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return mozilla::dom::oldproxybindings::SVGNumberList::create(cx, scope, this);
-}
-
-nsIDOMSVGNumber*
-DOMSVGNumberList::GetItemAt(uint32_t aIndex)
-{
-  ErrorResult rv;
-  return GetItem(aIndex, rv);
+  return mozilla::dom::SVGNumberListBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 void
 DOMSVGNumberList::InternalListLengthWillChange(uint32_t aNewLength)
 {
   uint32_t oldLength = mItems.Length();
 
   if (aNewLength > DOMSVGNumber::MaxListIndex()) {
--- a/content/svg/content/src/DOMSVGPathSegList.cpp
+++ b/content/svg/content/src/DOMSVGPathSegList.cpp
@@ -7,17 +7,16 @@
 #include "DOMSVGPathSegList.h"
 #include "DOMSVGPathSeg.h"
 #include "nsError.h"
 #include "SVGAnimatedPathSegList.h"
 #include "nsCOMPtr.h"
 #include "nsSVGAttrTearoffTable.h"
 #include "SVGPathSegUtils.h"
 #include "mozilla/dom/SVGPathSegListBinding.h"
-#include "dombindings.h"
 #include "nsContentUtils.h"
 
 // See the comment in this file's header.
 
 namespace mozilla {
 
 static nsSVGAttrTearoffTable<void, DOMSVGPathSegList>
   sSVGPathSegListTearoffTable;
@@ -79,32 +78,18 @@ DOMSVGPathSegList::~DOMSVGPathSegList()
     InternalAList().GetAnimValKey() :
     InternalAList().GetBaseValKey();
   sSVGPathSegListTearoffTable.RemoveTearoff(key);
 }
 
 JSObject*
 DOMSVGPathSegList::WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap)
 {
-  JSObject* obj = mozilla::dom::SVGPathSegListBinding::Wrap(cx, scope, this,
-                                                            triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return mozilla::dom::oldproxybindings::SVGPathSegList::create(cx, scope,
-                                                                this);
-}
-
-nsIDOMSVGPathSeg*
-DOMSVGPathSegList::GetItemAt(uint32_t aIndex)
-{
-  ErrorResult rv;
-  return GetItem(aIndex, rv);
+  return mozilla::dom::SVGPathSegListBinding::Wrap(cx, scope, this,
+                                                   triedToWrap);
 }
 
 void
 DOMSVGPathSegList::InternalListWillChangeTo(const SVGPathData& aNewValue)
 {
   // When the number of items in our internal counterpart changes, we MUST stay
   // in sync. Everything in the scary comment in
   // DOMSVGLengthList::InternalBaseValListWillChangeTo applies here just as
--- a/content/svg/content/src/DOMSVGPointList.cpp
+++ b/content/svg/content/src/DOMSVGPointList.cpp
@@ -7,17 +7,16 @@
 #include "DOMSVGPointList.h"
 #include "DOMSVGPoint.h"
 #include "nsError.h"
 #include "SVGAnimatedPointList.h"
 #include "nsCOMPtr.h"
 #include "nsSVGAttrTearoffTable.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/SVGPointListBinding.h"
-#include "dombindings.h"
 
 // See the comment in this file's header.
 
 // local helper functions
 namespace {
 
 using mozilla::DOMSVGPoint;
 
@@ -98,37 +97,17 @@ DOMSVGPointList::~DOMSVGPointList()
     InternalAList().GetAnimValKey() :
     InternalAList().GetBaseValKey();
   sSVGPointListTearoffTable.RemoveTearoff(key);
 }
 
 JSObject*
 DOMSVGPointList::WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap)
 {
-  JSObject* obj = mozilla::dom::SVGPointListBinding::Wrap(cx, scope, this,
-                                                          triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return mozilla::dom::oldproxybindings::SVGPointList::create(cx, scope, this);
-}
-
-nsIDOMSVGPoint*
-DOMSVGPointList::GetItemAt(uint32_t aIndex)
-{
-  if (IsAnimValList()) {
-    Element()->FlushAnimations();
-  }
-  if (aIndex < LengthNoFlush()) {
-    EnsureItemAt(aIndex);
-    return mItems[aIndex];
-  }
-  return nullptr;
+  return mozilla::dom::SVGPointListBinding::Wrap(cx, scope, this, triedToWrap);
 }
 
 void
 DOMSVGPointList::InternalListWillChangeTo(const SVGPointList& aNewValue)
 {
   // When the number of items in our internal counterpart changes, we MUST stay
   // in sync. Everything in the scary comment in
   // DOMSVGLengthList::InternalBaseValListWillChangeTo applies here too!
--- a/content/svg/content/src/DOMSVGTransformList.cpp
+++ b/content/svg/content/src/DOMSVGTransformList.cpp
@@ -5,17 +5,16 @@
 
 #include "DOMSVGTransformList.h"
 #include "DOMSVGTransform.h"
 #include "DOMSVGMatrix.h"
 #include "SVGAnimatedTransformList.h"
 #include "nsSVGElement.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/SVGTransformListBinding.h"
-#include "dombindings.h"
 #include "nsError.h"
 
 // local helper functions
 namespace {
 
 void UpdateListIndicesFromIndex(
   nsTArray<mozilla::DOMSVGTransform*>& aItemsArray,
   uint32_t aStartingIndex)
@@ -73,32 +72,18 @@ NS_INTERFACE_MAP_END
 
 //----------------------------------------------------------------------
 // DOMSVGTransformList methods:
 
 JSObject*
 DOMSVGTransformList::WrapObject(JSContext *cx, JSObject *scope,
                                 bool *triedToWrap)
 {
-  JSObject* obj = mozilla::dom::SVGTransformListBinding::Wrap(cx, scope, this,
-                                                              triedToWrap);
-  if (obj || *triedToWrap) {
-    return obj;
-  }
-
-  *triedToWrap = true;
-  return mozilla::dom::oldproxybindings::SVGTransformList::create(cx, scope,
-                                                                  this);
-}
-
-nsIDOMSVGTransform*
-DOMSVGTransformList::GetItemAt(uint32_t aIndex)
-{
-  ErrorResult rv;
-  return GetItem(aIndex, rv);
+  return mozilla::dom::SVGTransformListBinding::Wrap(cx, scope, this,
+                                                     triedToWrap);
 }
 
 void
 DOMSVGTransformList::InternalListLengthWillChange(uint32_t aNewLength)
 {
   uint32_t oldLength = mItems.Length();
 
   if (aNewLength > DOMSVGTransform::MaxListIndex()) {
--- a/content/xbl/src/nsBindingManager.cpp
+++ b/content/xbl/src/nsBindingManager.cpp
@@ -39,17 +39,16 @@
 #include "nsIScriptGlobalObject.h"
 #include "nsTHashtable.h"
 
 #include "nsIScriptContext.h"
 #include "nsBindingManager.h"
 
 #include "nsThreadUtils.h"
 #include "mozilla/dom/NodeListBinding.h"
-#include "dombindings.h"
 
 // ==================================================================
 // = nsAnonymousContentList 
 // ==================================================================
 
 #define NS_ANONYMOUS_CONTENT_LIST_IID \
   { 0xbfb5d8e7, 0xf718, 0x4a46, \
     { 0xb2, 0x2b, 0x22, 0x4a, 0x44, 0x4c, 0xb9, 0x77 } }
@@ -66,33 +65,27 @@ public:
   NS_DECL_NSIDOMNODELIST
 
   // nsINodeList interface
   virtual int32_t IndexOf(nsIContent* aContent);
   virtual nsINode *GetParentObject()
   {
     return mContent;
   }
+  virtual nsIContent* Item(uint32_t aIndex);
 
   int32_t GetInsertionPointCount() { return mElements->Length(); }
 
   nsXBLInsertionPoint* GetInsertionPointAt(int32_t i) { return static_cast<nsXBLInsertionPoint*>(mElements->ElementAt(i)); }
   void RemoveInsertionPointAt(int32_t i) { mElements->RemoveElementAt(i); }
 
   virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
                                bool *triedToWrap)
   {
-    JSObject* obj = mozilla::dom::NodeListBinding::Wrap(cx, scope, this,
-                                                        triedToWrap);
-    if (obj || *triedToWrap) {
-      return obj;
-    }
-
-    *triedToWrap = true;
-    return mozilla::dom::oldproxybindings::NodeList::create(cx, scope, this);
+    return mozilla::dom::NodeListBinding::Wrap(cx, scope, this, triedToWrap);
   }
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ANONYMOUS_CONTENT_LIST_IID)
 private:
   nsCOMPtr<nsIContent> mContent;
   nsInsertionPointList* mElements;
 };
 
@@ -169,25 +162,25 @@ nsAnonymousContentList::GetLength(uint32
     *aLength += static_cast<nsXBLInsertionPoint*>(mElements->ElementAt(i))->ChildCount();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP    
 nsAnonymousContentList::Item(uint32_t aIndex, nsIDOMNode** aReturn)
 {
-  nsINode* item = GetNodeAt(aIndex);
+  nsINode* item = Item(aIndex);
   if (!item)
     return NS_ERROR_FAILURE;
 
   return CallQueryInterface(item, aReturn);    
 }
 
 nsIContent*
-nsAnonymousContentList::GetNodeAt(uint32_t aIndex)
+nsAnonymousContentList::Item(uint32_t aIndex)
 {
   int32_t cnt = mElements->Length();
   uint32_t pointCount = 0;
 
   for (int32_t i = 0; i < cnt; i++) {
     aIndex -= pointCount;
     
     nsXBLInsertionPoint* point = static_cast<nsXBLInsertionPoint*>(mElements->ElementAt(i));
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -482,17 +482,16 @@
 using mozilla::dom::indexedDB::IDBWrapperCache;
 
 #include "nsIDOMMediaQueryList.h"
 
 #include "nsDOMTouchEvent.h"
 #include "nsDOMMutationObserver.h"
 
 #include "nsWrapperCacheInlines.h"
-#include "dombindings.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 
 #include "nsIDOMBatteryManager.h"
 #include "BatteryManager.h"
 #include "nsIDOMPowerManager.h"
 #include "nsIDOMWakeLock.h"
 #include "nsIDOMSmsManager.h"
 #include "nsIDOMSmsMessage.h"
@@ -4532,23 +4531,19 @@ nsDOMClassInfo::Init()
   RegisterExternalClasses();
 
   sDisableDocumentAllSupport =
     Preferences::GetBool("browser.dom.document.all.disabled");
 
   sDisableGlobalScopePollutionSupport =
     Preferences::GetBool("browser.dom.global_scope_pollution.disabled");
 
-  // Non-proxy bindings
+  // Register new DOM bindings
   mozilla::dom::Register(nameSpaceManager);
 
-  // This needs to happen after the call to mozilla::dom::Register, because we
-  // overwrite some values.
-  mozilla::dom::oldproxybindings::Register(nameSpaceManager);
-
   sIsInitialized = true;
 
   return NS_OK;
 }
 
 // static
 int32_t
 nsDOMClassInfo::GetArrayIndexFromId(JSContext *cx, jsid id, bool *aIsNumber)
@@ -8912,17 +8907,17 @@ nsHTMLDocumentSH::DocumentAllGetProperty
     // Map document.all[n] (where n is a number) to the n:th item in
     // the document.all node list.
 
     nsRefPtr<nsContentList> nodeList;
     if (!GetDocumentAllNodeList(cx, obj, doc, getter_AddRefs(nodeList))) {
       return JS_FALSE;
     }
 
-    nsIContent *node = nodeList->GetNodeAt(JSID_TO_INT(id));
+    nsIContent *node = nodeList->Item(JSID_TO_INT(id));
 
     result = node;
     cache = node;
   } else {
     result = nullptr;
   }
 
   if (result) {
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -319,17 +319,17 @@ nsFocusManager::GetRedirectedFocus(nsICo
       }
       else if (aContent->Tag() == nsGkAtoms::scale) {
         nsCOMPtr<nsIDocument> doc = aContent->GetCurrentDoc();
         if (!doc)
           return nullptr;
 
         nsINodeList* children = doc->BindingManager()->GetXBLChildNodesFor(aContent);
         if (children) {
-          nsIContent* child = children->GetNodeAt(0);
+          nsIContent* child = children->Item(0);
           if (child && child->Tag() == nsGkAtoms::slider)
             return child;
         }
       }
     }
 
     if (inputField) {
       nsCOMPtr<nsIContent> retval = do_QueryInterface(inputField);
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -95,20 +95,17 @@ UnwrapDOMObject(JSObject* obj, DOMObject
 {
   MOZ_ASSERT(slot != eNonDOMObject,
              "Don't pass non-DOM objects to this function");
 
 #ifdef DEBUG
   if (IsDOMClass(js::GetObjectClass(obj))) {
     MOZ_ASSERT(slot == eRegularDOMObject);
   } else {
-    MOZ_ASSERT(js::IsObjectProxyClass(js::GetObjectClass(obj)) ||
-               js::IsFunctionProxyClass(js::GetObjectClass(obj)));
-    MOZ_ASSERT(js::GetProxyHandler(obj)->family() == ProxyFamily());
-    MOZ_ASSERT(IsNewProxyBinding(js::GetProxyHandler(obj)));
+    MOZ_ASSERT(IsDOMProxy(obj));
     MOZ_ASSERT(slot == eProxyDOMObject);
   }
 #endif
 
   JS::Value val = js::GetReservedSlot(obj, slot);
   // XXXbz/khuey worker code tries to unwrap interface objects (which have
   // nothing here).  That needs to stop.
   // XXX We don't null-check UnwrapObject's result; aren't we going to crash
@@ -124,34 +121,33 @@ UnwrapDOMObject(JSObject* obj, DOMObject
 inline const DOMClass*
 GetDOMClass(JSObject* obj)
 {
   js::Class* clasp = js::GetObjectClass(obj);
   if (IsDOMClass(clasp)) {
     return &DOMJSClass::FromJSClass(clasp)->mClass;
   }
 
+  MOZ_ASSERT(IsDOMProxy(obj));
   js::BaseProxyHandler* handler = js::GetProxyHandler(obj);
-  MOZ_ASSERT(handler->family() == ProxyFamily());
-  MOZ_ASSERT(IsNewProxyBinding(handler));
   return &static_cast<DOMProxyHandler*>(handler)->mClass;
 }
 
 inline DOMObjectSlot
 GetDOMClass(JSObject* obj, const DOMClass*& result)
 {
   js::Class* clasp = js::GetObjectClass(obj);
   if (IsDOMClass(clasp)) {
     result = &DOMJSClass::FromJSClass(clasp)->mClass;
     return eRegularDOMObject;
   }
 
   if (js::IsObjectProxyClass(clasp) || js::IsFunctionProxyClass(clasp)) {
     js::BaseProxyHandler* handler = js::GetProxyHandler(obj);
-    if (handler->family() == ProxyFamily() && IsNewProxyBinding(handler)) {
+    if (handler->family() == ProxyFamily()) {
       result = &static_cast<DOMProxyHandler*>(handler)->mClass;
       return eProxyDOMObject;
     }
   }
 
   return eNonDOMObject;
 }
 
@@ -169,18 +165,17 @@ UnwrapDOMObjectToISupports(JSObject* obj
 }
 
 inline bool
 IsDOMObject(JSObject* obj)
 {
   js::Class* clasp = js::GetObjectClass(obj);
   return IsDOMClass(clasp) ||
          ((js::IsObjectProxyClass(clasp) || js::IsFunctionProxyClass(clasp)) &&
-          (js::GetProxyHandler(obj)->family() == ProxyFamily() &&
-           IsNewProxyBinding(js::GetProxyHandler(obj))));
+          js::GetProxyHandler(obj)->family() == ProxyFamily());
 }
 
 // Some callers don't want to set an exception when unwrapping fails
 // (for example, overload resolution uses unwrapping to tell what sort
 // of thing it's looking at).
 // U must be something that a T* can be assigned to (e.g. T* or an nsRefPtr<T>).
 template <prototypes::ID PrototypeID, class T, typename U>
 inline nsresult
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -120,51 +120,46 @@ DOMInterfaces = {
         'mozFillRule': 'fillRule'
     }
 }],
 
 'ClientRectList': [
 {
     'nativeType': 'nsClientRectList',
     'headerFile': 'nsClientRect.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'item' ]
 }],
 
 'CSS2Properties': {
-  'nativeType': 'nsDOMCSSDeclaration',
-  'prefable': True,
+  'nativeType': 'nsDOMCSSDeclaration'
 },
 
 'CSSStyleDeclaration': {
-  'nativeType': 'nsICSSDeclaration',
-  'prefable': True
+  'nativeType': 'nsICSSDeclaration'
 },
 
 'Document': [
 {
     'nativeType': 'nsIDocument',
 },
 {
     'workers': True,
 }],
 
 'DOMSettableTokenList': [
 {
     'nativeType': 'nsDOMSettableTokenList',
-    'prefable': True,
     'binaryNames': {
         '__stringifier': 'Stringify'
     }
 }],
 
 'DOMTokenList': [
 {
     'nativeType': 'nsDOMTokenList',
-    'prefable': True,
     'binaryNames': {
         '__stringifier': 'Stringify'
     }
 }],
 
 'Event': [
 {
     'workers': True,
@@ -186,51 +181,47 @@ DOMInterfaces = {
     'workers': True,
     'concrete': False
 }],
 
 'FileList': [
 {
     'nativeType': 'nsDOMFileList',
     'headerFile': 'nsDOMFile.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'item' ]
 }],
 
 'FileReaderSync': {
     'workers': True,
 },
 
 'FormData': [
 {
     'workers': True,
 }],
 
 'HTMLCollection': [
 {
     'nativeType': 'nsIHTMLCollection',
-    'prefable': True,
     'resultNotAddRefed': [ 'item' ]
 }],
 
 'HTMLOptionsCollection': [
 {
     'nativeType': 'nsHTMLOptionCollection',
     'headerFile': 'nsHTMLSelectElement.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'item' ],
     'binaryNames': {
         '__indexedsettercreator': 'SetOption'
     }
 }],
 
 'HTMLPropertiesCollection': [
 {
     'headerFile': 'HTMLPropertiesCollection.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'item', 'namedItem', 'names' ]
 }],
 
 'IID': [
 {
     'nativeType': 'nsIJSID',
     'headerFile': 'xpcjsid.h',
 },
@@ -262,25 +253,23 @@ DOMInterfaces = {
 },
 {
     'workers': True,
 }],
 
 'NodeList': [
 {
     'nativeType': 'nsINodeList',
-    'prefable': True,
     'resultNotAddRefed': [ 'item' ]
 }],
 
 'PaintRequestList': [
 {
     'nativeType': 'nsPaintRequestList',
     'headerFile': 'nsPaintRequest.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'item' ]
 }],
 
 'Performance': {
     'nativeType': 'nsPerformance',
     'resultNotAddRefed': [ 'timing', 'navigation' ]
 },
 
@@ -292,62 +281,56 @@ DOMInterfaces = {
 'PerformanceNavigation': {
     'nativeType': 'nsPerformanceNavigation',
     'headerFile': 'nsPerformance.h'
 },
 
 'PropertyNodeList': [
 {
     'headerFile': 'HTMLPropertiesCollection.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'item' ]
 }],
 
 'Screen': {
     'nativeType': 'nsScreen',
     'prefable': True,
 },
 
 'SVGLengthList': [
 {
     'nativeType': 'mozilla::DOMSVGLengthList',
     'headerFile': 'DOMSVGLengthList.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'getItem' ]
 }],
 
 'SVGNumberList': [
 {
     'nativeType': 'mozilla::DOMSVGNumberList',
     'headerFile': 'DOMSVGNumberList.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'getItem' ]
 }],
 
 'SVGPathSegList': [
 {
     'nativeType': 'mozilla::DOMSVGPathSegList',
     'headerFile': 'DOMSVGPathSegList.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'getItem' ]
 }],
 
 'SVGPointList': [
 {
     'nativeType': 'mozilla::DOMSVGPointList',
     'headerFile': 'DOMSVGPointList.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'getItem' ]
 }],
 
 'SVGTransformList': [
 {
     'nativeType': 'mozilla::DOMSVGTransformList',
     'headerFile': 'DOMSVGTransformList.h',
-    'prefable': True,
     'resultNotAddRefed': [ 'getItem' ]
 }],
 
 'TextEncoder': {
     'headerFile': 'mozilla/dom/TextEncoder.h',
     'implicitJSContext': [ 'encode' ],
 },
 
@@ -451,16 +434,22 @@ DOMInterfaces = {
 },
 
 'WebGLUniformLocation': {
    'nativeType': 'mozilla::WebGLUniformLocation',
    'headerFile': 'WebGLContext.h',
    'wrapperCache': False
 },
 
+'WebSocket': [
+{
+    'headerFile': 'WebSocket.h',
+    'implicitJSContext': [ 'constructor' ]
+}],
+
 'XMLHttpRequest': [
 {
     'nativeType': 'nsXMLHttpRequest',
     'implicitJSContext': [ 'constructor', ],
     'resultNotAddRefed': [ 'upload', 'responseXML' ]
 },
 {
     'workers': True,
@@ -483,22 +472,16 @@ DOMInterfaces = {
     'nativeType': 'nsXMLHttpRequestUpload',
     'headerFile': 'nsXMLHttpRequest.h',
     'prefable': True
 },
 {
     'workers': True,
 }],
 
-'WebSocket': [
-{
-    'headerFile': 'WebSocket.h',
-    'implicitJSContext': [ 'constructor' ]
-}],
-
 ####################################
 # Test Interfaces of various sorts #
 ####################################
 
 'TestInterface' : {
         # Keep this in sync with TestExampleInterface
         'headerFile': 'TestBindingHeader.h',
         'register': False,
--- a/dom/bindings/DOMJSProxyHandler.h
+++ b/dom/bindings/DOMJSProxyHandler.h
@@ -20,21 +20,21 @@ namespace dom {
 
 enum {
   JSPROXYSLOT_EXPANDO = 0,
   JSPROXYSLOT_XRAY_EXPANDO
 };
 
 template<typename T> struct Prefable;
 
-class DOMProxyHandler : public DOMBaseProxyHandler
+class DOMProxyHandler : public js::BaseProxyHandler
 {
 public:
   DOMProxyHandler(const DOMClass& aClass)
-    : DOMBaseProxyHandler(true),
+    : js::BaseProxyHandler(ProxyFamily()),
       mClass(aClass)
   {
   }
 
   bool getPropertyDescriptor(JSContext* cx, JSObject* proxy, jsid id, bool set,
                              JSPropertyDescriptor* desc);
   bool defineProperty(JSContext* cx, JSObject* proxy, jsid id,
                       JSPropertyDescriptor* desc);
--- a/dom/interfaces/base/nsIDOMClientRectList.idl
+++ b/dom/interfaces/base/nsIDOMClientRectList.idl
@@ -1,14 +1,13 @@
 /* -*- 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, uuid(917da19d-62f5-441d-b47e-9e35f05639c9)]
+[scriptable, uuid(f474c567-cbcb-458f-abad-ae42363da287)]
 interface nsIDOMClientRectList : nsISupports
 {
   readonly attribute unsigned long length;
-  [getter,forward(getItemAt)] nsIDOMClientRect        item(in unsigned long index);
-  [noscript,notxpcom,nostdcall] nsIDOMClientRect getItemAt(in unsigned long index);
+  nsIDOMClientRect        item(in unsigned long index);
 };
--- a/dom/interfaces/core/nsIDOMDOMTokenList.idl
+++ b/dom/interfaces/core/nsIDOMDOMTokenList.idl
@@ -12,16 +12,16 @@
  * For more information on this interface please see
  * <http://www.whatwg.org/html5/#domtokenlist>
  */
 [scriptable, uuid(c6f1e160-eeeb-404a-98b0-6f1246520b6e)]
 interface nsIDOMDOMTokenList : nsISupports
 {
   readonly attribute unsigned long length;
 
-  [getter,binaryname(MozItem)] DOMString item(in unsigned long index);
+  [binaryname(MozItem)] DOMString item(in unsigned long index);
   boolean            contains([Null(Stringify)] in DOMString token);
   void               add([Null(Stringify)] in DOMString token);
   void               remove([Null(Stringify)] in DOMString token);
   boolean            toggle([Null(Stringify)] in DOMString token);
 
-  [stringifier] DOMString          toString();
+  DOMString          toString();
 };
--- a/dom/interfaces/core/nsIDOMNodeList.idl
+++ b/dom/interfaces/core/nsIDOMNodeList.idl
@@ -1,30 +1,23 @@
 /* -*- 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 nsIContent;
-
 /**
  * The nsIDOMNodeList interface provides the abstraction of an ordered 
  * collection of nodes, without defining or constraining how this collection 
  * is implemented.
  * The items in the list are accessible via an integral index, starting from 0.
  *
  * For more information on this interface please see 
  * http://www.w3.org/TR/DOM-Level-2-Core/
  */
 
-[scriptable, uuid(496852ba-e48d-4fa5-982e-e0dc1b475bf1)]
+[scriptable, uuid(450cf0ba-de90-4f86-85bf-e10cc8b8713f)]
 interface nsIDOMNodeList : nsISupports
 {
-  [getter,forward(getNodeAt)] nsIDOMNode    item(in unsigned long index);
+  nsIDOMNode    item(in unsigned long index);
   readonly attribute unsigned long          length;
-
-  /**
-   * Get the node at the index.  Returns null if the index is out of bounds
-   */
-  [noscript,notxpcom,nostdcall] nsIContent  getNodeAt(in unsigned long index);
 };
--- a/dom/interfaces/events/nsIDOMPaintRequestList.idl
+++ b/dom/interfaces/events/nsIDOMPaintRequestList.idl
@@ -2,15 +2,14 @@
 /* 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 nsIDOMPaintRequest;
 
-[scriptable, uuid(01627136-fdd8-44b4-aac0-7d613608a3d4)]
+[scriptable, uuid(1d6a6e10-e9f0-468b-b8e5-da39c945690e)]
 interface nsIDOMPaintRequestList : nsISupports
 {
   readonly attribute unsigned long length;
-  [getter,forward(getItemAt)] nsIDOMPaintRequest        item(in unsigned long index);
-  [noscript,notxpcom,nostdcall] nsIDOMPaintRequest getItemAt(in unsigned long index);
+  nsIDOMPaintRequest        item(in unsigned long index);
 };
--- a/dom/interfaces/html/nsIDOMHTMLCollection.idl
+++ b/dom/interfaces/html/nsIDOMHTMLCollection.idl
@@ -1,39 +1,26 @@
 /* -*- 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 nsGenericElement;
-
 /**
  * The nsIDOMHTMLCollection interface is an interface to a collection
  * of [X]HTML elements.
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(db690d8f-3bca-4198-be64-78adb7f38bf8)]
+[scriptable, uuid(bb07f567-5b37-4172-92aa-7d00ceed4809)]
 interface nsIDOMHTMLCollection : nsISupports
 {
   readonly attribute unsigned long    length;
 
-  [getter,forward(getElementAt)] nsIDOMNode item(in unsigned long index);
-  [getter,forward(getNamedItem)] nsIDOMNode namedItem(in DOMString name);
-
-  /**
-   * Get the node at the index.  Returns null if the index is out of bounds.
-   */
-  [noscript,notxpcom,nostdcall] nsGenericElement getElementAt(in unsigned long index);
-
-  /**
-   * Get the node for the name.  Returns null if no node exists for the name.
-   */
-  [noscript,notxpcom,nostdcall] nsISupports getNamedItem(in DOMString name,
-                                                         out nsWrapperCachePtr cache);
+  nsIDOMNode item(in unsigned long index);
+  nsIDOMNode namedItem(in DOMString name);
 };
--- a/dom/interfaces/html/nsIDOMHTMLOptionsCollection.idl
+++ b/dom/interfaces/html/nsIDOMHTMLOptionsCollection.idl
@@ -16,39 +16,33 @@ interface nsIDOMHTMLSelectElement;
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 // Introduced in DOM Level 2:
-[scriptable, uuid(429b041b-06df-486c-9a3a-a1d901cc76a2)]
+[scriptable, uuid(4173cc53-30f6-4d12-a770-981ba53164e2)]
 interface nsIDOMHTMLOptionsCollection : nsISupports
 {
            attribute unsigned long   length;
                                         // raises(DOMException) on setting
 
   // FIXME item should just be inherited from nsIDOMHTMLCollection
   nsIDOMNode         item(in unsigned long index);
 
   // FIXME namedItem (and getNamedItem) should return a NodeList if there are
   //       multiple matching items
-  [getter,forward(getNamedItem)] nsIDOMNode namedItem(in DOMString name);
-
-  /**
-   * Get the node for the name.  Returns null if no node exists for the name.
-   */
-  [noscript,notxpcom,nostdcall] nsISupports getNamedItem(in DOMString name,
-                                                         out nsWrapperCachePtr cache);
+  nsIDOMNode namedItem(in DOMString name);
 
            attribute long             selectedIndex;
 
-  [setter,noscript] void    setOption(in unsigned long index,
-                                      in nsIDOMHTMLOptionElement option);
+  [noscript] void    setOption(in unsigned long index,
+                               in nsIDOMHTMLOptionElement option);
 
   [noscript] readonly attribute nsIDOMHTMLSelectElement select;
 
   // This add method implementation means the following
   // since IDL doesn't support overloading.
   //   void add(in nsIDOMHTMLOptionElement,
   //            [optional] in nsIDOMHTMLOptionElement)
   //   void add(in nsIDOMHTMLOptionElement, in long)
--- a/dom/interfaces/html/nsIDOMHTMLPropertiesCollection.idl
+++ b/dom/interfaces/html/nsIDOMHTMLPropertiesCollection.idl
@@ -1,34 +1,20 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=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 "nsIDOMHTMLElement.idl"
 #include "nsIDOMPropertyNodeList.idl"
 #include "nsIDOMDOMStringList.idl"
 
-interface nsGenericElement;
-
 // This interface should extend nsIDOMHTMLCollection, which will be fixed when
 // it is converted to webidl.
-[scriptable, uuid(b7e84688-98e0-46b2-9d20-8a0e7329dd25)]
+[scriptable, uuid(b3a368e4-61a4-4578-94ce-57f98b0e79e8)]
 interface nsIDOMHTMLPropertiesCollection : nsISupports
 {
   readonly attribute unsigned long    length;
   readonly attribute nsIDOMDOMStringList names;
 
-  [getter,forward(getElementAt)] nsIDOMNode                item(in unsigned long index);
+  nsIDOMNode                item(in unsigned long index);
   nsIDOMPropertyNodeList namedItem(in DOMString name);
-
-  /**
-   * Get the node at the index.  Returns null if the index is out of bounds.
-   */
-  [noscript,notxpcom,nostdcall] nsGenericElement getElementAt(in unsigned long index);
-
-  /**
-   * Get the node for the name.  Returns null if no node exists for the name.
-   */
-  [noscript,notxpcom,nostdcall] nsISupports getNamedItem(in DOMString name,
-                                                         out nsWrapperCachePtr cache);
 };
--- a/dom/interfaces/html/nsIDOMPropertyNodeList.idl
+++ b/dom/interfaces/html/nsIDOMPropertyNodeList.idl
@@ -2,22 +2,15 @@
 /* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=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 "nsIVariant.idl"
 
 interface nsIDOMNode;
-interface nsIContent;
 
-[scriptable, uuid(255cc828-49e8-4fb0-8e36-875e6e072da3)]
+[scriptable, uuid(22c9c591-182d-4504-8a95-d3274a8b147a)]
 interface nsIDOMPropertyNodeList : nsISupports {
-  [getter,forward(getNodeAt)] nsIDOMNode    item(in unsigned long index);
+  nsIDOMNode    item(in unsigned long index);
   readonly attribute unsigned long          length;
-
-  /**
-   * Get the node at the index.  Returns null if the index is out of bounds
-   */
-  [noscript,notxpcom,nostdcall] nsIContent  getNodeAt(in unsigned long index);
-
   nsIVariant getValues();
 };
--- a/dom/interfaces/svg/nsIDOMSVGLengthList.idl
+++ b/dom/interfaces/svg/nsIDOMSVGLengthList.idl
@@ -2,29 +2,28 @@
 /* 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 nsIDOMSVGLength;
 
-[scriptable, uuid(f8c89734-d6b4-4a56-bdf5-1ce1104dc1ab)]
+[scriptable, uuid(ff34ad88-3465-4559-853d-7fdd5bf5e5e9)]
 interface nsIDOMSVGLengthList : nsISupports
 { 
   readonly attribute unsigned long numberOfItems;
   readonly attribute unsigned long length;  // synonym for numberOfItems
 
   void clear();
           // raises(nsIDOMDOMException);
   nsIDOMSVGLength initialize(in nsIDOMSVGLength newItem );
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
   nsIDOMSVGLength getItem(in unsigned long index);
                     // raises(nsIDOMDOMException);
-  [getter,noscript,notxpcom,nostdcall] nsIDOMSVGLength getItemAt(in unsigned long index);
   nsIDOMSVGLength insertItemBefore(in nsIDOMSVGLength newItem, in unsigned long index);
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
   nsIDOMSVGLength replaceItem(in nsIDOMSVGLength newItem, in unsigned long index);
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
   nsIDOMSVGLength removeItem(in unsigned long index);
                     // raises(nsIDOMDOMException);
   nsIDOMSVGLength appendItem(in nsIDOMSVGLength newItem);
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
--- a/dom/interfaces/svg/nsIDOMSVGNumberList.idl
+++ b/dom/interfaces/svg/nsIDOMSVGNumberList.idl
@@ -2,29 +2,28 @@
 /* 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 nsIDOMSVGNumber;
 
-[scriptable, uuid(8e303812-38b4-4780-9f8c-9ddbfcb26c81)]
+[scriptable, uuid(35d7c850-b2c7-41e4-be59-08f6b29aa78f)]
 interface nsIDOMSVGNumberList : nsISupports
 { 
   readonly attribute unsigned long numberOfItems;
   readonly attribute unsigned long length;  // synonym for numberOfItems
 
   void clear();
           // raises(nsIDOMDOMException);
   nsIDOMSVGNumber initialize(in nsIDOMSVGNumber newItem );
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
   nsIDOMSVGNumber getItem(in unsigned long index);
                     // raises(nsIDOMDOMException);
-  [getter,noscript,notxpcom,nostdcall] nsIDOMSVGNumber getItemAt(in unsigned long index);
   nsIDOMSVGNumber insertItemBefore(in nsIDOMSVGNumber newItem, in unsigned long index);
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
   nsIDOMSVGNumber replaceItem(in nsIDOMSVGNumber newItem, in unsigned long index);
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
   nsIDOMSVGNumber removeItem(in unsigned long index);
                     // raises(nsIDOMDOMException);
   nsIDOMSVGNumber appendItem(in nsIDOMSVGNumber newItem);
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
--- a/dom/interfaces/svg/nsIDOMSVGPathSegList.idl
+++ b/dom/interfaces/svg/nsIDOMSVGPathSegList.idl
@@ -2,29 +2,28 @@
 /* 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 nsIDOMSVGPathSeg;
 
-[scriptable, uuid(1e4efb5c-7b0f-4338-a92e-6ca5402b303c)]
+[scriptable, uuid(24bc0498-ebfd-4966-a1c7-524e939308c9)]
 interface nsIDOMSVGPathSegList : nsISupports
 { 
   readonly attribute unsigned long numberOfItems;
   readonly attribute unsigned long length;  // synonym for numberOfItems
 
   void clear();
           // raises(nsIDOMDOMException);
   nsIDOMSVGPathSeg initialize(in nsIDOMSVGPathSeg newItem );
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
   nsIDOMSVGPathSeg getItem(in unsigned long index);
                     // raises(nsIDOMDOMException);
-  [getter,noscript,notxpcom,nostdcall] nsIDOMSVGPathSeg getItemAt(in unsigned long index);
   nsIDOMSVGPathSeg insertItemBefore(in nsIDOMSVGPathSeg newItem, in unsigned long index);
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
   nsIDOMSVGPathSeg replaceItem(in nsIDOMSVGPathSeg newItem, in unsigned long index);
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
   nsIDOMSVGPathSeg removeItem(in unsigned long index);
                     // raises(nsIDOMDOMException);
   nsIDOMSVGPathSeg appendItem(in nsIDOMSVGPathSeg newItem);
                     // raises(nsIDOMDOMException, nsIDOMSVGException);
--- a/dom/interfaces/svg/nsIDOMSVGPointList.idl
+++ b/dom/interfaces/svg/nsIDOMSVGPointList.idl
@@ -2,29 +2,28 @@
 /* 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 nsIDOMSVGPoint;
 
-[scriptable, uuid(7bb28750-7238-4083-b5f4-4def4646a637)]
+[scriptable, uuid(1cc66e7d-c874-4429-9f73-a0e5f2c77a85)]
 interface nsIDOMSVGPointList : nsISupports
 {
   readonly attribute unsigned long numberOfItems;
   readonly attribute unsigned long length;  // synonym for numberOfItems
 
   void clear();
       // raises( DOMException );
   nsIDOMSVGPoint initialize(in nsIDOMSVGPoint newItem);
       // raises( DOMException, SVGException );
   nsIDOMSVGPoint getItem (in unsigned long index);
       // raises( DOMException );
-  [getter,noscript,notxpcom,nostdcall] nsIDOMSVGPoint getItemAt(in unsigned long index);
   nsIDOMSVGPoint insertItemBefore(in nsIDOMSVGPoint newItem, in unsigned long index);
       // raises( DOMException, SVGException );
   nsIDOMSVGPoint replaceItem(in nsIDOMSVGPoint newItem, in unsigned long index);
       // raises( DOMException, SVGException );
   nsIDOMSVGPoint removeItem(in unsigned long index);
       // raises( DOMException );
   nsIDOMSVGPoint appendItem(in nsIDOMSVGPoint newItem);
       //  raises( DOMException, SVGException );
--- a/dom/interfaces/svg/nsIDOMSVGTransformList.idl
+++ b/dom/interfaces/svg/nsIDOMSVGTransformList.idl
@@ -3,29 +3,28 @@
  * 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 nsIDOMSVGTransform;
 interface nsIDOMSVGMatrix;
 
-[scriptable, uuid(6302eb5d-25d5-4df6-ab8b-e57e37c1a48d)]
+[scriptable, uuid(e6ea8113-ccd8-4084-a15f-07ca7db1d3fe)]
 interface nsIDOMSVGTransformList : nsISupports
 { 
   readonly attribute unsigned long numberOfItems;
   readonly attribute unsigned long length; // synonym for numberOfItems
 
   void clear();
       // raises( DOMException );
   nsIDOMSVGTransform initialize(in nsIDOMSVGTransform newItem);
       // raises( DOMException, SVGException );
   nsIDOMSVGTransform getItem(in unsigned long index);
       // raises( DOMException );
-  [getter,noscript,notxpcom,nostdcall] nsIDOMSVGTransform getItemAt(in unsigned long index);
   nsIDOMSVGTransform insertItemBefore(in nsIDOMSVGTransform newItem,
                                       in unsigned long index);
       //  raises( DOMException, SVGException );
   nsIDOMSVGTransform replaceItem(in nsIDOMSVGTransform newItem,
                                  in unsigned long index);
       // raises( DOMException, SVGException );
   nsIDOMSVGTransform removeItem(in unsigned long index);
       //  raises( DOMException );
--- a/editor/libeditor/text/nsPlaintextEditor.cpp
+++ b/editor/libeditor/text/nsPlaintextEditor.cpp
@@ -255,27 +255,29 @@ nsPlaintextEditor::SetDocumentCharacterS
 }
 
 bool
 nsPlaintextEditor::UpdateMetaCharset(nsIDOMDocument* aDocument,
                                      const nsACString& aCharacterSet)
 {
   MOZ_ASSERT(aDocument);
   // get a list of META tags
-  nsCOMPtr<nsIDOMNodeList> metaList;
+  nsCOMPtr<nsIDOMNodeList> list;
   nsresult rv = aDocument->GetElementsByTagName(NS_LITERAL_STRING("meta"),
-                                                getter_AddRefs(metaList));
+                                                getter_AddRefs(list));
   NS_ENSURE_SUCCESS(rv, false);
-  NS_ENSURE_TRUE(metaList, false);
+  NS_ENSURE_TRUE(list, false);
+
+  nsCOMPtr<nsINodeList> metaList = do_QueryInterface(list);
 
   uint32_t listLength = 0;
   metaList->GetLength(&listLength);
 
   for (uint32_t i = 0; i < listLength; ++i) {
-    nsCOMPtr<nsIContent> metaNode = metaList->GetNodeAt(i);
+    nsCOMPtr<nsIContent> metaNode = metaList->Item(i);
     MOZ_ASSERT(metaNode);
 
     if (!metaNode->IsElement()) {
       continue;
     }
 
     nsAutoString currentValue;
     metaNode->GetAttr(kNameSpaceID_None, nsGkAtoms::httpEquiv, currentValue);
--- a/js/xpconnect/src/Makefile.in
+++ b/js/xpconnect/src/Makefile.in
@@ -15,18 +15,16 @@ MODULE		= xpconnect
 LIBRARY_NAME    = xpconnect_s
 FORCE_STATIC_LIB = 1
 LIBXUL_LIBRARY = 1
 EXPORTS = \
 		qsObjectHelper.h \
 		xpcObjectHelper.h \
 		xpcpublic.h \
 		XPCJSMemoryReporter.h \
-		dombindings.h \
-		dombindings_gen.h \
 		GeneratedEvents.h
 
 CPPSRCS		= \
 		nsScriptError.cpp \
 		nsXPConnect.cpp \
 		XPCCallContext.cpp \
 		XPCComponents.cpp \
 		XPCContext.cpp \
@@ -51,17 +49,16 @@ CPPSRCS		= \
 		XPCWrappedNativeInfo.cpp \
 		XPCWrappedNativeJSOps.cpp \
 		XPCWrappedNativeProto.cpp \
 		XPCWrappedNativeScope.cpp \
 		XPCJSWeakReference.cpp \
 		XPCWrapper.cpp \
 		XPCQuickStubs.cpp \
 		dom_quickstubs.cpp \
-		dombindings.cpp \
 		DictionaryHelpers.cpp \
 		GeneratedEvents.cpp \
 		$(NULL)
 
 include $(topsrcdir)/config/config.mk
 
 LOCAL_INCLUDES = \
 		-I$(srcdir)/../wrappers \
@@ -78,17 +75,17 @@ LOCAL_INCLUDES = \
 		-I$(topsrcdir)/xpcom/ds \
 		$(NULL)
 
 SHARED_LIBRARY_LIBS = \
   ../loader/$(LIB_PREFIX)jsloader_s.$(LIB_SUFFIX) \
   ../wrappers/$(LIB_PREFIX)xpcwrappers_s.$(LIB_SUFFIX) \
   $(NULL)
 
-EXTRA_MDDEPEND_FILES = dom_qsgen.pp dombindingsgen.pp dictionary_helper_gen.pp event_impl_gen.pp
+EXTRA_MDDEPEND_FILES = dom_qsgen.pp dictionary_helper_gen.pp event_impl_gen.pp
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += \
   -DJSFILE \
   -DJS_THREADSAFE \
   -DEXPORT_XPC_API \
   $(NULL)
@@ -114,56 +111,23 @@ dom_quickstubs.cpp: $(srcdir)/dom_quicks
 	  $(srcdir)/qsgen.py \
 	  --idlpath=$(DEPTH)/dist/idl \
 	  --header-output dom_quickstubs.h \
 	  --stub-output dom_quickstubs.cpp \
 	  --makedepend-output $(MDDEPDIR)/dom_qsgen.pp \
 	  $(ENABLE_TRACEABLE_FLAGS) \
 	  $(srcdir)/dom_quickstubs.qsconf
 
-dombindings.$(OBJ_SUFFIX): dombindings_gen.h \
-                           dombindings_gen.cpp
-
-dombindings_gen.h: $(srcdir)/dombindings.conf \
-                   $(srcdir)/dombindingsgen.py \
-                   $(srcdir)/codegen.py \
-                   $(LIBXUL_DIST)/sdk/bin/header.py \
-                   $(LIBXUL_DIST)/sdk/bin/xpidl.py \
-                   $(DEPTH)/js/src/js-confdefs.h
-	$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-	  $(PLY_INCLUDE) \
-	  -I$(LIBXUL_DIST)/sdk/bin \
-	  $(srcdir)/dombindingsgen.py \
-	  --idlpath=$(DEPTH)/dist/idl \
-	  --header-output dombindings_gen.h \
-	  $(srcdir)/dombindings.conf
-
-dombindings_gen.cpp: $(srcdir)/dombindings.conf \
-                     $(srcdir)/dombindingsgen.py \
-                     $(srcdir)/codegen.py \
-                     $(LIBXUL_DIST)/sdk/bin/header.py \
-                     $(LIBXUL_DIST)/sdk/bin/xpidl.py \
-                     $(DEPTH)/js/src/js-confdefs.h
-	$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-	  $(PLY_INCLUDE) \
-	  -I$(LIBXUL_DIST)/sdk/bin \
-	  $(srcdir)/dombindingsgen.py \
-	  --idlpath=$(DEPTH)/dist/idl \
-	  --stub-output dombindings_gen.cpp \
-	  --makedepend-output $(MDDEPDIR)/dombindingsgen.pp \
-	  $(srcdir)/dombindings.conf
-
 DictionaryHelpers.$(OBJ_SUFFIX): DictionaryHelpers.cpp
 
 DictionaryHelpers.h: DictionaryHelpers.cpp
 
 DictionaryHelpers.cpp: $(srcdir)/dictionary_helper_gen.conf \
                        event_impl_gen.conf \
                        $(srcdir)/dictionary_helper_gen.py \
-                       $(srcdir)/codegen.py \
                        $(LIBXUL_DIST)/sdk/bin/header.py \
                        $(LIBXUL_DIST)/sdk/bin/xpidl.py \
                        $(DEPTH)/js/src/js-confdefs.h
 	$(PYTHON) $(topsrcdir)/config/pythonpath.py \
 	  $(PLY_INCLUDE) \
 	  -I$(LIBXUL_DIST)/sdk/bin \
 	  $(srcdir)/dictionary_helper_gen.py \
 	  -I $(DEPTH)/dist/idl \
@@ -178,34 +142,32 @@ GeneratedEvents.$(OBJ_SUFFIX): Generated
 
 event_impl_gen.conf : $(srcdir)/event_impl_gen.conf.in
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $^ > event_impl_gen.conf
 
 GeneratedEvents.h: $(srcdir)/dictionary_helper_gen.conf \
                    event_impl_gen.conf \
                    $(srcdir)/dictionary_helper_gen.py \
                    $(srcdir)/event_impl_gen.py \
-                   $(srcdir)/codegen.py \
                    $(LIBXUL_DIST)/sdk/bin/header.py \
                    $(LIBXUL_DIST)/sdk/bin/xpidl.py \
                    $(DEPTH)/js/src/js-confdefs.h
 	$(PYTHON) $(topsrcdir)/config/pythonpath.py \
 	  $(PLY_INCLUDE) \
 	  -I$(LIBXUL_DIST)/sdk/bin \
 	  $(srcdir)/event_impl_gen.py \
 	  -I $(DEPTH)/dist/idl \
 	  --header-output GeneratedEvents.h \
 	  event_impl_gen.conf
 
 GeneratedEvents.cpp: DictionaryHelpers.h \
                      $(srcdir)/dictionary_helper_gen.conf \
                      event_impl_gen.conf \
                      $(srcdir)/dictionary_helper_gen.py \
                      $(srcdir)/event_impl_gen.py \
-                     $(srcdir)/codegen.py \
                      $(LIBXUL_DIST)/sdk/bin/header.py \
                      $(LIBXUL_DIST)/sdk/bin/xpidl.py \
                      $(DEPTH)/js/src/js-confdefs.h
 	$(PYTHON) $(topsrcdir)/config/pythonpath.py \
 	  $(PLY_INCLUDE) \
 	  -I$(LIBXUL_DIST)/sdk/bin \
 	  $(srcdir)/event_impl_gen.py \
 	  -I $(DEPTH)/dist/idl \
@@ -219,18 +181,16 @@ GeneratedEvents.cpp: DictionaryHelpers.h
   $(NULL)
 
 libs:: $(_EXTRA_EXPORT_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/dist/include
 
 GARBAGE += \
 		dom_quickstubs.h \
 		dom_quickstubs.cpp \
-		dombindings_gen.h \
-		dombindings_gen.cpp \
 		DictionaryHelpers.h \
 		DictionaryHelpers.cpp \
 		GeneratedEvents.h \
 		GeneratedEvents.cpp \
 		event_impl_gen.conf \
 		xpidl_debug \
 		$(MDDEPDIR)/dom_qsgen.pp \
 		$(MDDEPDIR)/dombindingsgen.pp \
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -13,17 +13,16 @@
 #include "nsString.h"
 #include "nsIAtom.h"
 #include "XPCWrapper.h"
 #include "nsJSPrincipals.h"
 #include "nsWrapperCache.h"
 #include "AccessCheck.h"
 #include "nsJSUtils.h"
 
-#include "dombindings.h"
 #include "nsWrapperCacheInlines.h"
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/PrimitiveConversions.h"
 
--- a/js/xpconnect/src/XPCJSID.cpp
+++ b/js/xpconnect/src/XPCJSID.cpp
@@ -477,24 +477,17 @@ nsJSIID::HasInstance(nsIXPConnectWrapped
             iid->ToProvidedString(foo);
             SLIM_LOG_WILL_MORPH_FOR_PROP(cx, obj, foo);
 #endif
             if (!MorphSlimWrapper(cx, obj))
                 return NS_ERROR_FAILURE;
         }
 
         nsISupports *identity;
-        if (mozilla::dom::oldproxybindings::instanceIsProxy(obj)) {
-            identity =
-                static_cast<nsISupports*>(js::GetProxyPrivate(obj).toPrivate());
-        } else if (!mozilla::dom::UnwrapDOMObjectToISupports(obj, identity)) {
-            identity = nullptr;
-        }
-
-        if (identity) {
+        if (mozilla::dom::UnwrapDOMObjectToISupports(obj, identity)) {
             nsCOMPtr<nsIClassInfo> ci = do_QueryInterface(identity);
 
             XPCCallContext ccx(JS_CALLER, cx);
 
             AutoMarkingNativeSetPtr set(ccx);
             set = XPCNativeSet::GetNewOrUsed(ccx, ci);
             if (!set)
                 return NS_ERROR_FAILURE;
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -412,26 +412,20 @@ XPCJSRuntime::SuspectWrappedNative(XPCWr
         cb.NoteJSRoot(obj);
 }
 
 static PLDHashOperator
 SuspectDOMExpandos(nsPtrHashKey<JSObject> *key, void *arg)
 {
     Closure *closure = static_cast<Closure*>(arg);
     JSObject* obj = key->GetKey();
-    nsISupports* native = nullptr;
-    if (dom::oldproxybindings::instanceIsProxy(obj)) {
-        native = static_cast<nsISupports*>(js::GetProxyPrivate(obj).toPrivate());
-    }
-    else {
-        const dom::DOMClass* clasp;
-        dom::DOMObjectSlot slot = GetDOMClass(obj, clasp);
-        MOZ_ASSERT(slot != dom::eNonDOMObject && clasp->mDOMObjectIsISupports);
-        native = dom::UnwrapDOMObject<nsISupports>(obj, slot);
-    }
+    const dom::DOMClass* clasp;
+    dom::DOMObjectSlot slot = GetDOMClass(obj, clasp);
+    MOZ_ASSERT(slot != dom::eNonDOMObject && clasp->mDOMObjectIsISupports);
+    nsISupports* native = dom::UnwrapDOMObject<nsISupports>(obj, slot);
     closure->cb->NoteXPCOMRoot(native);
     return PL_DHASH_NEXT;
 }
 
 void
 XPCJSRuntime::AddXPConnectRoots(nsCycleCollectionTraversalCallback &cb)
 {
     // For all JS objects that are held by native objects but aren't held
@@ -2390,43 +2384,37 @@ XPCJSRuntime::newXPCJSRuntime(nsXPConnec
 
 // InternStaticDictionaryJSVals is automatically generated.
 bool InternStaticDictionaryJSVals(JSContext* aCx);
 
 JSBool
 XPCJSRuntime::OnJSContextNew(JSContext *cx)
 {
     // if it is our first context then we need to generate our string ids
-    JSBool ok = true;
     if (JSID_IS_VOID(mStrIDs[0])) {
         JS_SetGCParameterForThread(cx, JSGC_MAX_CODE_CACHE_BYTES, 16 * 1024 * 1024);
         {
             // Scope the JSAutoRequest so it goes out of scope before calling
             // mozilla::dom::binding::DefineStaticJSVals.
             JSAutoRequest ar(cx);
             for (unsigned i = 0; i < IDX_TOTAL_COUNT; i++) {
                 JSString* str = JS_InternString(cx, mStrings[i]);
                 if (!str || !JS_ValueToId(cx, STRING_TO_JSVAL(str), &mStrIDs[i])) {
                     mStrIDs[0] = JSID_VOID;
-                    ok = false;
-                    break;
+                    return false;
                 }
                 mStrJSVals[i] = STRING_TO_JSVAL(str);
             }
         }
 
-        ok = mozilla::dom::DefineStaticJSVals(cx) &&
-             mozilla::dom::oldproxybindings::DefineStaticJSVals(cx);
-        if (!ok)
+        if (!mozilla::dom::DefineStaticJSVals(cx) ||
+            !InternStaticDictionaryJSVals(cx)) {
             return false;
-
-        ok = InternStaticDictionaryJSVals(cx);
+        }
     }
-    if (!ok)
-        return false;
 
     XPCContext* xpc = new XPCContext(this, cx);
     if (!xpc)
         return false;
 
     // we want to mark the global object ourselves since we use a different color
     JS_ToggleOptions(cx, JSOPTION_UNROOTED_GLOBAL);
 
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -13,17 +13,16 @@
 #include "nsWrapperCacheInlines.h"
 #include "XPCLog.h"
 #include "nsINode.h"
 #include "XPCQuickStubs.h"
 #include "jsproxy.h"
 #include "AccessCheck.h"
 #include "WrapperFactory.h"
 #include "XrayWrapper.h"
-#include "dombindings.h"
 
 #include "nsContentUtils.h"
 
 #include "mozilla/StandardInteger.h"
 #include "mozilla/Util.h"
 #include "mozilla/Likely.h"
 
 using namespace xpc;
deleted file mode 100644
--- a/js/xpconnect/src/codegen.py
+++ /dev/null
@@ -1,642 +0,0 @@
-#!/usr/bin/env/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/.
-
-import xpidl
-import header
-import sys
-import os
-import string
-
-# === Utils
-
-def warn(msg):
-    sys.stderr.write(msg + '\n')
-
-def makeQuote(filename):
-    return filename.replace(' ', '\\ ')  # enjoy!
-
-# === Types
-
-def isVoidType(type):
-    """ Return True if the given xpidl type is void. """
-    return type.kind == 'builtin' and type.name == 'void'
-
-def isStringType(t):
-    t = xpidl.unaliasType(t)
-    return t.kind == 'native' and (t.specialtype == 'astring' or t.specialtype == 'domstring');
-
-def isInterfaceType(t):
-    t = xpidl.unaliasType(t)
-    assert t.kind in ('builtin', 'native', 'interface', 'forward')
-    return t.kind in ('interface', 'forward')
-
-def isSpecificInterfaceType(t, name):
-    """ True if `t` is an interface type with the given name, or a forward
-    declaration or typedef aliasing it.
-
-    `name` must not be the name of a typedef but the actual name of the
-    interface.
-    """
-    t = xpidl.unaliasType(t)
-    return t.kind in ('interface', 'forward') and t.name == name
-
-def isVariantType(t):
-    return isSpecificInterfaceType(t, 'nsIVariant')
-
-# === Reading the file
-
-class UserError(Exception):
-    pass
-
-def findIDL(includePath, irregularFilenames, interfaceName):
-    filename = irregularFilenames.get(interfaceName, interfaceName) + '.idl'
-    for d in includePath:
-        # Not os.path.join: we need a forward slash even on Windows because
-        # this filename ends up in makedepend output.
-        path = d + '/' + filename
-        if os.path.exists(path):
-            return path
-    raise UserError("No IDL file found for interface %s "
-                    "in include path %r"
-                    % (interfaceName, includePath))
-
-# === Generating code
-
-argumentUnboxingTemplates = {
-    'octet':
-        "    uint32_t ${name}_u32;\n"
-        "    if (!JS_ValueToECMAUint32(cx, ${argVal}, &${name}_u32))\n"
-        "        return JS_FALSE;\n"
-        "    uint8_t ${name} = uint8_t(${name}_u32);\n",
-
-    'short':
-        "    int32_t ${name}_i32;\n"
-        "    if (!JS_ValueToECMAInt32(cx, ${argVal}, &${name}_i32))\n"
-        "        return JS_FALSE;\n"
-        "    int16_t ${name} = int16_t(${name}_i32);\n",
-
-    'unsigned short':
-        "    uint32_t ${name}_u32;\n"
-        "    if (!JS_ValueToECMAUint32(cx, ${argVal}, &${name}_u32))\n"
-        "        return JS_FALSE;\n"
-        "    uint16_t ${name} = uint16_t(${name}_u32);\n",
-
-    'long':
-        "    int32_t ${name};\n"
-        "    if (!JS_ValueToECMAInt32(cx, ${argVal}, &${name}))\n"
-        "        return JS_FALSE;\n",
-
-    'unsigned long':
-        "    uint32_t ${name};\n"
-        "    if (!JS_ValueToECMAUint32(cx, ${argVal}, &${name}))\n"
-        "        return JS_FALSE;\n",
-
-    'long long':
-        "    int64_t ${name};\n"
-        "    if (!JS::ToInt64(cx, ${argVal}, &${name}))\n"
-        "        return JS_FALSE;\n",
-
-    'unsigned long long':
-        "    uint64_t ${name};\n"
-        "    if (!JS::ToUint64(cx, ${argVal}, &${name}))\n"
-        "        return JS_FALSE;\n",
-
-    'float':
-        "    double ${name}_dbl;\n"
-        "    if (!JS_ValueToNumber(cx, ${argVal}, &${name}_dbl))\n"
-        "        return JS_FALSE;\n"
-        "    float ${name} = (float) ${name}_dbl;\n",
-
-    'double':
-        "    double ${name};\n"
-        "    if (!JS_ValueToNumber(cx, ${argVal}, &${name}))\n"
-        "        return JS_FALSE;\n",
-
-    'boolean':
-        "    bool ${name};\n"
-        "    JS_ValueToBoolean(cx, ${argVal}, &${name});\n",
-
-    '[astring]':
-        "    xpc_qsAString ${name}(cx, ${argVal}, ${argPtr});\n"
-        "    if (!${name}.IsValid())\n"
-        "        return JS_FALSE;\n",
-
-    '[domstring]':
-        "    xpc_qsDOMString ${name}(cx, ${argVal}, ${argPtr}, "
-        "xpc_qsDOMString::e${nullBehavior}, "
-        "xpc_qsDOMString::e${undefinedBehavior});\n"
-        "    if (!${name}.IsValid())\n"
-        "        return JS_FALSE;\n",
-
-    'string':
-        "    JSAutoByteString ${name}_bytes;\n"
-        "    if (!xpc_qsJsvalToCharStr(cx, ${argVal}, &${name}_bytes))\n"
-        "        return JS_FALSE;\n"
-        "    char *${name} = ${name}_bytes.ptr();\n",
-
-    'wstring':
-        "    const PRUnichar *${name};\n"
-        "    if (!xpc_qsJsvalToWcharStr(cx, ${argVal}, ${argPtr}, &${name}))\n"
-        "        return JS_FALSE;\n",
-
-    '[cstring]':
-        "    xpc_qsACString ${name}(cx, ${argVal}, ${argPtr});\n"
-        "    if (!${name}.IsValid())\n"
-        "        return JS_FALSE;\n",
-
-    '[utf8string]':
-        "    xpc_qsAUTF8String ${name}(cx, ${argVal}, ${argPtr});\n"
-        "    if (!${name}.IsValid())\n"
-        "        return JS_FALSE;\n",
-
-    '[jsval]':
-        "    jsval ${name} = ${argVal};\n"
-    }
-
-# From JSData2Native.
-#
-# Omitted optional arguments are treated as though the caller had passed JS
-# `null`; this behavior is from XPCWrappedNative::CallMethod. The 'jsval' type,
-# however, defaults to 'undefined'.
-#
-def writeArgumentUnboxing(f, i, name, type, optional, rvdeclared,
-                          nullBehavior, undefinedBehavior):
-    # f - file to write to
-    # i - int or None - Indicates the source jsval.  If i is an int, the source
-    #     jsval is argv[i]; otherwise it is *vp.  But if Python i >= C++ argc,
-    #     which can only happen if optional is True, the argument is missing;
-    #     use JSVAL_NULL as the source jsval instead.
-    # name - str - name of the native C++ variable to create.
-    # type - xpidl.{Interface,Native,Builtin} - IDL type of argument
-    # optional - bool - True if the parameter is optional.
-    # rvdeclared - bool - False if no |nsresult rv| has been declared earlier.
-
-    typeName = xpidl.getBuiltinOrNativeTypeName(type)
-
-    isSetter = (i is None)
-
-    if isSetter:
-        argPtr = "vp"
-        argVal = "*vp"
-    elif optional:
-        if typeName == "[jsval]":
-            val = "JSVAL_VOID"
-        else:
-            val = "JSVAL_NULL"
-        argVal = "(%d < argc ? argv[%d] : %s)" % (i, i, val)
-        argPtr = "(%d < argc ? &argv[%d] : NULL)" % (i, i)
-    else:
-        argVal = "argv[%d]" % i
-        argPtr = "&" + argVal
-
-    params = {
-        'name': name,
-        'argVal': argVal,
-        'argPtr': argPtr,
-        'nullBehavior': nullBehavior or 'DefaultNullBehavior',
-        'undefinedBehavior': undefinedBehavior or 'DefaultUndefinedBehavior'
-        }
-
-    if typeName is not None:
-        template = argumentUnboxingTemplates.get(typeName)
-        if template is not None:
-            f.write(string.Template(template).substitute(params))
-            return rvdeclared
-        # else fall through; the type isn't supported yet.
-    elif isInterfaceType(type):
-        if type.name == 'nsIVariant':
-            # Totally custom.
-            template = (
-                "    nsCOMPtr<nsIVariant> ${name}(already_AddRefed<nsIVariant>("
-                "XPCVariant::newVariant(cx, ${argVal})));\n"
-                "    if (!${name}) {\n"
-                "        xpc_qsThrowBadArg(cx, NS_ERROR_INVALID_ARG, vp, %d);\n"
-                "        return JS_FALSE;\n"
-                "    }\n") % i
-            f.write(string.Template(template).substitute(params))
-            return rvdeclared
-        elif type.name == 'nsIAtom':
-            # Should have special atomizing behavior.  Fall through.
-            pass
-        else:
-            if not rvdeclared:
-                f.write("    nsresult rv;\n");
-            f.write("    %s *%s;\n" % (type.name, name))
-            f.write("    xpc_qsSelfRef %sref;\n" % name)
-            f.write("    rv = xpc_qsUnwrapArg<%s>("
-                    "cx, %s, &%s, &%sref.ptr, %s);\n"
-                    % (type.name, argVal, name, name, argPtr))
-            f.write("    if (NS_FAILED(rv)) {\n")
-            if isSetter:
-                f.write("        xpc_qsThrowBadSetterValue("
-                        "cx, rv, JSVAL_TO_OBJECT(*tvr.jsval_addr()), id);\n")
-            else:
-                f.write("        xpc_qsThrowBadArgWithDetails(cx, rv, %d, %s, %s);\n" % (i, "\"\"", "\"\""))
-            f.write("        return JS_FALSE;\n"
-                    "    }\n")
-            return True
-
-    warn("Unable to unbox argument of type %s (native type %s)" % (type.name, typeName))
-    if i is None:
-        src = '*vp'
-    else:
-        src = 'argv[%d]' % i
-    f.write("    !; // TODO - Unbox argument %s = %s\n" % (name, src))
-    return rvdeclared
-
-def writeResultDecl(f, member, varname):
-    type = member.realtype
-
-    if isVoidType(type):
-        return  # nothing to declare
-
-    t = xpidl.unaliasType(type)
-    if t.kind == 'builtin':
-        if not t.nativename.endswith('*'):
-            if type.kind == 'typedef':
-                typeName = type.name  # use it
-            else:
-                typeName = t.nativename
-            f.write("    %s %s;\n" % (typeName, varname))
-            return
-    elif t.kind == 'native':
-        name = xpidl.getBuiltinOrNativeTypeName(t)
-        if name in ('[domstring]', '[astring]'):
-            f.write("    nsString %s;\n" % varname)
-            return
-        elif name == '[jsval]':
-            return  # nothing to declare; see special case in outParamForm
-    elif t.kind in ('interface', 'forward'):
-        if member.kind == 'method' and member.notxpcom:
-            f.write("    %s *%s;\n" % (type.name, varname))
-        else:
-            f.write("    nsCOMPtr<%s> %s;\n" % (type.name, varname))
-        return
-
-    warn("Unable to declare result of type %s" % type.name)
-    f.write("    !; // TODO - Declare out parameter `%s`.\n" % varname)
-
-def outParamForm(name, type):
-    type = xpidl.unaliasType(type)
-    # If we start allowing [jsval] return types here, we need to tack
-    # the return value onto the arguments list in the callers,
-    # possibly, and handle properly returning it too.  See bug 604198.
-    assert type.kind != 'native' or type.specialtype != 'jsval'
-    if type.kind == 'builtin':
-        return '&' + name
-    elif type.kind == 'native':
-        if type.specialtype == 'jsval':
-            return 'vp'
-        elif type.modifier == 'ref':
-            if isStringType(type):
-                return '(nsAString&)' + name
-            return name
-        else:
-            return '&' + name
-    else:
-        return 'getter_AddRefs(%s)' % name
-
-# From NativeData2JS.
-resultConvTemplates = {
-    'void':
-            "    ${jsvalRef} = JSVAL_VOID;\n"
-            "    return JS_TRUE;\n",
-
-    'octet':
-        "    ${jsvalRef} = INT_TO_JSVAL(int32_t(result));\n"
-        "    return JS_TRUE;\n",
-
-    'short':
-        "    ${jsvalRef} = INT_TO_JSVAL(int32_t(result));\n"
-        "    return JS_TRUE;\n",
-
-    'long':
-        "    ${jsvalRef} = INT_TO_JSVAL(result);\n"
-        "    return JS_TRUE;\n",
-
-    'long long':
-        "    return xpc_qsInt64ToJsval(cx, result, ${jsvalPtr};\n",
-
-    'unsigned short':
-        "    ${jsvalRef} = INT_TO_JSVAL(int32_t(result));\n"
-        "    return JS_TRUE;\n",
-
-    'unsigned long':
-        "    ${jsvalRef} = UINT_TO_JSVAL(result);\n"
-        "    return JS_TRUE;\n",
-
-    'unsigned long long':
-        "    return xpc_qsUint64ToJsval(cx, result, ${jsvalPtr});\n",
-
-    'float':
-        "    ${jsvalRef} = JS_NumberValue(result);\n"
-        "    return JS_TRUE;\n",
-
-    'double':
-        "    ${jsvalRef} = JS_NumberValue(result);\n"
-        "    return JS_TRUE;\n",
-
-    'boolean':
-        "    ${jsvalRef} = (result ? JSVAL_TRUE : JSVAL_FALSE);\n"
-        "    return JS_TRUE;\n",
-
-    '[astring]':
-        "    return xpc::StringToJsval(cx, result, ${jsvalPtr});\n",
-
-    '[domstring]':
-        "    return xpc::StringToJsval(cx, result, ${jsvalPtr});\n",
-
-    '[jsval]':
-        # Here there's nothing to convert, because the result has already been
-        # written directly to *rv. See the special case in outParamForm.
-        "    return JS_TRUE;\n"
-    }
-
-def writeResultConv(f, type, interfaceResultTemplate, jsvalPtr, jsvalRef):
-    """ Emit code to convert the C++ variable `result` to a jsval.
-
-    The emitted code contains a return statement; it returns JS_TRUE on
-    success, JS_FALSE on error.
-    """
-    # From NativeData2JS.
-    typeName = xpidl.getBuiltinOrNativeTypeName(type)
-    if typeName is not None:
-        template = resultConvTemplates.get(typeName)
-    elif isInterfaceType(type):
-        if isVariantType(type):
-            template =  ("    XPCLazyCallContext lccx(JS_CALLER, cx, obj);\n"
-                         "    return xpc_qsVariantToJsval(lccx, result, ${jsvalPtr});\n")
-        else:
-            template = ("    if (!result) {\n"
-                        "      *${jsvalPtr} = JSVAL_NULL;\n"
-                        "      return JS_TRUE;\n"
-                        "    }\n")
-            template += interfaceResultTemplate
-
-    if template is not None:
-        values = {'jsvalRef': jsvalRef,
-                  'jsvalPtr': jsvalPtr,
-                  'typeName': type.name}
-        f.write(string.Template(template).substitute(values))
-        return
-    # else fall through; this type isn't supported yet
-
-    warn("Unable to convert result of type %s" % type.name)
-    f.write("    !; // TODO - Convert `result` to jsval, store in `%s`.\n"
-            % jsvalRef)
-    f.write("    return xpc_qsThrow(cx, NS_ERROR_UNEXPECTED); // FIXME\n")
-
-def validateParam(member, param):
-    def pfail(msg):
-        raise UserError(
-            member.iface.name + '.' + member.name + ": "
-            "parameter " + param.name + ": " + msg)
-
-    if param.iid_is is not None:
-        pfail("iid_is parameters are not supported.")
-    if param.size_is is not None:
-        pfail("size_is parameters are not supported.")
-    if param.retval:
-        pfail("Unexpected retval parameter!")
-    if param.paramtype in ('out', 'inout'):
-        pfail("inout parameters are not supported.")
-    if param.const or param.array or param.shared:
-        pfail("I am a simple caveman.")
-
-# returns the number of arguments that a method takes in JS (including optional arguments)
-def argumentsLength(member):
-    assert member.kind == 'method'
-
-    inArgs = len(member.params)
-    if inArgs and member.notxpcom and member.params[inArgs - 1].paramtype == 'out':
-        if member.params[inArgs - 1].realtype.kind != 'native' or member.params[inArgs - 1].realtype.nativename != 'nsWrapperCache':
-            pfail("We only support a wrapper cache as out argument")
-        inArgs -= 1
-    return inArgs
-
-def writeStub(f, customMethodCalls, member, stubName, writeThisUnwrapping, writeCheckForFailure, writeResultWrapping, isSetter=False):
-    """ Write a single quick stub (a custom SpiderMonkey getter/setter/method)
-    for the specified XPCOM interface-member. 
-    """
-    if member.kind == 'method' and member.forward:
-        member = member.iface.namemap[member.forward]
-
-    isAttr = (member.kind == 'attribute')
-    isMethod = (member.kind == 'method')
-    assert isAttr or isMethod
-    isNotxpcom = isMethod and member.notxpcom
-    isGetter = isAttr and not isSetter
-
-    signature = "static JSBool\n"
-    if isAttr:
-        # JSPropertyOp signature.
-        if isSetter:
-            signature += "%s(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,%s JSMutableHandleValue vp_)\n"
-        else:
-            signature += "%s(JSContext *cx, JSHandleObject obj, JSHandleId id,%s JSMutableHandleValue vp_)\n"
-    else:
-        # JSFastNative.
-        signature += "%s(JSContext *cx, unsigned argc,%s jsval *vp)\n"
-
-    customMethodCall = customMethodCalls.get(stubName, None)
-
-    if customMethodCall is None:
-        customMethodCall = customMethodCalls.get(member.iface.name + '_', None)
-        if customMethodCall is not None:
-            if isMethod:
-                code = customMethodCall.get('code', None)
-            elif isGetter:
-                code = customMethodCall.get('getter_code', None)
-            else:
-                code = customMethodCall.get('setter_code', None)
-        else:
-            code = None
-
-        if code is not None:
-            templateName = member.iface.name
-            if isGetter:
-                templateName += '_Get'
-            elif isSetter:
-                templateName += '_Set'
-
-            # Generate the code for the stub, calling the template function
-            # that's shared between the stubs. The stubs can't have additional
-            # arguments, only the template function can.
-            callTemplate = signature % (stubName, '')
-            callTemplate += "{\n"
-
-            argumentValues = (customMethodCall['additionalArgumentValues']
-                              % header.methodNativeName(member))
-            if isAttr:
-                callTemplate += ("    return %s(cx, obj, id%s, %s, vp_);\n"
-                                 % (templateName, ", strict" if isSetter else "", argumentValues))
-            else:
-                callTemplate += ("    return %s(cx, argc, %s, vp);\n"
-                                 % (templateName, argumentValues))
-            callTemplate += "}\n\n"
-
-            # Fall through and create the template function stub called from the
-            # real stubs, but only generate the stub once. Otherwise, just write
-            # out the call to the template function and return.
-            templateGenerated = templateName + '_generated'
-            if templateGenerated in customMethodCall:
-                f.write(callTemplate)
-                return
-            customMethodCall[templateGenerated] = True
-
-            stubName = templateName
-        else:
-            callTemplate = ""
-    else:
-        callTemplate = ""
-        code = customMethodCall.get('code', None)
-
-    # Function prolog.
-
-    # Only template functions can have additional arguments.
-    if customMethodCall is None or not 'additionalArguments' in customMethodCall:
-        additionalArguments = ''
-    else:
-        additionalArguments = " %s," % customMethodCall['additionalArguments']
-    f.write(signature % (stubName, additionalArguments))
-    f.write("{\n")
-    f.write("    XPC_QS_ASSERT_CONTEXT_OK(cx);\n")
-
-    # Convert JSMutableHandleValue to jsval*
-    if isAttr:
-        f.write("    jsval *vp = vp_.address();\n")
-
-    # For methods, compute "this".
-    if isMethod:
-        f.write("    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n"
-                "    if (!obj)\n"
-                "        return JS_FALSE;\n")
-
-    selfname = writeThisUnwrapping(f, member, isMethod, isGetter, customMethodCall)
-
-    rvdeclared = False
-    if isMethod:
-        inArgs = argumentsLength(member)
-        # If there are any required arguments, check argc.
-        requiredArgs = inArgs
-        while requiredArgs and member.params[requiredArgs-1].optional:
-            requiredArgs -= 1
-        if requiredArgs:
-            f.write("    if (argc < %d)\n" % requiredArgs)
-            f.write("        return xpc_qsThrow(cx, "
-                    "NS_ERROR_XPC_NOT_ENOUGH_ARGS);\n")
-
-        # Convert in-parameters.
-        if inArgs > 0:
-            f.write("    jsval *argv = JS_ARGV(cx, vp);\n")
-        for i in range(inArgs):
-            param = member.params[i]
-            argName = 'arg%d' % i
-            argTypeKey = argName + 'Type'
-            if customMethodCall is None or not argTypeKey in customMethodCall:
-                validateParam(member, param)
-                realtype = param.realtype
-            else:
-                realtype = xpidl.Forward(name=customMethodCall[argTypeKey],
-                                         location='', doccomments='')
-            # Emit code to convert this argument from jsval.
-            rvdeclared = writeArgumentUnboxing(
-                f, i, argName, realtype,
-                optional=param.optional,
-                rvdeclared=rvdeclared,
-                nullBehavior=param.null,
-                undefinedBehavior=param.undefined)
-        if inArgs < len(member.params):
-            f.write("    nsWrapperCache *cache;\n")
-    elif isSetter:
-        rvdeclared = writeArgumentUnboxing(f, None, 'arg0', member.realtype,
-                                           optional=False,
-                                           rvdeclared=rvdeclared,
-                                           nullBehavior=member.null,
-                                           undefinedBehavior=member.undefined)
-
-    canFail = not isNotxpcom and (customMethodCall is None or customMethodCall.get('canFail', True))
-    if canFail and not rvdeclared:
-        f.write("    nsresult rv;\n")
-        rvdeclared = True
-
-    if code is not None:
-        f.write("%s\n" % code)
-
-    if code is None or (isGetter and callTemplate is ""):
-        debugGetter = code is not None
-        if debugGetter:
-            f.write("#ifdef DEBUG\n")
-            f.write("    nsresult debug_rv;\n")
-            f.write("    nsCOMPtr<%s> debug_self;\n"
-                    "    CallQueryInterface(self, getter_AddRefs(debug_self));\n"
-                    % member.iface.name);
-            prefix = 'debug_'
-        else:
-            prefix = ''
-
-        resultname = prefix + 'result'
-        selfname = prefix + selfname
-        nsresultname = prefix + 'rv'
-
-        # Prepare out-parameter.
-        if isMethod or isGetter:
-            writeResultDecl(f, member, resultname)
-
-        # Call the method.
-        if isMethod:
-            comName = header.methodNativeName(member)
-            argv = ['arg' + str(i) for i in range(inArgs)]
-            if inArgs < len(member.params):
-                argv.append(outParamForm('cache', member.params[inArgs].realtype))
-            if member.implicit_jscontext:
-                argv.append('cx')
-            if member.optional_argc:
-                argv.append('argc - %d' % requiredArgs)
-            if not isNotxpcom and not isVoidType(member.realtype):
-                argv.append(outParamForm(resultname, member.realtype))
-            args = ', '.join(argv)
-        else:
-            comName = header.attributeNativeName(member, isGetter)
-            if isGetter:
-                args = outParamForm(resultname, member.realtype)
-            else:
-                args = "arg0"
-            if member.implicit_jscontext:
-                args = "cx, " + args
-
-        f.write("    ")
-        if canFail or debugGetter:
-            f.write("%s = " % nsresultname)
-        elif isNotxpcom:
-            f.write("%s = " % resultname)
-        f.write("%s->%s(%s);\n" % (selfname, comName, args))
-
-        if debugGetter:
-            checkSuccess = "NS_SUCCEEDED(debug_rv)"
-            if canFail:
-                checkSuccess += " == NS_SUCCEEDED(rv)"
-            f.write("    NS_ASSERTION(%s && "
-                    "xpc_qsSameResult(debug_result, result),\n"
-                    "                 \"Got the wrong answer from the custom "
-                    "method call!\");\n" % checkSuccess)
-            f.write("#endif\n")
-
-    if canFail:
-        # Check for errors.
-        writeCheckForFailure(f, isMethod, isGetter)
-
-    # Convert the return value.
-    if isMethod or isGetter:
-        writeResultWrapping(f, member, 'vp', '*vp')
-    else:
-        f.write("    return JS_TRUE;\n")
-
-    # Epilog.
-    f.write("}\n\n")
-
-    # Now write out the call to the template function.
-    if customMethodCall is not None:
-        f.write(callTemplate)
--- a/js/xpconnect/src/dictionary_helper_gen.py
+++ b/js/xpconnect/src/dictionary_helper_gen.py
@@ -1,16 +1,15 @@
 #!/usr/bin/env python
 # header.py - Generate C++ header files from IDL.
 #
 # 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/.
 
-from codegen import *
 import sys, os.path, re, xpidl, itertools
 
 # --makedepend-output support.
 make_dependencies = []
 make_targets = []
 
 def strip_begin(text, suffix):
     if not text.startswith(suffix):
@@ -18,16 +17,19 @@ def strip_begin(text, suffix):
     return text[len(suffix):]
 
 def strip_end(text, suffix):
     if not text.endswith(suffix):
         return text
     return text[:-len(suffix)]
 
 # Copied from dombindingsgen.py
+def makeQuote(filename):
+    return filename.replace(' ', '\\ ')  # enjoy!
+
 def writeMakeDependOutput(filename):
     print "Creating makedepend file", filename
     f = open(filename, 'w')
     try:
         if len(make_targets) > 0:
             f.write("%s:" % makeQuote(make_targets[0]))
             for filename in make_dependencies:
                 f.write(' \\\n\t\t%s' % makeQuote(filename))
deleted file mode 100644
--- a/js/xpconnect/src/dombindings.conf
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- Mode: python; -*-c
-# 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./
-
-list_classes = [
-    {
-        'name': 'NodeList',
-        'nativeClass': 'nsINodeList'
-    },
-    {
-        'name': 'PropertyNodeList',
-        'nativeClass': 'mozilla::dom::PropertyNodeList',
-        'newBindingHeader': 'mozilla/dom/HTMLPropertiesCollectionBinding.h'
-    },
-    {
-        'name': 'HTMLCollection',
-        'nativeClass': 'nsIHTMLCollection'
-    },
-    {
-        'name': 'HTMLOptionsCollection',
-        'nativeClass': 'nsHTMLOptionCollection'
-    },
-    {
-        'name': 'HTMLPropertiesCollection',
-        'nativeClass': 'mozilla::dom::HTMLPropertiesCollection'
-    },
-    {
-        'name': 'DOMTokenList',
-        'nativeClass': 'nsDOMTokenList'
-    },
-    {
-        'name': 'DOMSettableTokenList',
-        'nativeClass': 'nsDOMSettableTokenList'
-    },
-    {
-        'name': 'ClientRectList',
-        'nativeClass': 'nsClientRectList'
-    },
-    {
-        'name': 'PaintRequestList',
-        'nativeClass': 'nsPaintRequestList'
-    },
-    {
-        'name': 'FileList',
-        'nativeClass': 'nsDOMFileList'
-    },
-    {
-        'name': 'SVGLengthList',
-        'nativeClass': 'mozilla::DOMSVGLengthList'
-    },
-    {
-        'name': 'SVGNumberList',
-        'nativeClass': 'mozilla::DOMSVGNumberList'
-    },
-    {
-        'name': 'SVGPathSegList',
-        'nativeClass': 'mozilla::DOMSVGPathSegList'
-    },
-    {
-        'name': 'SVGPointList',
-        'nativeClass': 'mozilla::DOMSVGPointList'
-    },
-    {
-        'name': 'SVGTransformList',
-        'nativeClass': 'mozilla::DOMSVGTransformList'
-    }
-]
-
-prefableClasses = {
-    }
-
-irregularFilenames = {
-    'nsHTMLOptionCollection': 'nsHTMLSelectElement',
-    'mozilla::dom::PropertyNodeList': 'HTMLPropertiesCollection',
-    'nsClientRectList': 'nsClientRect',
-    'nsPaintRequestList': 'nsPaintRequest',
-    'nsDOMFileList': 'nsDOMFile',
-    }
-
-customInheritance = {
-    'nsIDOMPropertyNodeList': 'nsIDOMNodeList',
-    'nsIDOMHTMLOptionsCollection': 'nsIDOMHTMLCollection',
-    'nsIDOMHTMLPropertiesCollection': 'nsIDOMHTMLCollection',
-    }
deleted file mode 100644
--- a/js/xpconnect/src/dombindings.cpp
+++ /dev/null
@@ -1,1032 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=4 sw=4 et tw=99 ft=cpp:
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/Util.h"
-
-#include "dombindings.h"
-#include "xpcpublic.h"
-#include "xpcprivate.h"
-#include "XPCQuickStubs.h"
-#include "XPCWrapper.h"
-#include "WrapperFactory.h"
-#include "nsDOMClassInfo.h"
-#include "nsGlobalWindow.h"
-#include "nsWrapperCacheInlines.h"
-#include "mozilla/dom/BindingUtils.h"
-
-#include "jsapi.h"
-
-using namespace JS;
-using namespace mozilla::dom;
-
-namespace mozilla {
-namespace dom {
-namespace oldproxybindings {
-
-enum {
-    JSPROXYSLOT_EXPANDO = 0,
-    JSPROXYSLOT_XRAY_EXPANDO
-};
-
-static jsid s_prototype_id = JSID_VOID;
-
-static jsid s_length_id = JSID_VOID;
-
-static jsid s_iterator_id = JSID_VOID;
-
-bool
-DefineStaticJSVal(JSContext *cx, jsid &id, const char *string)
-{
-    if (JSString *str = ::JS_InternString(cx, string)) {
-        id = INTERNED_STRING_TO_JSID(cx, str);
-        return true;
-    }
-    return false;
-}
-
-#define SET_JSID_TO_STRING(_cx, _string)                                      \
-    DefineStaticJSVal(_cx, s_##_string##_id, #_string)
-
-bool
-DefineStaticJSVals(JSContext *cx)
-{
-    JSAutoRequest ar(cx);
-
-    return SET_JSID_TO_STRING(cx, prototype) &&
-           SET_JSID_TO_STRING(cx, length) &&
-           SET_JSID_TO_STRING(cx, iterator) &&
-           DefinePropertyStaticJSVals(cx);
-}
-
-
-JSBool
-Throw(JSContext *cx, nsresult rv)
-{
-    XPCThrower::Throw(rv, cx);
-    return false;
-}
-
-template<class T>
-static bool
-Wrap(JSContext *cx, JSObject *scope, T *p, nsWrapperCache *cache, jsval *vp)
-{
-    if (xpc_FastGetCachedWrapper(cache, scope, vp))
-        return true;
-    qsObjectHelper helper(p, cache);
-    return XPCOMObjectToJsval(cx, scope, helper, NULL, true, vp);
-}
-
-template<class T>
-static inline bool
-Wrap(JSContext *cx, JSObject *scope, T *p, jsval *vp)
-{
-    return Wrap(cx, scope, p, GetWrapperCache(p), vp);
-}
-
-template<>
-inline bool
-Wrap(JSContext *cx, JSObject *scope, NoType *p, jsval *vp)
-{
-    NS_RUNTIMEABORT("We try to wrap the result from calling a noop?");
-    return false;
-}
-
-template<class T>
-inline bool
-Wrap(JSContext *cx, JSObject *scope, nsCOMPtr<T> &p, jsval *vp)
-{
-    return Wrap(cx, scope, p.get(), vp);
-}
-
-static inline bool
-Wrap(JSContext *cx, JSObject *scope, nsISupportsResult &result, jsval *vp)
-{
-    return Wrap(cx, scope, result.mResult, result.mCache, vp);
-}
-
-static inline bool
-Wrap(JSContext *cx, JSObject *scope, nsString &result, jsval *vp)
-{
-    return xpc::StringToJsval(cx, result, vp);
-}
-
-template<class T>
-bool
-Unwrap(JSContext *cx, jsval v, T **ppArg, nsISupports **ppArgRef, jsval *vp)
-{
-    nsresult rv = xpc_qsUnwrapArg(cx, v, ppArg, ppArgRef, vp);
-    if (NS_FAILED(rv))
-        return Throw(cx, rv);
-    return true;
-}
-
-template<>
-bool
-Unwrap(JSContext *cx, jsval v, NoType **ppArg, nsISupports **ppArgRef, jsval *vp)
-{
-    NS_RUNTIMEABORT("We try to unwrap an argument for a noop?");
-    return false;
-}
-
-template<class LC>
-typename ListBase<LC>::Properties ListBase<LC>::sProtoProperties[] = {
-    { JSID_VOID, NULL, NULL }
-};
-template<class LC>
-size_t ListBase<LC>::sProtoPropertiesCount = 0;
-
-template<class LC>
-typename ListBase<LC>::Methods ListBase<LC>::sProtoMethods[] = {
-    { JSID_VOID, NULL, 0 }
-};
-template<class LC>
-size_t ListBase<LC>::sProtoMethodsCount = 0;
-
-template<class LC>
-ListBase<LC> ListBase<LC>::instance;
-
-template<class LC>
-typename ListBase<LC>::ListType*
-ListBase<LC>::getNative(JSObject *obj)
-{
-    return static_cast<ListType*>(js::GetProxyPrivate(obj).toPrivate());
-}
-
-template<class LC>
-typename ListBase<LC>::ListType*
-ListBase<LC>::getListObject(JSObject *obj)
-{
-    if (xpc::WrapperFactory::IsXrayWrapper(obj))
-        obj = js::UnwrapObject(obj);
-    MOZ_ASSERT(objIsList(obj));
-    return getNative(obj);
-}
-
-static JSBool
-UnwrapSecurityWrapper(JSContext *cx, JSObject *obj, JSObject *callee, JSObject **unwrapped)
-{
-    MOZ_ASSERT(XPCWrapper::IsSecurityWrapper(obj));
-
-    if (callee && JS_GetGlobalForObject(cx, obj) == JS_GetGlobalForObject(cx, callee)) {
-        *unwrapped = js::UnwrapObject(obj);
-    } else {
-        *unwrapped = XPCWrapper::Unwrap(cx, obj);
-        if (!*unwrapped)
-            return Throw(cx, NS_ERROR_XPC_SECURITY_MANAGER_VETO);
-    }
-    return true;
-}
-
-template<class LC>
-bool
-ListBase<LC>::instanceIsListObject(JSContext *cx, JSObject *obj, JSObject *callee)
-{
-    if (XPCWrapper::IsSecurityWrapper(obj) && !UnwrapSecurityWrapper(cx, obj, callee, &obj))
-        return false;
-
-    if (!objIsList(obj)) {
-        // FIXME: Throw a proper DOM exception.
-        JS_ReportError(cx, "type error: wrong object");
-        return false;
-    }
-    return true;
-}
-
-template<class LC>
-JSBool
-ListBase<LC>::length_getter(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp)
-{
-    if (!instanceIsListObject(cx, obj, NULL))
-        return false;
-    uint32_t length;
-    getListObject(obj)->GetLength(&length);
-    MOZ_ASSERT(int32_t(length) >= 0);
-    vp.set(UINT_TO_JSVAL(length));
-    return true;
-}
-
-template<class LC>
-bool
-ListBase<LC>::getItemAt(ListType *list, uint32_t i, IndexGetterType &item)
-{
-    JS_STATIC_ASSERT(!hasIndexGetter);
-    return false;
-}
-
-template<class LC>
-bool
-ListBase<LC>::setItemAt(JSContext *cx, ListType *list, uint32_t i, IndexSetterType item)
-{
-    JS_STATIC_ASSERT(!hasIndexSetter);
-    return false;
-}
-
-template<class LC>
-bool
-ListBase<LC>::getNamedItem(ListType *list, const nsAString& aName, NameGetterType &item)
-{
-    JS_STATIC_ASSERT(!hasNameGetter);
-    return false;
-}
-
-template<class LC>
-bool
-ListBase<LC>::setNamedItem(JSContext *cx, ListType *list, const nsAString& aName,
-                           NameSetterType item)
-{
-    JS_STATIC_ASSERT(!hasNameSetter);
-    return false;
-}
-
-template<class LC>
-bool
-ListBase<LC>::namedItem(JSContext *cx, JSObject *obj, jsval *name, NameGetterType &result,
-                        bool *hasResult)
-{
-    xpc_qsDOMString nameString(cx, *name, name,
-                               xpc_qsDOMString::eDefaultNullBehavior,
-                               xpc_qsDOMString::eDefaultUndefinedBehavior);
-    if (!nameString.IsValid())
-        return false;
-    *hasResult = getNamedItem(getListObject(obj), nameString, result);
-    return true;
-}
-
-JSBool
-interface_hasInstance(JSContext *cx, JSHandleObject obj, JSMutableHandleValue vp, JSBool *bp)
-{
-    if (vp.isObject()) {
-        jsval prototype;
-        if (!JS_GetPropertyById(cx, obj, s_prototype_id, &prototype) ||
-            JSVAL_IS_PRIMITIVE(prototype)) {
-            JS_ReportErrorFlagsAndNumber(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL,
-                                         JSMSG_THROW_TYPE_ERROR);
-            return false;
-        }
-
-        JSObject *other = &vp.toObject();
-        if (instanceIsProxy(other)) {
-            ProxyHandler *handler = static_cast<ProxyHandler*>(js::GetProxyHandler(other));
-            if (handler->isInstanceOf(JSVAL_TO_OBJECT(prototype))) {
-                *bp = true;
-            } else {
-                JSObject *protoObj = JSVAL_TO_OBJECT(prototype);
-                JSObject *proto = other;
-                for (;;) {
-                    if (!JS_GetPrototype(cx, proto, &proto))
-                        return false;
-                    if (!proto)
-                        break;
-                    if (proto == protoObj) {
-                        *bp = true;
-                        return true;
-                    }
-                }
-                *bp = false;
-            }
-
-            return true;
-        }
-    }
-
-    *bp = false;
-    return true;
-}
-
-js::Class sInterfacePrototypeClass = {
-    "Object",
-    JSCLASS_HAS_RESERVED_SLOTS(0),
-    JS_PropertyStub,         /* addProperty */
-    JS_PropertyStub,         /* delProperty */
-    JS_PropertyStub,         /* getProperty */
-    JS_StrictPropertyStub,   /* setProperty */
-    JS_EnumerateStub,
-    JS_ResolveStub,
-    JS_ConvertStub
-};
-
-template<class LC>
-JSObject *
-ListBase<LC>::getPrototype(JSContext *cx, JSObject *receiver)
-{
-    XPCWrappedNativeScope *scope =
-        XPCWrappedNativeScope::FindInJSObjectScope(cx, receiver);
-    if (!scope)
-        return NULL;
-
-    return getPrototype(cx, scope, receiver);
-}
-
-template<class LC>
-JSObject *
-ListBase<LC>::getPrototype(JSContext *cx, XPCWrappedNativeScope *scope,
-                           JSObject *receiver)
-{
-    nsDataHashtable<nsDepCharHashKey, JSObject*> &cache =
-        scope->GetCachedDOMPrototypes();
-
-    JSObject *interfacePrototype;
-    if (cache.IsInitialized()) {
-        if (cache.Get(sInterfaceClass.name, &interfacePrototype)) {
-            xpc_UnmarkGrayObject(interfacePrototype);
-            return interfacePrototype;
-        }
-    } else {
-        cache.Init();
-    }
-
-    JSObject* proto = Base::getPrototype(cx, scope, receiver);
-    if (!proto)
-        return NULL;
-
-    JSObject *global = scope->GetGlobalJSObject();
-    interfacePrototype = JS_NewObject(cx, Jsvalify(&sInterfacePrototypeClass), proto, global);
-    if (!interfacePrototype)
-        return NULL;
-
-    for (size_t n = 0; n < sProtoPropertiesCount; ++n) {
-        MOZ_ASSERT(sProtoProperties[n].getter);
-        jsid id = sProtoProperties[n].id;
-        unsigned attrs = JSPROP_ENUMERATE | JSPROP_SHARED;
-        if (!sProtoProperties[n].setter)
-            attrs |= JSPROP_READONLY;
-        if (!JS_DefinePropertyById(cx, interfacePrototype, id, JSVAL_VOID,
-                                   sProtoProperties[n].getter, sProtoProperties[n].setter, attrs))
-            return NULL;
-    }
-
-    for (size_t n = 0; n < sProtoMethodsCount; ++n) {
-        jsid id = sProtoMethods[n].id;
-        JSFunction *fun = JS_NewFunctionById(cx, sProtoMethods[n].native, sProtoMethods[n].nargs,
-                                             0, js::GetObjectParent(interfacePrototype), id);
-        if (!fun)
-            return NULL;
-        JSObject *funobj = JS_GetFunctionObject(fun);
-        if (!JS_DefinePropertyById(cx, interfacePrototype, id, OBJECT_TO_JSVAL(funobj),
-                                   NULL, NULL, JSPROP_ENUMERATE))
-            return NULL;
-    }
-
-    JSObject *interface = JS_NewObject(cx, Jsvalify(&sInterfaceClass), NULL, global);
-    if (!interface)
-        return NULL;
-
-    if (!JS_LinkConstructorAndPrototype(cx, interface, interfacePrototype))
-        return NULL;
-
-    if (!JS_DefineProperty(cx, receiver, sInterfaceClass.name, OBJECT_TO_JSVAL(interface), NULL,
-                           NULL, 0))
-        return NULL;
-
-    if (!cache.Put(sInterfaceClass.name, interfacePrototype, fallible_t()))
-        return NULL;
-
-    return interfacePrototype;
-}
-
-template<class LC>
-JSObject *
-ListBase<LC>::create(JSContext *cx, JSObject *scope, ListType *aList,
-                     nsWrapperCache* aWrapperCache)
-{
-    JSObject *parent = WrapNativeParent(cx, scope, aList->GetParentObject());
-    if (!parent)
-        return NULL;
-
-    JSObject *global = js::GetGlobalForObjectCrossCompartment(parent);
-    JSAutoCompartment ac(cx, global);
-
-    JSObject *proto = getPrototype(cx, global);
-    if (!proto)
-        return NULL;
-    JSObject *obj = NewProxyObject(cx, &ListBase<LC>::instance,
-                                   PrivateValue(aList), proto, parent);
-    if (!obj)
-        return NULL;
-
-    NS_ADDREF(aList);
-
-    aWrapperCache->SetWrapper(obj);
-
-    return obj;
-}
-
-static JSObject *
-getExpandoObject(JSObject *obj)
-{
-    NS_ASSERTION(instanceIsProxy(obj), "expected a DOM proxy object");
-    Value v = js::GetProxyExtra(obj, JSPROXYSLOT_EXPANDO);
-    return v.isUndefined() ? NULL : v.toObjectOrNull();
-}
-
-static int32_t
-IdToInt32(JSContext *cx, jsid id)
-{
-    JSAutoRequest ar(cx);
-
-    jsval idval;
-    double array_index;
-    int32_t i;
-    if (!::JS_IdToValue(cx, id, &idval) ||
-        !::JS_ValueToNumber(cx, idval, &array_index) ||
-        !::JS_DoubleIsInt32(array_index, &i)) {
-        return -1;
-    }
-
-    return i;
-}
-
-static inline int32_t
-GetArrayIndexFromId(JSContext *cx, jsid id)
-{
-    if (NS_LIKELY(JSID_IS_INT(id)))
-        return JSID_TO_INT(id);
-    if (NS_LIKELY(id == s_length_id))
-        return -1;
-    if (NS_LIKELY(JSID_IS_ATOM(id))) {
-        JSAtom *atom = JSID_TO_ATOM(id);
-        jschar s = *js::GetAtomChars(atom);
-        if (NS_LIKELY((unsigned)s >= 'a' && (unsigned)s <= 'z'))
-            return -1;
-
-        uint32_t i;
-        JSLinearString *str = js::AtomToLinearString(JSID_TO_ATOM(id));
-        return js::StringIsArrayIndex(str, &i) ? i : -1;
-    }
-    return IdToInt32(cx, id);
-}
-
-static void
-FillPropertyDescriptor(JSPropertyDescriptor *desc, JSObject *obj, jsval v, bool readonly)
-{
-    desc->obj = obj;
-    desc->value = v;
-    desc->attrs = (readonly ? JSPROP_READONLY : 0) | JSPROP_ENUMERATE;
-    desc->getter = NULL;
-    desc->setter = NULL;
-    desc->shortid = 0;
-}
-
-template<class LC>
-bool
-ListBase<LC>::getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set,
-                                       JSPropertyDescriptor *desc)
-{
-    if (set) {
-        if (hasIndexSetter) {
-            int32_t index = GetArrayIndexFromId(cx, id);
-            if (index >= 0) {
-                FillPropertyDescriptor(desc, proxy, JSVAL_VOID, false);
-                return true;
-            }
-        }
-
-        if (hasNameSetter && JSID_IS_STRING(id)) {
-            FillPropertyDescriptor(desc, proxy, JSVAL_VOID, false);
-            return true;
-        }
-    } else {
-        if (hasIndexGetter) {
-            int32_t index = GetArrayIndexFromId(cx, id);
-            if (index >= 0) {
-                IndexGetterType result;
-                if (!getItemAt(getListObject(proxy), uint32_t(index), result))
-                    return true;
-
-                jsval v;
-                if (!Wrap(cx, proxy, result, &v))
-                    return false;
-                FillPropertyDescriptor(desc, proxy, v, !hasIndexSetter);
-                return true;
-            }
-        }
-    }
-
-    JSObject *expando;
-    if (!xpc::WrapperFactory::IsXrayWrapper(proxy) && (expando = getExpandoObject(proxy))) {
-        unsigned flags = (set ? JSRESOLVE_ASSIGNING : 0) | JSRESOLVE_QUALIFIED;
-        if (!JS_GetPropertyDescriptorById(cx, expando, id, flags, desc))
-            return false;
-        if (desc->obj) {
-            // Pretend the property lives on the wrapper.
-            desc->obj = proxy;
-            return true;
-        }
-    }
-
-    if (hasNameGetter && !set && JSID_IS_STRING(id) && !hasPropertyOnPrototype(cx, proxy, id)) {
-        jsval name = STRING_TO_JSVAL(JSID_TO_STRING(id));
-        bool hasResult;
-        NameGetterType result;
-        if (!namedItem(cx, proxy, &name, result, &hasResult))
-            return false;
-        if (hasResult) {
-            jsval v;
-            if (!Wrap(cx, proxy, result, &v))
-                return false;
-            FillPropertyDescriptor(desc, proxy, v, !hasNameSetter);
-            return true;
-        }
-    }
-
-    desc->obj = NULL;
-    return true;
-}
-
-template<class LC>
-bool
-ListBase<LC>::getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set,
-                                    JSPropertyDescriptor *desc)
-{
-    if (!getOwnPropertyDescriptor(cx, proxy, id, set, desc))
-        return false;
-    if (desc->obj)
-        return true;
-    if (xpc::WrapperFactory::IsXrayWrapper(proxy))
-        return resolveNativeName(cx, proxy, id, desc);
-    JSObject *proto;
-    if (!js::GetObjectProto(cx, proxy, &proto))
-        return false;
-    if (!proto) {
-        desc->obj = NULL;
-        return true;
-    }
-    return JS_GetPropertyDescriptorById(cx, proto, id, JSRESOLVE_QUALIFIED, desc);
-}
-
-JSClass ExpandoClass = {
-    "DOM proxy binding expando object",
-    JSCLASS_HAS_PRIVATE,
-    JS_PropertyStub,
-    JS_PropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
-    JS_ResolveStub,
-    JS_ConvertStub
-};
-
-template<class LC>
-JSObject *
-ListBase<LC>::ensureExpandoObject(JSContext *cx, JSObject *obj)
-{
-    NS_ASSERTION(instanceIsProxy(obj), "expected a DOM proxy object");
-    JSObject *expando = getExpandoObject(obj);
-    if (!expando) {
-        expando = JS_NewObjectWithGivenProto(cx, &ExpandoClass, nullptr,
-                                             js::GetObjectParent(obj));
-        if (!expando)
-            return NULL;
-
-        JSCompartment *compartment = js::GetObjectCompartment(obj);
-        xpc::CompartmentPrivate *priv = xpc::GetCompartmentPrivate(compartment);
-        if (!priv->RegisterDOMExpandoObject(obj))
-            return NULL;
-
-        nsWrapperCache* cache;
-        CallQueryInterface(getListObject(obj), &cache);
-        cache->SetPreservingWrapper(true);
-
-        js::SetProxyExtra(obj, JSPROXYSLOT_EXPANDO, ObjectValue(*expando));
-        JS_SetPrivate(expando, js::GetProxyPrivate(obj).toPrivate());
-    }
-    return expando;
-}
-
-template<class LC>
-bool
-ListBase<LC>::defineProperty(JSContext *cx, JSObject *proxy, jsid id, JSPropertyDescriptor *desc)
-{
-    if (hasIndexSetter) {
-        int32_t index = GetArrayIndexFromId(cx, id);
-        if (index >= 0) {
-            nsCOMPtr<nsISupports> ref;
-            IndexSetterType value;
-            jsval v;
-            return Unwrap(cx, desc->value, &value, getter_AddRefs(ref), &v) &&
-                   setItemAt(cx, getListObject(proxy), index, value);
-        }
-    }
-
-    if (hasNameSetter && JSID_IS_STRING(id)) {
-        jsval name = STRING_TO_JSVAL(JSID_TO_STRING(id));
-        xpc_qsDOMString nameString(cx, name, &name,
-                                   xpc_qsDOMString::eDefaultNullBehavior,
-                                   xpc_qsDOMString::eDefaultUndefinedBehavior);
-        if (!nameString.IsValid())
-            return false;
-
-        nsCOMPtr<nsISupports> ref;
-        NameSetterType value;
-        jsval v;
-        if (!Unwrap(cx, desc->value, &value, getter_AddRefs(ref), &v))
-            return false;
-        return setNamedItem(cx, getListObject(proxy), nameString, value);
-    }
-
-    if (xpc::WrapperFactory::IsXrayWrapper(proxy))
-        return true;
-
-    JSObject *expando = ensureExpandoObject(cx, proxy);
-    if (!expando)
-        return false;
-
-    return JS_DefinePropertyById(cx, expando, id, desc->value, desc->getter, desc->setter,
-                                 desc->attrs);
-}
-
-template<class LC>
-bool
-ListBase<LC>::getOwnPropertyNames(JSContext *cx, JSObject *proxy, AutoIdVector &props)
-{
-    uint32_t length;
-    getListObject(proxy)->GetLength(&length);
-    MOZ_ASSERT(int32_t(length) >= 0);
-    for (int32_t i = 0; i < int32_t(length); ++i) {
-        if (!props.append(INT_TO_JSID(i)))
-            return false;
-    }
-
-    JSObject *expando;
-    if (!xpc::WrapperFactory::IsXrayWrapper(proxy) && (expando = getExpandoObject(proxy)) &&
-        !js::GetPropertyNames(cx, expando, JSITER_OWNONLY | JSITER_HIDDEN, &props))
-        return false;
-
-    // FIXME: Add named items
-    return true;
-}
-
-template<class LC>
-bool
-ListBase<LC>::delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp)
-{
-    JSBool b = true;
-
-    JSObject *expando;
-    if (!xpc::WrapperFactory::IsXrayWrapper(proxy) && (expando = getExpandoObject(proxy))) {
-        jsval v;
-        if (!JS_DeletePropertyById2(cx, expando, id, &v) ||
-            !JS_ValueToBoolean(cx, v, &b)) {
-            return false;
-        }
-    }
-
-    *bp = !!b;
-    return true;
-}
-
-template<class LC>
-bool
-ListBase<LC>::enumerate(JSContext *cx, JSObject *proxy, AutoIdVector &props)
-{
-    JSObject *proto;
-    return JS_GetPrototype(cx, proxy, &proto) &&
-           getOwnPropertyNames(cx, proxy, props) &&
-           (!proto || js::GetPropertyNames(cx, proto, 0, &props));
-}
-
-template<class LC>
-bool
-ListBase<LC>::hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp)
-{
-    if (hasIndexGetter) {
-        int32_t index = GetArrayIndexFromId(cx, id);
-        if (index >= 0) {
-            IndexGetterType result;
-            *bp = getItemAt(getListObject(proxy), uint32_t(index), result);
-            return true;
-        }
-    }
-
-    JSObject *expando = getExpandoObject(proxy);
-    if (expando) {
-        JSBool b = true;
-        JSBool ok = JS_HasPropertyById(cx, expando, id, &b);
-        *bp = !!b;
-        if (!ok || *bp)
-            return ok;
-    }
-
-    if (hasNameGetter && JSID_IS_STRING(id) && !hasPropertyOnPrototype(cx, proxy, id)) {
-        jsval name = STRING_TO_JSVAL(JSID_TO_STRING(id));
-        NameGetterType result;
-        return namedItem(cx, proxy, &name, result, bp);
-    }
-
-    *bp = false;
-    return true;
-}
-
-template<class LC>
-bool
-ListBase<LC>::has(JSContext *cx, JSObject *proxy, jsid id, bool *bp)
-{
-    if (!hasOwn(cx, proxy, id, bp))
-        return false;
-    // We have the property ourselves; no need to worry about our
-    // prototype chain.
-    if (*bp)
-        return true;
-
-    // OK, now we have to look at the proto
-    JSObject *proto;
-    if (!js::GetObjectProto(cx, proxy, &proto))
-        return false;
-    if (!proto)
-        return true;
-
-    JSBool protoHasProp;
-    bool ok = JS_HasPropertyById(cx, proto, id, &protoHasProp);
-    if (ok)
-        *bp = protoHasProp;
-    return ok;
-}
-
-template<class LC>
-bool
-ListBase<LC>::resolveNativeName(JSContext *cx, JSObject *proxy, jsid id, JSPropertyDescriptor *desc)
-{
-    MOZ_ASSERT(xpc::WrapperFactory::IsXrayWrapper(proxy));
-
-    for (size_t n = 0; n < sProtoPropertiesCount; ++n) {
-        if (id == sProtoProperties[n].id) {
-            desc->attrs = JSPROP_ENUMERATE | JSPROP_SHARED;
-            if (!sProtoProperties[n].setter)
-                desc->attrs |= JSPROP_READONLY;
-            desc->obj = proxy;
-            desc->setter = sProtoProperties[n].setter;
-            desc->getter = sProtoProperties[n].getter;
-            return true;
-        }
-    }
-
-    for (size_t n = 0; n < sProtoMethodsCount; ++n) {
-        if (id == sProtoMethods[n].id) {
-            JSFunction *fun = JS_NewFunctionById(cx, sProtoMethods[n].native,
-                                                 sProtoMethods[n].nargs, 0, proxy, id);
-            if (!fun)
-                return false;
-            JSObject *funobj = JS_GetFunctionObject(fun);
-            desc->value.setObject(*funobj);
-            desc->attrs = JSPROP_ENUMERATE;
-            desc->obj = proxy;
-            desc->setter = nullptr;
-            desc->getter = nullptr;
-            return true;
-        }
-    }
-
-    return Base::resolveNativeName(cx, proxy, id, desc);
-}
-
-template<class LC>
-bool
-ListBase<LC>::getPropertyOnPrototype(JSContext *cx, JSObject *proxy, jsid id, bool *found,
-                                     JS::Value *vp)
-{
-    JSObject *proto;
-    if (!js::GetObjectProto(cx, proxy, &proto))
-        return false;
-    if (!proto)
-        return true;
-
-    JSBool hasProp;
-    if (!JS_HasPropertyById(cx, proto, id, &hasProp))
-        return false;
-
-    *found = hasProp;
-    if (!hasProp || !vp)
-        return true;
-
-    return JS_ForwardGetPropertyTo(cx, proto, id, proxy, vp);
-}
-
-template<class LC>
-bool
-ListBase<LC>::hasPropertyOnPrototype(JSContext *cx, JSObject *proxy, jsid id)
-{
-    Maybe<JSAutoCompartment> ac;
-    if (xpc::WrapperFactory::IsXrayWrapper(proxy)) {
-        proxy = js::UnwrapObject(proxy);
-        ac.construct(cx, proxy);
-    }
-    MOZ_ASSERT(objIsList(proxy));
-
-    bool found = false;
-    // We ignore an error from getPropertyOnPrototype.
-    return !getPropertyOnPrototype(cx, proxy, id, &found, NULL) || found;
-}
-
-template<class LC>
-bool
-ListBase<LC>::get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp)
-{
-    NS_ASSERTION(!xpc::WrapperFactory::IsXrayWrapper(proxy),
-                 "Should not have a XrayWrapper here");
-
-    bool getFromExpandoObject = true;
-
-    if (hasIndexGetter) {
-        int32_t index = GetArrayIndexFromId(cx, id);
-        if (index >= 0) {
-            IndexGetterType result;
-            if (getItemAt(getListObject(proxy), uint32_t(index), result))
-                return Wrap(cx, proxy, result, vp);
-
-            // Even if we don't have this index, we don't forward the
-            // get on to our expando object.
-            getFromExpandoObject = false;
-        }
-    }
-
-    if (getFromExpandoObject) {
-        JSObject *expando = getExpandoObject(proxy);
-        if (expando) {
-            JSBool hasProp;
-            if (!JS_HasPropertyById(cx, expando, id, &hasProp))
-                return false;
-
-            if (hasProp)
-                return JS_GetPropertyById(cx, expando, id, vp);
-        }
-    }
-
-    bool found = false;
-    if (!getPropertyOnPrototype(cx, proxy, id, &found, vp))
-        return false;
-
-    if (found)
-        return true;
-
-    if (hasNameGetter && JSID_IS_STRING(id)) {
-        jsval name = STRING_TO_JSVAL(JSID_TO_STRING(id));
-        bool hasResult;
-        NameGetterType result;
-        if (!namedItem(cx, proxy, &name, result, &hasResult))
-            return false;
-        if (hasResult)
-            return Wrap(cx, proxy, result, vp);
-    }
-
-    vp->setUndefined();
-    return true;
-}
-
-template<class LC>
-bool
-ListBase<LC>::getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver,
-                                  uint32_t index, Value *vp, bool *present)
-{
-    NS_ASSERTION(!xpc::WrapperFactory::IsXrayWrapper(proxy),
-                 "Should not have a XrayWrapper here");
-
-    if (hasIndexGetter) {
-        IndexGetterType result;
-        *present = getItemAt(getListObject(proxy), index, result);
-        if (*present)
-            return Wrap(cx, proxy, result, vp);
-    }
-
-    jsid id;
-    if (!JS_IndexToId(cx, index, &id))
-        return false;
-
-    // if hasIndexGetter, we skip the expando object
-    if (!hasIndexGetter) {
-        JSObject *expando = getExpandoObject(proxy);
-        if (expando) {
-            JSBool isPresent;
-            if (!JS_GetElementIfPresent(cx, expando, index, expando, vp, &isPresent))
-                return false;
-            if (isPresent) {
-                *present = true;
-                return true;
-            }
-        }
-    }
-
-    // No need to worry about name getters here, so just check the proto.
-
-    JSObject *proto;
-    if (!js::GetObjectProto(cx, proxy, &proto))
-        return false;
-    if (proto) {
-        JSBool isPresent;
-        if (!JS_GetElementIfPresent(cx, proto, index, proxy, vp, &isPresent))
-            return false;
-        *present = isPresent;
-        return true;
-    }
-
-    *present = false;
-    // Can't Debug_SetValueRangeToCrashOnTouch because it's not public
-    return true;
-}
-
-template<class LC>
-bool
-ListBase<LC>::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
-                  Value *vp)
-{
-    return ProxyHandler::set(cx, proxy, proxy, id, strict, vp);
-}
-
-template<class LC>
-bool
-ListBase<LC>::keys(JSContext *cx, JSObject *proxy, AutoIdVector &props)
-{
-    return ProxyHandler::keys(cx, proxy, props);
-}
-
-template<class LC>
-bool
-ListBase<LC>::iterate(JSContext *cx, JSObject *proxy, unsigned flags, Value *vp)
-{
-    return ProxyHandler::iterate(cx, proxy, flags, vp);
-}
-
-template<class LC>
-bool
-ListBase<LC>::hasInstance(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleValue vp,
-                          bool *bp)
-{
-    *bp = vp.isObject() && js::GetObjectClass(&vp.toObject()) == &sInterfaceClass;
-    return true;
-}
-
-template<class LC>
-JSString *
-ListBase<LC>::obj_toString(JSContext *cx, JSObject *proxy)
-{
-    const char *clazz = sInterfaceClass.name;
-    size_t nchars = 9 + strlen(clazz); /* 9 for "[object ]" */
-    jschar *chars = (jschar *)JS_malloc(cx, (nchars + 1) * sizeof(jschar));
-    if (!chars)
-        return NULL;
-
-    const char *prefix = "[object ";
-    nchars = 0;
-    while ((chars[nchars] = (jschar)*prefix) != 0)
-        nchars++, prefix++;
-    while ((chars[nchars] = (jschar)*clazz) != 0)
-        nchars++, clazz++;
-    chars[nchars++] = ']';
-    chars[nchars] = 0;
-
-    JSString *str = JS_NewUCString(cx, chars, nchars);
-    if (!str)
-        JS_free(cx, chars);
-    return str;
-}
-
-template<class LC>
-void
-ListBase<LC>::finalize(JSFreeOp *fop, JSObject *proxy)
-{
-    ListType *list = getListObject(proxy);
-    nsWrapperCache *cache;
-    CallQueryInterface(list, &cache);
-    if (cache) {
-        cache->ClearWrapper();
-    }
-    XPCJSRuntime *rt = nsXPConnect::GetRuntimeInstance();
-    if (rt) {
-        rt->DeferredRelease(nativeToSupports(list));
-    }
-    else {
-        NS_RELEASE(list);
-    }
-}
-
-
-JSObject*
-NoBase::getPrototype(JSContext *cx, XPCWrappedNativeScope *scope, JSObject *receiver)
-{
-    // We need to pass the object prototype to JS_NewObject. If we pass NULL then the JS engine
-    // will look up a prototype on the global by using the class' name and we'll recurse into
-    // getPrototype.
-    return JS_GetObjectPrototype(cx, receiver);
-}
-
-JSObject*
-GetXrayExpandoChain(JSObject *obj) {
-    MOZ_ASSERT(instanceIsProxy(obj));
-    js::Value v = js::GetProxyExtra(obj, JSPROXYSLOT_XRAY_EXPANDO);
-    return v.isUndefined() ? nullptr : &v.toObject();
-}
-
-void
-SetXrayExpandoChain(JSObject *obj, JSObject *chain) {
-    MOZ_ASSERT(instanceIsProxy(obj));
-    js::Value v = chain ? JS::ObjectValue(*chain) : JSVAL_VOID;
-    js::SetProxyExtra(obj, JSPROXYSLOT_XRAY_EXPANDO, v);
-}
-
-}
-}
-}
-#include "dombindings_gen.cpp"
deleted file mode 100644
--- a/js/xpconnect/src/dombindings.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=4 sw=4 et tw=99 ft=cpp:
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef dombindings_h
-#define dombindings_h
-
-#include "jsapi.h"
-#include "jsproxy.h"
-#include "xpcpublic.h"
-#include "nsString.h"
-
-namespace mozilla {
-namespace dom {
-namespace oldproxybindings {
-
-class ProxyHandler : public DOMBaseProxyHandler {
-protected:
-    ProxyHandler() : DOMBaseProxyHandler(false)
-    {
-    }
-
-public:
-    virtual bool isInstanceOf(JSObject *prototype) = 0;
-};
-
-class NoType;
-class NoOp {
-public:
-    typedef NoType* T;
-    enum {
-        hasOp = 0
-    };
-};
-
-template<typename Type>
-class Op {
-public:
-    typedef Type T;
-    enum {
-        hasOp = 1
-    };
-};
-
-template<typename Type>
-class Getter : public Op<Type>
-{
-};
-
-template<typename Type>
-class Setter : public Op<Type>
-{
-};
-
-template<class Getter, class Setter=NoOp>
-class Ops
-{
-public:
-    typedef Getter G;
-    typedef Setter S;
-};
-
-typedef Ops<NoOp, NoOp> NoOps;
-
-template<class ListType, class Base, class IndexOps, class NameOps=NoOps>
-class DerivedListClass {
-public:
-    typedef ListType LT;
-    typedef Base B;
-    typedef IndexOps IO;
-    typedef NameOps NOp;
-};
-
-class NoBase {
-public:
-    static JSObject *getPrototype(JSContext *cx, XPCWrappedNativeScope *scope,
-                                  JSObject *receiver);
-    static bool resolveNativeName(JSContext *cx, JSObject *proxy, jsid id, JSPropertyDescriptor *desc)
-    {
-        return true;
-    }
-    static nsISupports* nativeToSupports(nsISupports* aNative)
-    {
-        return aNative;
-    }
-};
-
-template<class ListType, class IndexOps, class NameOps=NoOps>
-class ListClass : public DerivedListClass<ListType, NoBase, IndexOps, NameOps> {
-};
-
-template<class LC>
-class ListBase : public ProxyHandler {
-protected:
-    typedef typename LC::LT ListType;
-    typedef typename LC::B Base;
-    typedef typename LC::IO::G::T IndexGetterType;
-    typedef typename LC::IO::S::T IndexSetterType;
-    typedef typename LC::NOp::G::T NameGetterType;
-    typedef typename LC::NOp::S::T NameSetterType;
-    enum {
-        hasIndexGetter = LC::IO::G::hasOp,
-        hasIndexSetter = LC::IO::S::hasOp,
-        hasNameGetter = LC::NOp::G::hasOp,
-        hasNameSetter = LC::NOp::S::hasOp
-    };
-
-private:
-    friend void Register(nsScriptNameSpaceManager* aNameSpaceManager);
-
-    static ListBase<LC> instance;
-
-    static js::Class sInterfaceClass;
-
-    struct Properties {
-        jsid &id;
-        JSPropertyOp getter;
-        JSStrictPropertyOp setter;
-    };
-    struct Methods {
-        jsid &id;
-        JSNative native;
-        unsigned nargs;
-    };
-
-    static Properties sProtoProperties[];
-    static size_t sProtoPropertiesCount;
-    static Methods sProtoMethods[];
-    static size_t sProtoMethodsCount;
-
-    static JSObject *ensureExpandoObject(JSContext *cx, JSObject *obj);
-
-    static JSBool length_getter(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp);
-
-    static inline bool getItemAt(ListType *list, uint32_t i, IndexGetterType &item);
-    static inline bool setItemAt(JSContext *cx, ListType *list, uint32_t i, IndexSetterType item);
-
-    static inline bool namedItem(JSContext *cx, JSObject *obj, jsval *name, NameGetterType &result,
-                                 bool *hasResult);
-
-    static inline bool getNamedItem(ListType *list, const nsAString& aName, NameGetterType &item);
-    static inline bool setNamedItem(JSContext *cx, ListType *list, const nsAString& aName,
-                                    NameSetterType item);
-
-    static bool getPropertyOnPrototype(JSContext *cx, JSObject *proxy, jsid id, bool *found,
-                                       JS::Value *vp);
-    static bool hasPropertyOnPrototype(JSContext *cx, JSObject *proxy, jsid id);
-
-public:
-    static JSObject *create(JSContext *cx, JSObject *scope, ListType *list,
-                            nsWrapperCache* cache);
-
-    static JSObject *getPrototype(JSContext *cx, JSObject *receiver);
-    static bool DefineDOMInterface(JSContext *cx, JSObject *receiver, bool *enabled);
-    bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set,
-                               JSPropertyDescriptor *desc);
-    bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set,
-                                  JSPropertyDescriptor *desc);
-    bool defineProperty(JSContext *cx, JSObject *proxy, jsid id,
-                        JSPropertyDescriptor *desc);
-    bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, JS::AutoIdVector &props);
-    bool delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
-    bool enumerate(JSContext *cx, JSObject *proxy, JS::AutoIdVector &props);
-
-    bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
-    bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
-    bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, JS::Value *vp);
-    bool getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver,
-                             uint32_t index, JS::Value *vp, bool *present);
-    bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
-             JS::Value *vp);
-    bool keys(JSContext *cx, JSObject *proxy, JS::AutoIdVector &props);
-    bool iterate(JSContext *cx, JSObject *proxy, unsigned flags, JS::Value *vp);
-
-    /* Spidermonkey extensions. */
-    bool hasInstance(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleValue vp, bool *bp);
-    JSString *obj_toString(JSContext *cx, JSObject *proxy);
-    void finalize(JSFreeOp *fop, JSObject *proxy);
-
-    static bool proxyHandlerIsList(js::BaseProxyHandler *handler) {
-        return handler == &instance;
-    }
-    static bool objIsList(JSObject *obj) {
-        return js::IsProxy(obj) && proxyHandlerIsList(js::GetProxyHandler(obj));
-    }
-    static inline bool instanceIsListObject(JSContext *cx, JSObject *obj, JSObject *callee);
-    virtual bool isInstanceOf(JSObject *prototype)
-    {
-        return js::GetObjectClass(prototype) == &sInterfaceClass;
-    }
-    static inline ListType *getListObject(JSObject *obj);
-
-    static JSObject *getPrototype(JSContext *cx, XPCWrappedNativeScope *scope,
-                                  JSObject *receiver);
-    static bool resolveNativeName(JSContext *cx, JSObject *proxy, jsid id,
-                                  JSPropertyDescriptor *desc);
-    static ListType *getNative(JSObject *proxy);
-    static nsISupports* nativeToSupports(ListType* aNative)
-    {
-        return Base::nativeToSupports(aNative);
-    }
-};
-
-struct nsISupportsResult
-{
-    nsISupportsResult()
-    {
-    }
-    nsISupports *mResult;
-    nsWrapperCache *mCache;
-};
-
-JSObject* GetXrayExpandoChain(JSObject *obj);
-void SetXrayExpandoChain(JSObject *obj, JSObject *chain);
-
-}
-}
-}
-
-#include "dombindings_gen.h"
-
-#endif /* dombindings_h */
deleted file mode 100644
--- a/js/xpconnect/src/dombindingsgen.py
+++ /dev/null
@@ -1,823 +0,0 @@
-#!/usr/bin/env/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/.
-
-from codegen import *
-import xpidl
-import os, re
-import string
-import UserDict
-
-# === Preliminaries
-
-# --makedepend-output support.
-make_dependencies = []
-make_targets = []
-
-# === Reading the file
-
-def addStubMember(memberId, member):
-    # Add this member to the list.
-    member.iface.stubMembers.append(member)
-
-def checkStubMember(member):
-    memberId = member.iface.name + "." + member.name
-    if member.kind not in ('method', 'attribute'):
-        raise UserError("Member %s is %r, not a method or attribute."
-                        % (memberId, member.kind))
-    if member.noscript:
-        raise UserError("%s %s is noscript."
-                        % (member.kind.capitalize(), memberId))
-    if member.notxpcom:
-        raise UserError(
-            "%s %s: notxpcom methods are not supported."
-            % (member.kind.capitalize(), memberId))
-
-    # Check for unknown properties.
-    for attrname, value in vars(member).items():
-        if value is True and attrname not in ('readonly','optional_argc',
-                                              'implicit_jscontext','getter',
-                                              'stringifier'):
-            raise UserError("%s %s: unrecognized property %r"
-                            % (member.kind.capitalize(), memberId,
-                               attrname))
-
-def loadIDL(parser, includePath, filename):
-    make_dependencies.append(filename)
-    text = open(filename, 'r').read()
-    idl = parser.parse(text, filename=filename)
-    idl.resolve(includePath, parser)
-    return idl
-
-
-def firstCap(str):
-    return str[0].upper() + str[1:]
-
-class DOMClass(UserDict.DictMixin):
-    def __init__(self, name, nativeClass, prefable):
-        self.name = name
-        self.base = None
-        self.isBase = False
-        self.nativeClass = nativeClass
-        self.indexGetter = None
-        self.indexSetter = None
-        self.nameGetter = None
-        self.nameSetter = None
-        self.stringifier = False
-        self.members = set()
-        self.prefable = prefable
-
-    @staticmethod
-    def getterNativeType(getter):
-        if isStringType(getter.realtype):
-            return 'nsString'
-        type = getter.realtype
-        if type.kind in ('interface', 'forward'):
-            if not getter.notxpcom:
-                return "nsCOMPtr<%s>" % type.name
-            if len(getter.params) > 1:
-                assert len(getter.params) == 2
-                assert getter.params[1].realtype.kind == 'native' and getter.params[1].realtype.nativename == 'nsWrapperCache'
-                return 'nsISupportsResult' 
-        return type.nativeType('in').strip()
-
-    @staticmethod
-    def getterNativeCall(getter):
-        if isStringType(getter.realtype):
-            template = ("    list->%s(index, item);\n"
-                        "    return !DOMStringIsNull(item);\n")
-        else:
-            type = getter.realtype
-            if type.kind in ('interface', 'forward'):
-                if not getter.notxpcom:
-                    template = "    return NS_SUCCEEDED(list->%s(index, getter_AddRefs(item)));\n"
-                elif len(getter.params) > 1:
-                    template = ("    item.mResult = list->%s(index, &item.mCache);\n"
-                                "    return !!item.mResult;\n")
-                else:
-                    template = ("    item = list->%s(index);\n"
-                                "    return !!item;\n")
-            else:
-                template = ("    item = list->%s(index);\n"
-                            "    return !!item;\n")
-
-        return template % header.methodNativeName(getter)
-
-    @staticmethod
-    def setterNativeCall(setter):
-        if setter.notxpcom:
-            template = ("    !; // TODO")
-        else:
-            template = ("    nsresult rv = list->%s(index, item);\n"
-                        "    return NS_SUCCEEDED(rv) ? true : Throw(cx, rv);\n")
-
-        return template % header.methodNativeName(setter)
-
-    def __setattr__(self, name, value):
-        self.__dict__[name] = value
-        if value:
-            if name == 'indexGetter':
-                if value.forward:
-                    self.realIndexGetter = value.iface.namemap[value.forward]
-                else:
-                    self.realIndexGetter = value
-                self.indexGetterType = self.getterNativeType(self.realIndexGetter)
-            elif name == 'indexSetter':
-                if value.forward:
-                    self.realIndexSetter = value.iface.namemap[value.forward]
-                else:
-                    self.realIndexSetter = value
-                self.indexSetterType = self.realIndexSetter.params[1].realtype.nativeType("in")
-            elif name == 'nameGetter':
-                if value.forward:
-                    self.realNameGetter = value.iface.namemap[value.forward]
-                else:
-                    self.realNameGetter = value
-                self.nameGetterType = self.getterNativeType(self.realNameGetter)
-            elif name == 'nameSetter':
-                if value.forward:
-                    self.realNameSetter = value.iface.namemap[value.forward]
-                else:
-                    self.realNameSetter = value
-                self.nameSetterType = self.getterNativeType(self.realNameSetter)
-
-    def __getitem__(self, key):
-        assert type(key) == str
-
-        if key == 'indexGet':
-            return DOMClass.getterNativeCall(self.realIndexGetter)
-
-        if key == 'indexSet':
-            return DOMClass.setterNativeCall(self.realIndexSetter)
-
-        if key == 'nameGet':
-            return DOMClass.getterNativeCall(self.realNameGetter)
-
-        if key == 'nameSet':
-            return DOMClass.setterNativeCall(self.realNameSetter)
-
-        def ops(getterType, setterType):
-            def opType(type):
-                return type + (" " if type.endswith('>') else "")
-
-            if getterType or setterType:
-                opsClass = ", Ops<"
-                if getterType:
-                    opsClass += "Getter<" + opType(getterType) + ">"
-                else:
-                    # Should we even support this?
-                    opsClass += "NoOp"
-                if setterType:
-                    opsClass += ", Setter<" + opType(setterType) + ">"
-                opsClass += " >"
-            else:
-                opsClass = ", NoOps"
-            return opsClass
-
-        if key == 'indexOps':
-            return ops(self.indexGetter and self.indexGetterType, self.indexSetter and self.indexSetterType)
-        if key == 'nameOps':
-            return ops(self.nameGetter and self.nameGetterType, self.nameSetter and self.nameSetterType) if self.nameGetter else ""
-
-        if key == 'listClass':
-            if self.base:
-                template = "DerivedListClass<${nativeClass}, ${base}Wrapper${indexOps}${nameOps} >"
-            else:
-                template = "ListClass<${nativeClass}${indexOps}${nameOps} >"
-            return string.Template(template).substitute(self)
-
-        return self.__dict__[key]
-
-    def __cmp__(x, y):
-        if x.isBase != y.isBase:
-            return -1 if x.isBase else 1
-        return cmp(x.name, y.name)
-
-class Configuration:
-    def __init__(self, filename, includePath):
-        self.includePath = includePath
-        config = {}
-        execfile(filename, config)
-
-        # required settings
-        if 'list_classes' not in config:
-            raise UserError(filename + ": `%s` was not defined." % name)
-        if 'list_classes' not in config:
-            raise UserError(filename + ": `%s` was not defined." % name)
-        self.list_classes = {}
-        self.newBindingHeaders = []
-        for clazz in config['list_classes']:
-            self.list_classes[clazz['name']] = \
-                DOMClass(name = clazz['name'],
-                         nativeClass = clazz['nativeClass'],
-                         prefable = False)
-            self.newBindingHeaders.append(clazz.get('newBindingHeader', "mozilla/dom/" + clazz['name'] + "Binding.h"))
-
-        # optional settings
-        if 'prefableClasses' in config:
-            for clazz in config['prefableClasses']:
-                self.list_classes[clazz] = DOMClass(name=clazz, nativeClass=config['prefableClasses'][clazz], prefable=True)
-
-        self.customInheritance = config.get('customInheritance', {})
-        self.derivedClasses = {}
-        self.irregularFilenames = config.get('irregularFilenames', {})
-        self.customIncludes = config.get('customIncludes', [])
-
-def readConfigFile(filename, includePath):
-    # Read the config file.
-    return Configuration(filename, includePath)
-
-def completeConfiguration(conf, includePath, cachedir):
-    # Now read IDL files to connect the information in the config file to
-    # actual XPCOM interfaces, methods, and attributes.
-    interfaces = []
-    interfacesByName = {}
-    parser = xpidl.IDLParser(cachedir)
-
-    def getInterface(interfaceName, errorLoc):
-        iface = interfacesByName.get(interfaceName)
-        if iface is None:
-            idlFile = findIDL(conf.includePath, conf.irregularFilenames,
-                              interfaceName)
-            idl = loadIDL(parser, conf.includePath, idlFile)
-            if not idl.hasName(interfaceName):
-                raise UserError("The interface %s was not found "
-                                "in the idl file %r."
-                                % (interfaceName, idlFile))
-            iface = idl.getName(interfaceName, errorLoc)
-            if not iface.attributes.scriptable:
-                raise UserError("Interface %s is not scriptable. "
-                                "IDL file: %r." % (interfaceName, idlFile))
-            iface.stubMembers = []
-            interfaces.append(iface)
-            interfacesByName[interfaceName] = iface
-        return iface
-
-    stubbedInterfaces = []
-
-    for clazz in conf.list_classes.itervalues():
-        interfaceName = 'nsIDOM' + clazz.name
-
-        iface = getInterface(interfaceName, errorLoc='looking for %r' % clazz.name)
-
-        for member in iface.members:
-            if member.kind in ('method', 'attribute') and not member.noscript:
-                #addStubMember(iface.name + '.' + member.name, member)
-                clazz.members.add(member)
-
-        # Stub all scriptable members of this interface.
-        while True:
-            if iface not in stubbedInterfaces:
-                stubbedInterfaces.append(iface)
-            if not clazz.indexGetter and iface.ops['index']['getter']:
-                clazz.indexGetter = iface.ops['index']['getter']
-            if not clazz.indexSetter and iface.ops['index']['setter']:
-                clazz.indexSetter = iface.ops['index']['setter']
-            if not clazz.nameGetter and iface.ops['name']['getter']:
-                clazz.nameGetter = iface.ops['name']['getter']
-            if not clazz.nameSetter and iface.ops['name']['setter']:
-                clazz.nameSetter = iface.ops['name']['setter']
-            if not clazz.stringifier and iface.ops['stringifier']:
-                clazz.stringifier = iface.ops['stringifier']
-            interfaceName = conf.customInheritance.get(iface.name, iface.base)
-            iface = getInterface(interfaceName, errorLoc='looking for %r' % clazz.name)
-            if iface.name == 'nsISupports':
-                break
-
-            assert iface.name.startswith('nsIDOM') and not iface.name.startswith('nsIDOMNS')
-            clazz.base = iface.name[6:]
-            # For now we only support base classes that are real DOM
-            # list classes
-            assert clazz.base in conf.list_classes
-            if not conf.list_classes[clazz.base].isBase:
-                conf.list_classes[clazz.base].isBase = True
-                conf.derivedClasses[clazz.base] = []
-            conf.derivedClasses[clazz.base].append(clazz.name)
-
-    # Now go through and check all the interfaces' members
-    for iface in stubbedInterfaces:
-        for member in iface.stubMembers:
-            checkStubMember(member)
-
-    return interfaces
-
-# === Generating the header file
-
-def addType(types, type, map):
-    def getTranslatedType(type):
-        return map.get(type, type)
-
-    type = xpidl.unaliasType(type)
-    if isInterfaceType(type) or (type.kind == 'native' and type.specialtype is None):
-        types.add(getTranslatedType(type.name))
-
-
-def getTypes(classes, map):
-    types = set()
-    for clazz in classes.itervalues():
-        types.add(map.get(clazz.nativeClass, clazz.nativeClass))
-        if clazz.indexGetter:
-            addType(types, clazz.realIndexGetter.realtype, map)
-        if clazz.indexSetter:
-            addType(types, clazz.realIndexSetter.realtype, map)
-        if clazz.nameGetter:
-            addType(types, clazz.realNameGetter.realtype, map)
-        if clazz.nameSetter:
-            addType(types, clazz.realNameSetter.realtype, map)
-    return types
-
-listDefinitionTemplate = (
-"class ${name} {\n"
-"public:\n"
-"    template<typename I>\n"
-"    static JSObject *create(JSContext *cx, JSObject *scope, I *list)\n"
-"    {\n"
-"        return create(cx, scope, list, list);\n"
-"    }\n"
-"\n"
-"    static bool objIsWrapper(JSObject *obj);\n"
-"    static ${nativeClass} *getNative(JSObject *obj);\n"
-"\n"
-"private:\n"
-"    static JSObject *create(JSContext *cx, JSObject *scope, ${nativeClass} *list, nsWrapperCache *cache);\n"
-"};"
-"\n"
-"\n")
-
-def writeHeaderFile(filename, config):
-    print "Creating header file", filename
-
-    headerMacro = '__gen_%s__' % filename.replace('.', '_')
-    f = open(filename, 'w')
-    try:
-        f.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n\n"
-                "#ifndef " + headerMacro + "\n"
-                "#define " + headerMacro + "\n\n")
-
-        namespaces = []
-        for type in sorted(getTypes(config.list_classes, {})):
-            newNamespaces = type.split('::')
-            type = newNamespaces.pop()
-            j = 0
-            for i in range(min(len(namespaces), len(newNamespaces))):
-                if namespaces[i] != newNamespaces[i]:
-                    break
-                j += 1
-            for i in range(j, len(namespaces)):
-                f.write("}\n")
-                namespaces.pop()
-            for i in range(j, len(newNamespaces)):
-                f.write("namespace %s {\n" % newNamespaces[i])
-                namespaces.append(newNamespaces[i])
-            f.write("class %s;\n" % type)
-        for namespace in namespaces:
-            f.write("}\n")
-        f.write("\n")
-
-        f.write("namespace mozilla {\n"
-                "namespace dom {\n"
-                "namespace oldproxybindings {\n\n")
-        f.write("bool\n"
-                "DefinePropertyStaticJSVals(JSContext *cx);\n\n")
-
-        for clazz in config.list_classes.itervalues():
-            f.write(string.Template(listDefinitionTemplate).substitute(clazz))
-
-        f.write("\n"
-                "}\n"
-                "}\n"
-                "}\n\n")
-        f.write("#endif\n")
-    finally:
-        f.close()
-
-def writeMakeDependOutput(filename):
-    print "Creating makedepend file", filename
-    f = open(filename, 'w')
-    try:
-        if len(make_targets) > 0:
-            f.write("%s:" % makeQuote(make_targets[0]))
-            for filename in make_dependencies:
-                f.write(' \\\n\t\t%s' % makeQuote(filename))
-            f.write('\n\n')
-            for filename in make_targets[1:]:
-                f.write('%s: %s\n' % (makeQuote(filename), makeQuote(make_targets[0])))
-    finally:
-        f.close()
-
-# === Generating the source file
-
-listTemplateHeader = (
-"// ${name}\n"
-"\n"
-"typedef ${listClass} ${name}Class;\n"
-"typedef ListBase<${name}Class> ${name}Wrapper;\n"
-"\n"
-"\n")
-
-listTemplate = (
-"// ${name}\n"
-"\n"
-"template<>\n"
-"js::Class ${name}Wrapper::sInterfaceClass = {\n"
-"    \"${name}\",\n"
-"    0,\n"
-"    JS_PropertyStub,        /* addProperty */\n"
-"    JS_PropertyStub,        /* delProperty */\n"
-"    JS_PropertyStub,        /* getProperty */\n"
-"    JS_StrictPropertyStub,  /* setProperty */\n"
-"    JS_EnumerateStub,\n"
-"    JS_ResolveStub,\n"
-"    JS_ConvertStub,\n"
-"    NULL,                   /* finalize    */\n"
-"    NULL,                   /* checkAccess */\n"
-"    NULL,                   /* call        */\n"
-"    interface_hasInstance,\n"
-"    NULL                    /* construct   */\n"
-"};\n"
-"\n"
-"// static\n"
-"template<>\n"
-"bool\n"
-"${name}Wrapper::DefineDOMInterface(JSContext *cx, JSObject *receiver, bool *enabled)\n"
-"{\n"
-"  bool ok = mozilla::dom::${name}Binding::DefineDOMInterface(cx, receiver, enabled);\n"
-"  if (ok || *enabled) {\n"
-"    return ok;\n"
-"  }\n"
-"  *enabled = true;\n"
-"  return getPrototype(cx, receiver);\n"
-"}\n"
-"\n")
-
-derivedClassTemplate = (
-"template<>\n"
-"bool\n"
-"${name}Wrapper::objIsList(JSObject *obj)\n"
-"{\n"
-"    if (!js::IsProxy(obj))\n"
-"        return false;\n"
-"    js::BaseProxyHandler *handler = js::GetProxyHandler(obj);\n"
-"    return proxyHandlerIsList(handler) ||\n"
-"${checkproxyhandlers};\n"
-"}\n"
-"\n"
-"template<>\n"
-"${nativeClass}*\n"
-"${name}Wrapper::getNative(JSObject *obj)\n"
-"{\n"
-"    js::BaseProxyHandler *handler = js::GetProxyHandler(obj);\n"
-"    if (proxyHandlerIsList(handler))\n"
-"        return static_cast<${nativeClass}*>(js::GetProxyPrivate(obj).toPrivate());\n"
-"${castproxyhandlers}"
-"\n"
-"    NS_RUNTIMEABORT(\"Unknown list type!\");\n"
-"    return NULL;\n"
-"}\n"
-"\n")
-
-prefableClassTemplate = (
-"template<>\n"
-"JSObject *\n"
-"${name}Wrapper::getPrototype(JSContext *cx, JSObject *receiver, bool *enabled)\n"
-"{\n"
-"    XPCWrappedNativeScope *scope =\n"
-"        XPCWrappedNativeScope::FindInJSObjectScope(cx, receiver);\n"
-"    if (!scope)\n"
-"        return NULL;\n"
-"\n"
-"    if (!scope->NewDOMBindingsEnabled()) {\n"
-"        *enabled = false;\n"
-"        return NULL;\n"
-"    }\n"
-"\n"
-"    *enabled = true;\n"
-"    return getPrototype(cx, scope, receiver);\n"
-"}\n"
-"\n")
-
-toStringTemplate = (
-"template<>\n"
-"JSString *\n"
-"${name}Wrapper::obj_toString(JSContext *cx, JSObject *proxy)\n"
-"{\n"
-"    nsString result;\n"
-"    nsresult rv = ${name}Wrapper::getListObject(proxy)->ToString(result);\n"
-"    JSString *jsresult;\n"
-"    return NS_SUCCEEDED(rv) && xpc_qsStringToJsstring(cx, result, &jsresult) ? jsresult : NULL;\n"
-"}\n"
-"\n")
-
-indexGetterTemplate = (
-"template<>\n"
-"bool\n"
-"${name}Wrapper::getItemAt(${nativeClass} *list, uint32_t index, ${indexGetterType} &item)\n"
-"{\n"
-"${indexGet}"
-"}\n"
-"\n")
-
-indexSetterTemplate = (
-"template<>\n"
-"bool\n"
-"${name}Wrapper::setItemAt(JSContext *cx, ${nativeClass} *list, uint32_t index, ${indexSetterType} item)\n"
-"{\n"
-"${indexSet}"
-"}\n"
-"\n")
-
-nameGetterTemplate = (
-"template<>\n"
-"bool\n"
-"${name}Wrapper::getNamedItem(${nativeClass} *list, const nsAString& index, ${nameGetterType} &item)\n"
-"{\n"
-"${nameGet}"
-"}\n"
-"\n")
-
-nameSetterTemplate = (
-"template<>\n"
-"bool\n"
-"${name}Wrapper::setNamedItem(JSContext *cx, ${nativeClass} *list, const nsAString& index, ${nameSetterType} item)\n"
-"{\n"
-"${nameSet}"
-"}\n"
-"\n")
-
-propertiesTemplate = (
-"template<>\n"
-"${name}Wrapper::Properties ${name}Wrapper::sProtoProperties[] = {\n"
-"${properties}\n"
-"};\n"
-"\n"
-"template<>\n"
-"size_t ${name}Wrapper::sProtoPropertiesCount = ArrayLength(${name}Wrapper::sProtoProperties);\n"
-"\n")
-
-methodsTemplate = (
-"template<>\n"
-"${name}Wrapper::Methods ${name}Wrapper::sProtoMethods[] = {\n"
-"${methods}\n"
-"};\n"
-"\n"
-"template<>\n"
-"size_t ${name}Wrapper::sProtoMethodsCount = ArrayLength(${name}Wrapper::sProtoMethods);\n"
-"\n")
-
-listTemplateFooter = (
-"template class ListBase<${name}Class>;\n"
-"\n"
-"JSObject*\n"
-"${name}::create(JSContext *cx, JSObject *scope, ${nativeClass} *list, nsWrapperCache *cache)\n"
-"{\n"
-"    return ${name}Wrapper::create(cx, scope, list, cache);\n"
-"}\n"
-"\n"
-"bool\n"
-"${name}::objIsWrapper(JSObject *obj)\n"
-"{\n"
-"    return ${name}Wrapper::objIsList(obj);\n"
-"}\n"
-"\n"
-"${nativeClass}*\n"
-"${name}::getNative(JSObject *obj)\n"
-"{\n"
-"    return ${name}Wrapper::getListObject(obj);\n"
-"}\n"
-"\n")
-
-def writeBindingStub(f, classname, member, stubName, isSetter=False):
-    def writeThisUnwrapping(f, member, isMethod, isGetter, customMethodCall):
-        if isMethod:
-            f.write("    JSObject *callee = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));\n"
-                    "    if (!%sWrapper::instanceIsListObject(cx, obj, callee))\n"
-                    "        return false;\n" % classname)
-        else:
-            f.write("    if (!%sWrapper::instanceIsListObject(cx, obj, NULL))\n"
-                    "        return false;\n" % classname)
-        return "%sWrapper::getListObject(obj)" % classname
-    def writeCheckForFailure(f, isMethod, isGeter):
-        f.write("    if (NS_FAILED(rv))\n"
-                "        return xpc_qsThrowMethodFailedWithDetails(cx, rv, \"%s\", \"%s\");\n" % (classname, member.name))
-    def writeResultWrapping(f, member, jsvalPtr, jsvalRef):
-        if member.kind == 'method' and member.notxpcom and len(member.params) > 0 and member.params[len(member.params) - 1].paramtype == 'out':
-            assert member.params[len(member.params) - 1].realtype.kind == 'native' and member.params[len(member.params) - 1].realtype.nativename == 'nsWrapperCache'
-            template = "    return Wrap(cx, obj, result, cache, ${jsvalPtr});\n"
-        else:
-            template = "    return Wrap(cx, obj, result, ${jsvalPtr});\n"
-        writeResultConv(f, member.realtype, template, jsvalPtr, jsvalRef)
-
-    writeStub(f, {}, member, stubName, writeThisUnwrapping, writeCheckForFailure, writeResultWrapping, isSetter)
-
-def writeAttrStubs(f, classname, attr):
-    getterName = classname + '_' + header.attributeNativeName(attr, True)
-    writeBindingStub(f, classname, attr, getterName)
-    if attr.readonly:
-        setterName = 'xpc_qsGetterOnlyPropertyStub'
-    else:
-        setterName = (classname + '_'
-                      + header.attributeNativeName(attr, False))
-        writeBindingStub(f, classname, attr, setterName, isSetter=True)
-
-    return "    { s_%s_id, %s, %s }" % (attr.name, getterName, setterName)
-
-def writeMethodStub(f, classname, method):
-    stubName = classname + '_' + header.methodNativeName(method)
-    writeBindingStub(f, classname, method, stubName)
-    return "    { s_%s_id, %s, %i }" % (method.name, stubName, argumentsLength(method))
-
-def writeStubFile(filename, config, interfaces):
-    print "Creating stub file", filename
-    make_targets.append(filename)
-
-    f = open(filename, 'w')
-    filesIncluded = set()
-
-    headerFilename = re.sub(r'(\.cpp)?$', '.h', filename)
-
-    try:
-        f.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n\n")
-
-        f.write("#include \"nsScriptNameSpaceManager.h\"\n")
-        types = getTypes(config.list_classes, config.irregularFilenames)
-        for clazz in config.list_classes.itervalues():
-            for member in clazz.members:
-                addType(types, member.realtype, config.irregularFilenames)
-                if member.kind == 'method':
-                    for p in member.params:
-                        addType(types, p.realtype, config.irregularFilenames)
-
-        f.write("".join([("#include \"%s.h\"\n" % re.sub(r'(([^:]+::)*)', '', type)) for type in sorted(types)]))
-        for newBindingHeader in config.newBindingHeaders:
-            f.write("#include \"" + newBindingHeader + "\"\n")
-        f.write("\n")
-
-        f.write("namespace mozilla {\n"
-                "namespace dom {\n"
-                "namespace oldproxybindings {\n\n")
-
-        f.write("// Property name ids\n\n")
-
-        ids = set()
-        for clazz in config.list_classes.itervalues():
-            assert clazz.indexGetter
-            ids.add(clazz.indexGetter.name)
-            if clazz.indexSetter:
-                ids.add(clazz.indexSetter.name)
-            if clazz.nameGetter:
-                ids.add(clazz.nameGetter.name)
-            if clazz.stringifier:
-                ids.add('toString')
-            for member in clazz.members:
-                if member.name != 'length':
-                    ids.add(member.name)
-
-        ids = sorted(ids)
-        for id in ids:
-            f.write("static jsid s_%s_id = JSID_VOID;\n" % id)
-        f.write("\n"
-                "bool\n"
-                "DefinePropertyStaticJSVals(JSContext *cx)\n"
-                "{\n")
-        f.write("    return %s;" % (" &&\n           ".join([("SET_JSID_TO_STRING(cx, %s)" % id) for id in ids])))
-        f.write("\n"
-                "}\n\n")
-
-        classes = sorted(config.list_classes.values())
-
-        f.write("// Typedefs\n\n")
-
-        for clazz in classes:
-            f.write(string.Template(listTemplateHeader).substitute(clazz))
-
-        f.write("// Implementation\n\n")
-
-        for clazz in classes:
-            f.write(string.Template(listTemplate).substitute(clazz))
-            derivedClasses = config.derivedClasses.get(clazz.name, None)
-            if derivedClasses:
-                # If this hits we might need to do something better than just compare instance pointers
-                assert len(derivedClasses) <= 3
-                checkproxyhandlers = "||\n".join(map(lambda d: "           %sWrapper::proxyHandlerIsList(handler)" % d, derivedClasses))
-                castproxyhandlers = "\n".join(map(lambda d: "    if (%sWrapper::proxyHandlerIsList(handler))\n        return %sWrapper::getNative(obj);\n" % (d, d), derivedClasses))
-                f.write(string.Template(derivedClassTemplate).substitute(clazz, checkproxyhandlers=checkproxyhandlers, castproxyhandlers=castproxyhandlers))
-            if clazz.prefable:
-                f.write(string.Template(prefableClassTemplate).substitute(clazz))
-            methodsList = []
-            propertiesList = []
-            if clazz.stringifier:
-                f.write(string.Template(toStringTemplate).substitute(clazz))
-                if clazz.stringifier.name != 'toString':
-                    methodsList.append("    { s_toString_id, %s_%s, 0 }", clazz.name, header.methodNativeName(clazz.stringifier))
-            if clazz.indexGetter:
-                #methodsList.append("    { s_%s_id, &item, 1 }" % clazz.indexGetter.name)
-                f.write(string.Template(indexGetterTemplate).substitute(clazz))
-                methodsList.append("    { s_iterator_id, JS_ArrayIterator, 0}")
-            if clazz.indexSetter:
-                f.write(string.Template(indexSetterTemplate).substitute(clazz))
-            if clazz.nameGetter:
-                #methodsList.append("    { s_%s_id, &namedItem, 1 }" % clazz.nameGetter.name)
-                f.write(string.Template(nameGetterTemplate).substitute(clazz))
-            if clazz.nameSetter:
-                f.write(string.Template(nameSetterTemplate).substitute(clazz))
-            for member in sorted(clazz.members, key=lambda member: member.name):
-                if member.name == 'length':
-                    if not member.readonly:
-                        setterName = (clazz.name + '_' + header.attributeNativeName(member, False))
-                        writeBindingStub(f, clazz.name, member, setterName, isSetter=True)
-                    else:
-                        setterName = "NULL"
-
-                    propertiesList.append("    { mozilla::dom::s_length_id, length_getter, %s }" % setterName)
-                    continue
-
-                isAttr = (member.kind == 'attribute')
-                isMethod = (member.kind == 'method')
-                assert isAttr or isMethod
-
-                if isMethod:
-                    methodsList.append(writeMethodStub(f, clazz.name, member))
-                else:
-                    propertiesList.append(writeAttrStubs(f, clazz.name, member))
-
-            if len(propertiesList) > 0:
-                f.write(string.Template(propertiesTemplate).substitute(clazz, properties=",\n".join(propertiesList)))
-            if len(methodsList) > 0:
-                f.write(string.Template(methodsTemplate).substitute(clazz, methods=",\n".join(methodsList)))
-            f.write(string.Template(listTemplateFooter).substitute(clazz))
-            
-        f.write("// Register prototypes\n\n")
-
-        f.write("void\n"
-                "Register(nsScriptNameSpaceManager* aNameSpaceManager)\n"
-                "{\n"
-                "#define REGISTER_PROTO(_dom_class) \\\n"
-                "    aNameSpaceManager->RegisterDefineDOMInterface(NS_LITERAL_STRING(#_dom_class), _dom_class##Wrapper::DefineDOMInterface, nullptr);\n\n"""
-                "\n")
-        for clazz in config.list_classes.itervalues():
-            f.write("    REGISTER_PROTO(%s);\n" % clazz.name)
-        f.write("\n"
-                "#undef REGISTER_PROTO\n"
-                 "}\n\n")
-
-        f.write("}\n"
-                "}\n"
-                "}\n")
-    finally:
-        f.close()
-
-def main():
-    from optparse import OptionParser
-    o = OptionParser(usage="usage: %prog [options] configfile")
-    o.add_option('-o', "--stub-output",
-                 type='string', dest='stub_output', default=None,
-                 help="Quick stub C++ source output file", metavar="FILE")
-    o.add_option('--header-output', type='string', default=None,
-                 help="Quick stub header output file", metavar="FILE")
-    o.add_option('--makedepend-output', type='string', default=None,
-                 help="gnumake dependencies output file", metavar="FILE")
-    o.add_option('--idlpath', type='string', default='.',
-                 help="colon-separated directories to search for idl files",
-                 metavar="PATH")
-    o.add_option('--cachedir', dest='cachedir', default='',
-                 help="Directory in which to cache lex/parse tables.")
-    o.add_option("--verbose-errors", action='store_true', default=False,
-                 help="When an error happens, display the Python traceback.")
-    (options, filenames) = o.parse_args()
-
-    if len(filenames) != 1:
-        o.error("Exactly one config filename is needed.")
-    filename = filenames[0]
-
-    if options.cachedir != '':
-        sys.path.append(options.cachedir)
-        if not os.path.isdir(options.cachedir):
-            os.makedirs(options.cachedir)
-
-    try:
-        includePath = options.idlpath.split(':')
-        conf = readConfigFile(filename,
-                              includePath=includePath)
-        if options.header_output is not None:
-            writeHeaderFile(options.header_output, conf)
-        elif options.stub_output is not None:
-            interfaces = completeConfiguration(conf,
-                                               includePath=includePath,
-                                               cachedir=options.cachedir)
-            writeStubFile(options.stub_output, conf, interfaces)
-            if options.makedepend_output is not None:
-                writeMakeDependOutput(options.makedepend_output)
-    except Exception, exc:
-        if options.verbose_errors:
-            raise
-        elif isinstance(exc, (UserError, xpidl.IDLError)):
-            warn(str(exc))
-        elif isinstance(exc, OSError):
-            warn("%s: %s" % (exc.__class__.__name__, exc))
-        else:
-            raise
-        sys.exit(1)
-
-if __name__ == '__main__':
-    main()
--- a/js/xpconnect/src/event_impl_gen.py
+++ b/js/xpconnect/src/event_impl_gen.py
@@ -1,28 +1,30 @@
 #!/usr/bin/env python
 # header.py - Generate C++ header files from IDL.
 #
 # 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/.
 
-from codegen import *
 import sys, os.path, re, xpidl, itertools
 
 # --makedepend-output support.
 make_dependencies = []
 make_targets = []
 
 def strip_end(text, suffix):
     if not text.endswith(suffix):
         return text
     return text[:-len(suffix)]
 
 # Copied from dombindingsgen.py
+def makeQuote(filename):
+    return filename.replace(' ', '\\ ')  # enjoy!
+
 def writeMakeDependOutput(filename):
     print "Creating makedepend file", filename
     f = open(filename, 'w')
     try:
         if len(make_targets) > 0:
             f.write("%s:" % makeQuote(make_targets[0]))
             for filename in make_dependencies:
                 f.write(' \\\n\t\t%s' % makeQuote(filename))
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -26,17 +26,16 @@
 #include "WrapperFactory.h"
 #include "AccessCheck.h"
 
 #ifdef MOZ_JSDEBUGGER
 #include "jsdIDebuggerService.h"
 #endif
 
 #include "XPCQuickStubs.h"
-#include "dombindings.h"
 
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/TextDecoderBinding.h"
 #include "mozilla/dom/TextEncoderBinding.h"
 
 #include "nsWrapperCacheInlines.h"
 #include "nsDOMMutationObserver.h"
 #include "nsICycleCollectorListener.h"
@@ -842,21 +841,16 @@ NoteGCThingXPCOMChildren(js::Class *clas
         cb.NoteXPCOMChild(to->GetNative());
     }
     // XXX This test does seem fragile, we should probably whitelist classes
     //     that do hold a strong reference, but that might not be possible.
     else if (clasp->flags & JSCLASS_HAS_PRIVATE &&
              clasp->flags & JSCLASS_PRIVATE_IS_NSISUPPORTS) {
         NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "xpc_GetJSPrivate(obj)");
         cb.NoteXPCOMChild(static_cast<nsISupports*>(xpc_GetJSPrivate(obj)));
-    } else if (oldproxybindings::instanceIsProxy(obj)) {
-        NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "js::GetProxyPrivate(obj)");
-        nsISupports *identity =
-            static_cast<nsISupports*>(js::GetProxyPrivate(obj).toPrivate());
-        cb.NoteXPCOMChild(identity);
     } else {
         const DOMClass* domClass;
         DOMObjectSlot slot = GetDOMClass(obj, domClass);
         if (slot != eNonDOMObject) {
             NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "UnwrapDOMObject(obj)");
             if (domClass->mDOMObjectIsISupports) {
                 cb.NoteXPCOMChild(UnwrapDOMObject<nsISupports>(obj, slot));
             } else if (domClass->mParticipant) {
@@ -1418,31 +1412,20 @@ nsXPConnect::GetNativeOfWrapper(JSContex
         XPCWrappedNative::GetWrappedNativeOfJSObject(aJSContext, aJSObj, nullptr,
                                                      &obj2);
     if (wrapper)
         return wrapper->Native();
 
     if (obj2)
         return (nsISupports*)xpc_GetJSPrivate(obj2);
 
-    if (mozilla::dom::IsDOMProxy(aJSObj) ||
-        mozilla::dom::oldproxybindings::instanceIsProxy(aJSObj)) {
-        // FIXME: Provide a fast non-refcounting way to get the canonical
-        //        nsISupports from the proxy.
-        nsISupports *supports =
-            static_cast<nsISupports*>(js::GetProxyPrivate(aJSObj).toPrivate());
-        nsCOMPtr<nsISupports> canonical = do_QueryInterface(supports);
-        return canonical.get();
-    }
-
     nsISupports* supports = nullptr;
-    if (mozilla::dom::UnwrapDOMObjectToISupports(aJSObj, supports))
-        return supports;
-
-    return nullptr;
+    mozilla::dom::UnwrapDOMObjectToISupports(aJSObj, supports);
+    nsCOMPtr<nsISupports> canonical = do_QueryInterface(supports);
+    return canonical;
 }
 
 /* JSObjectPtr getJSObjectOfWrapper (in JSContextPtr aJSContext, in JSObjectPtr aJSObj); */
 NS_IMETHODIMP
 nsXPConnect::GetJSObjectOfWrapper(JSContext * aJSContext,
                                   JSObject * aJSObj,
                                   JSObject **_retval)
 {
@@ -1461,18 +1444,17 @@ nsXPConnect::GetJSObjectOfWrapper(JSCont
     if (wrapper) {
         wrapper->GetJSObject(_retval);
         return NS_OK;
     }
     if (obj2) {
         *_retval = obj2;
         return NS_OK;
     }
-    if (mozilla::dom::IsDOMProxy(aJSObj) ||
-        mozilla::dom::oldproxybindings::instanceIsProxy(aJSObj)) {
+    if (mozilla::dom::IsDOMObject(aJSObj)) {
         *_retval = aJSObj;
         return NS_OK;
     }
     // else...
     *_retval = nullptr;
     return NS_ERROR_FAILURE;
 }
 
--- a/js/xpconnect/src/xpcpublic.h
+++ b/js/xpconnect/src/xpcpublic.h
@@ -299,62 +299,29 @@ nsCycleCollectionParticipant *
 xpc_JSCompartmentParticipant();
 
 namespace mozilla {
 namespace dom {
 
 extern int HandlerFamily;
 inline void* ProxyFamily() { return &HandlerFamily; }
 
-class DOMBaseProxyHandler : public js::BaseProxyHandler {
-protected:
-    DOMBaseProxyHandler(bool aNewDOMProxy) : js::BaseProxyHandler(ProxyFamily()),
-                                             mNewDOMProxy(aNewDOMProxy)
-    {
-    }
-
-public:
-    bool mNewDOMProxy;
-};
-
-inline bool IsNewProxyBinding(js::BaseProxyHandler* handler)
-{
-  MOZ_ASSERT(handler->family() == ProxyFamily());
-  return static_cast<DOMBaseProxyHandler*>(handler)->mNewDOMProxy;
-}
-
 inline bool IsDOMProxy(JSObject *obj)
 {
     return js::IsProxy(obj) &&
-           js::GetProxyHandler(obj)->family() == ProxyFamily() &&
-           IsNewProxyBinding(js::GetProxyHandler(obj));
+           js::GetProxyHandler(obj)->family() == ProxyFamily();
 }
 
 typedef bool
 (*DefineInterface)(JSContext *cx, JSObject *global, bool *enabled);
 
 typedef bool
 (*PrefEnabled)();
 
 extern bool
 DefineStaticJSVals(JSContext *cx);
 void
 Register(nsScriptNameSpaceManager* aNameSpaceManager);
 
-namespace oldproxybindings {
-
-inline bool instanceIsProxy(JSObject *obj)
-{
-    return js::IsProxy(obj) &&
-           js::GetProxyHandler(obj)->family() == ProxyFamily() &&
-           !IsNewProxyBinding(js::GetProxyHandler(obj));
-}
-extern bool
-DefineStaticJSVals(JSContext *cx);
-void
-Register(nsScriptNameSpaceManager* aNameSpaceManager);
-
-} // namespace oldproxybindings
-
 } // namespace dom
 } // namespace mozilla
 
 #endif
--- a/js/xpconnect/tests/chrome/test_nodelists.xul
+++ b/js/xpconnect/tests/chrome/test_nodelists.xul
@@ -25,20 +25,17 @@
         is(list[0], list.item(0), "list.item works");
         is(list.item, list.item, "don't recreate functions for each get");
 
         var list2 = list[2];
         ok(list[2].toString().indexOf("[object HTMLParagraphElement"), "list[2] exists");
         ok("2" in list, "in operator works");
 
         is(win.document.body.removeChild(win.document.body.lastChild), list2, "remove last paragraph element");
-        if (SpecialPowers.getBoolPref("dom.new_bindings"))
-            ok(!("2" in list), "in operator doesn't see phantom element");
-        else
-            todo(!("2" in list), "in operator doesn't see phantom element");
+        ok(!("2" in list), "in operator doesn't see phantom element");
         is(list[2], undefined, "no node there!");
         SimpleTest.finish();
       }
   ]]></script>
 
   <iframe id="ifr"
           src="http://mochi.test:8888/tests/js/xpconnect/tests/mochitest/file_nodelists.html"
           onload="go()" />
--- a/js/xpconnect/wrappers/FilteringWrapper.cpp
+++ b/js/xpconnect/wrappers/FilteringWrapper.cpp
@@ -102,18 +102,16 @@ FilteringWrapper<Base, Policy>::enter(JS
         return false;
     return Base::enter(cx, wrapper, id, act, bp);
 }
 
 #define SOW FilteringWrapper<CrossCompartmentSecurityWrapper, OnlyIfSubjectIsSystem>
 #define SCSOW FilteringWrapper<SameCompartmentSecurityWrapper, OnlyIfSubjectIsSystem>
 #define XOW FilteringWrapper<XrayWrapper<CrossCompartmentSecurityWrapper>, \
                              CrossOriginAccessiblePropertiesOnly>
-#define PXOW   FilteringWrapper<XrayProxy, \
-                                CrossOriginAccessiblePropertiesOnly>
 #define DXOW   FilteringWrapper<XrayDOM, \
                                 CrossOriginAccessiblePropertiesOnly>
 #define NNXOW FilteringWrapper<CrossCompartmentSecurityWrapper, \
                                CrossOriginAccessiblePropertiesOnly>
 #define LW    FilteringWrapper<XrayWrapper<SameCompartmentSecurityWrapper>, \
                                LocationPolicy>
 #define XLW   FilteringWrapper<XrayWrapper<CrossCompartmentSecurityWrapper>, \
                                LocationPolicy>
@@ -121,26 +119,24 @@ FilteringWrapper<Base, Policy>::enter(JS
                             ComponentsObjectPolicy>
 #define XCW FilteringWrapper<CrossCompartmentSecurityWrapper, \
                             ComponentsObjectPolicy>
 template<> SOW SOW::singleton(WrapperFactory::SCRIPT_ACCESS_ONLY_FLAG |
                               WrapperFactory::SOW_FLAG);
 template<> SCSOW SCSOW::singleton(WrapperFactory::SCRIPT_ACCESS_ONLY_FLAG |
                                   WrapperFactory::SOW_FLAG);
 template<> XOW XOW::singleton(WrapperFactory::SCRIPT_ACCESS_ONLY_FLAG);
-template<> PXOW PXOW::singleton(WrapperFactory::SCRIPT_ACCESS_ONLY_FLAG);
 template<> DXOW DXOW::singleton(WrapperFactory::SCRIPT_ACCESS_ONLY_FLAG);
 template<> NNXOW NNXOW::singleton(WrapperFactory::SCRIPT_ACCESS_ONLY_FLAG);
 template<> LW  LW::singleton(WrapperFactory::SHADOWING_FORBIDDEN);
 template<> XLW XLW::singleton(WrapperFactory::SHADOWING_FORBIDDEN);
 
 template<> CW CW::singleton(0);
 template<> XCW XCW::singleton(0);
 
 template class SOW;
 template class XOW;
-template class PXOW;
 template class DXOW;
 template class NNXOW;
 template class LW;
 template class XLW;
 template class ChromeObjectWrapperBase;
 }
--- a/js/xpconnect/wrappers/WrapperFactory.cpp
+++ b/js/xpconnect/wrappers/WrapperFactory.cpp
@@ -8,17 +8,16 @@
 #include "WaiveXrayWrapper.h"
 #include "FilteringWrapper.h"
 #include "XrayWrapper.h"
 #include "AccessCheck.h"
 #include "XPCWrapper.h"
 #include "ChromeObjectWrapper.h"
 
 #include "xpcprivate.h"
-#include "dombindings.h"
 #include "XPCMaps.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "jsfriendapi.h"
 #include "mozilla/Likely.h"
 
 using namespace js;
 
 namespace xpc {
@@ -319,18 +318,16 @@ WrapperFactory::Rewrap(JSContext *cx, JS
                 // If we waived the X-ray wrapper for this object, wrap it into a
                 // special wrapper to transitively maintain the X-ray waiver.
                 wrapper = &WaiveXrayWrapper::singleton;
             } else {
                 // Native objects must be wrapped into an X-ray wrapper.
                 XrayType type = GetXrayType(obj);
                 if (type == XrayForDOMObject) {
                     wrapper = &XrayDOM::singleton;
-                } else if (type == XrayForDOMProxyObject) {
-                    wrapper = &XrayProxy::singleton;
                 } else if (type == XrayForWrappedNative) {
                     typedef XrayWrapper<CrossCompartmentWrapper> Xray;
                     wrapper = &Xray::singleton;
                 } else {
                     wrapper = &CrossCompartmentWrapper::singleton;
                 }
             }
         }
@@ -351,18 +348,16 @@ WrapperFactory::Rewrap(JSContext *cx, JS
             wn->HasProto() && wn->GetProto()->ClassIsDOMObject()) {
             typedef XrayWrapper<CrossCompartmentSecurityWrapper> Xray;
             if (IsLocationObject(obj))
                 wrapper = &FilteringWrapper<Xray, LocationPolicy>::singleton;
             else
                 wrapper = &FilteringWrapper<Xray, CrossOriginAccessiblePropertiesOnly>::singleton;
         } else if (mozilla::dom::IsDOMObject(obj)) {
             wrapper = &FilteringWrapper<XrayDOM, CrossOriginAccessiblePropertiesOnly>::singleton;
-        } else if (mozilla::dom::oldproxybindings::instanceIsProxy(obj)) {
-            wrapper = &FilteringWrapper<XrayProxy, CrossOriginAccessiblePropertiesOnly>::singleton;
         } else if (IsComponentsObject(obj)) {
             wrapper = &FilteringWrapper<CrossCompartmentSecurityWrapper,
                                         ComponentsObjectPolicy>::singleton;
         } else {
             wrapper = &ChromeObjectWrapper::singleton;
 
             // If the prototype of the chrome object being wrapped is a prototype
             // for a standard class, use the one from the content compartment so
@@ -417,18 +412,16 @@ WrapperFactory::Rewrap(JSContext *cx, JS
         } else if (IsComponentsObject(obj)) {
             wrapper = &FilteringWrapper<CrossCompartmentSecurityWrapper,
                                         ComponentsObjectPolicy>::singleton;
         } else if (!targetdata || !targetdata->wantXrays ||
                    (type = GetXrayType(obj)) == NotXray) {
             wrapper = &CrossCompartmentWrapper::singleton;
         } else if (type == XrayForDOMObject) {
             wrapper = &XrayDOM::singleton;
-        } else if (type == XrayForDOMProxyObject) {
-            wrapper = &XrayProxy::singleton;
         } else {
             typedef XrayWrapper<CrossCompartmentWrapper> Xray;
             wrapper = &Xray::singleton;
         }
     } else {
         NS_ASSERTION(!AccessCheck::needsSystemOnlyWrapper(obj),
                      "bad object exposed across origins");
 
@@ -436,19 +429,16 @@ WrapperFactory::Rewrap(JSContext *cx, JS
         // a predefined set of properties.
         XrayType type = GetXrayType(obj);
         if (type == NotXray) {
             wrapper = &FilteringWrapper<CrossCompartmentSecurityWrapper,
                                         CrossOriginAccessiblePropertiesOnly>::singleton;
         } else if (type == XrayForDOMObject) {
             wrapper = &FilteringWrapper<XrayDOM,
                                         CrossOriginAccessiblePropertiesOnly>::singleton;
-        } else if (type == XrayForDOMProxyObject) {
-            wrapper = &FilteringWrapper<XrayProxy,
-                                        CrossOriginAccessiblePropertiesOnly>::singleton;
         } else {
             typedef XrayWrapper<CrossCompartmentSecurityWrapper> Xray;
 
             // Location objects can become same origin after navigation, so we might
             // have to grant transparent access later on.
             if (IsLocationObject(obj)) {
                 wrapper = &FilteringWrapper<Xray, LocationPolicy>::singleton;
             } else {
@@ -566,18 +556,16 @@ WrapperFactory::WrapForSameCompartmentXr
     XrayType type = GetXrayType(obj);
     if (type == NotXray)
         return NULL;
 
     // Select the appropriate proxy handler.
     Wrapper *wrapper = NULL;
     if (type == XrayForWrappedNative)
         wrapper = &XrayWrapper<DirectWrapper>::singleton;
-    else if (type == XrayForDOMProxyObject)
-        wrapper = &XrayWrapper<DirectWrapper, ProxyXrayTraits>::singleton;
     else if (type == XrayForDOMObject)
         wrapper = &XrayWrapper<DirectWrapper, DOMXrayTraits>::singleton;
     else
         MOZ_NOT_REACHED("Bad Xray type");
 
     // Make the Xray.
     JSObject *parent = JS_GetGlobalForObject(cx, obj);
     return Wrapper::New(cx, obj, NULL, parent, wrapper);
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -17,17 +17,16 @@
 
 #include "XPCWrapper.h"
 #include "xpcprivate.h"
 
 #include "jsapi.h"
 #include "nsJSUtils.h"
 
 #include "mozilla/dom/BindingUtils.h"
-#include "dombindings.h"
 
 using namespace mozilla::dom;
 
 namespace xpc {
 
 using namespace js;
 
 static const uint32_t JSSLOT_RESOLVING = 0;
@@ -48,19 +47,16 @@ using namespace XrayUtils;
 
 XrayType
 GetXrayType(JSObject *obj)
 {
     obj = js::UnwrapObject(obj, /* stopAtOuter = */ false);
     if (mozilla::dom::IsDOMObject(obj))
         return XrayForDOMObject;
 
-    if (mozilla::dom::oldproxybindings::instanceIsProxy(obj))
-        return XrayForDOMProxyObject;
-
     js::Class* clasp = js::GetObjectClass(obj);
     if (IS_WRAPPER_CLASS(clasp) || clasp->ext.innerObject) {
         NS_ASSERTION(clasp->ext.innerObject || IS_WN_WRAPPER_OBJECT(obj),
                      "We forgot to Morph a slim wrapper!");
         return XrayForWrappedNative;
     }
     return NotXray;
 }
@@ -218,48 +214,16 @@ public:
     }
     virtual void setExpandoChain(JSObject *obj, JSObject *chain) {
         SetWNExpandoChain(obj, chain);
     }
 
     static XPCWrappedNativeXrayTraits singleton;
 };
 
-class ProxyXrayTraits : public XrayTraits
-{
-public:
-    static bool resolveNativeProperty(JSContext *cx, JSObject *wrapper, JSObject *holder, jsid id,
-                                      bool set, JSPropertyDescriptor *desc);
-    virtual bool resolveOwnProperty(JSContext *cx, js::Wrapper &jsWrapper, JSObject *wrapper,
-                                    JSObject *holder, jsid id, bool set,
-                                    JSPropertyDescriptor *desc);
-    static bool enumerateNames(JSContext *cx, JSObject *wrapper, unsigned flags,
-                               JS::AutoIdVector &props);
-
-    static bool isResolving(JSContext *cx, JSObject *holder, jsid id)
-    {
-        return false;
-    }
-
-    virtual void preserveWrapper(JSObject *target) { };
-
-    typedef ResolvingIdDummy ResolvingIdImpl;
-
-    virtual JSObject* createHolder(JSContext *cx, JSObject *wrapper);
-
-    virtual JSObject* getExpandoChain(JSObject *obj) {
-        return mozilla::dom::oldproxybindings::GetXrayExpandoChain(obj);
-    }
-    virtual void setExpandoChain(JSObject *obj, JSObject *chain) {
-        mozilla::dom::oldproxybindings::SetXrayExpandoChain(obj, chain);
-    }
-
-    static ProxyXrayTraits singleton;
-};
-
 class DOMXrayTraits : public XrayTraits
 {
 public:
     static bool resolveNativeProperty(JSContext *cx, JSObject *wrapper, JSObject *holder, jsid id,
                                       bool set, JSPropertyDescriptor *desc);
     virtual bool resolveOwnProperty(JSContext *cx, js::Wrapper &jsWrapper, JSObject *wrapper,
                                     JSObject *holder, jsid id, bool set,
                                     JSPropertyDescriptor *desc);
@@ -283,27 +247,24 @@ public:
     virtual void setExpandoChain(JSObject *obj, JSObject *chain) {
         mozilla::dom::SetXrayExpandoChain(obj, chain);
     }
 
     static DOMXrayTraits singleton;
 };
 
 XPCWrappedNativeXrayTraits XPCWrappedNativeXrayTraits::singleton;
-ProxyXrayTraits ProxyXrayTraits::singleton;
 DOMXrayTraits DOMXrayTraits::singleton;
 
 XrayTraits*
 GetXrayTraits(JSObject *obj)
 {
     switch (GetXrayType(obj)) {
       case XrayForDOMObject:
         return &DOMXrayTraits::singleton;
-      case XrayForDOMProxyObject:
-        return &ProxyXrayTraits::singleton;
       case XrayForWrappedNative:
         return &XPCWrappedNativeXrayTraits::singleton;
       default:
         return nullptr;
     }
 }
 
 /*
@@ -1206,67 +1167,16 @@ XPCWrappedNativeXrayTraits::construct(JS
         }
     }
 
     return true;
 
 }
 
 bool
-ProxyXrayTraits::resolveNativeProperty(JSContext *cx, JSObject *wrapper, JSObject *holder,
-                                       jsid id, bool set, JSPropertyDescriptor *desc)
-{
-    JSObject *obj = getTargetObject(wrapper);
-    return js::GetProxyHandler(obj)->getPropertyDescriptor(cx, wrapper, id, set, desc);
-}
-
-bool
-ProxyXrayTraits::resolveOwnProperty(JSContext *cx, js::Wrapper &jsWrapper, JSObject *wrapper,
-                                    JSObject *holder, jsid id, bool set, PropertyDescriptor *desc)
-{
-    // Call the common code.
-    bool ok = XrayTraits::resolveOwnProperty(cx, jsWrapper, wrapper, holder,
-                                             id, set, desc);
-    if (!ok || desc->obj)
-        return ok;
-
-    JSObject *obj = getTargetObject(wrapper);
-    ok = js::GetProxyHandler(obj)->getOwnPropertyDescriptor(cx, wrapper, id, set, desc);
-    if (ok) {
-        // The 'not found' property descriptor has obj == NULL.
-        if (desc->obj)
-            desc->obj = wrapper;
-    }
-
-    // Own properties don't get cached on the holder. Just return.
-    return ok;
-}
-
-bool
-ProxyXrayTraits::enumerateNames(JSContext *cx, JSObject *wrapper, unsigned flags,
-                                JS::AutoIdVector &props)
-{
-    JSObject *obj = getTargetObject(wrapper);
-    if (flags & (JSITER_OWNONLY | JSITER_HIDDEN))
-        return js::GetProxyHandler(obj)->getOwnPropertyNames(cx, wrapper, props);
-
-    return js::GetProxyHandler(obj)->enumerate(cx, wrapper, props);
-}
-
-// The 'holder' here isn't actually of [[Class]] HolderClass like those used by
-// XPCWrappedNativeXrayTraits. Instead, it's a funny hybrid of the 'expando' and
-// 'holder' properties. However, we store it in the same slot. Exercise caution.
-JSObject*
-ProxyXrayTraits::createHolder(JSContext *cx, JSObject *wrapper)
-{
-    return JS_NewObjectWithGivenProto(cx, nullptr, nullptr,
-                                      JS_GetGlobalForObject(cx, wrapper));
-}
-
-bool
 DOMXrayTraits::resolveNativeProperty(JSContext *cx, JSObject *wrapper, JSObject *holder, jsid id,
                                      bool set, JSPropertyDescriptor *desc)
 {
     JSObject *obj = getTargetObject(wrapper);
     const NativePropertyHooks *nativeHooks = GetDOMClass(obj)->mNativeHooks;
 
     do {
         if (!nativeHooks->mResolveProperty(cx, wrapper, id, set, desc))
@@ -1387,17 +1297,17 @@ XrayToString(JSContext *cx, unsigned arg
         return false;
     if (!IsWrapper(wrapper) || !WrapperFactory::IsXrayWrapper(wrapper)) {
         JS_ReportError(cx, "XrayToString called on an incompatible object");
         return false;
     }
 
     nsAutoString result(NS_LITERAL_STRING("[object XrayWrapper "));
     JSObject *obj = &js::GetProxyPrivate(wrapper).toObject();
-    if (IsDOMProxy(obj) || oldproxybindings::instanceIsProxy(obj)) {
+    if (IsDOMProxy(obj)) {
         JSString *wrapperStr = js::GetProxyHandler(wrapper)->obj_toString(cx, wrapper);
         size_t length;
         const jschar* chars = JS_GetStringCharsAndLength(cx, wrapperStr, &length);
         if (!chars) {
             JS_ReportOutOfMemory(cx);
             return false;
         }
         result.Append(chars, length);
@@ -1808,36 +1718,26 @@ template <> XRAY XRAY::singleton(0);
 template class XRAY;
 #undef XRAY
 
 #define XRAY XrayWrapper<CrossCompartmentWrapper, XPCWrappedNativeXrayTraits >
 template <> XRAY XRAY::singleton(0);
 template class XRAY;
 #undef XRAY
 
-#define XRAY XrayWrapper<CrossCompartmentWrapper, ProxyXrayTraits >
-template <> XRAY XRAY::singleton(0);
-template class XRAY;
-#undef XRAY
-
 #define XRAY XrayWrapper<CrossCompartmentWrapper, DOMXrayTraits >
 template <> XRAY XRAY::singleton(0);
 template class XRAY;
 #undef XRAY
 
 /* Same-compartment non-filtering versions. */
 
 #define XRAY XrayWrapper<DirectWrapper, XPCWrappedNativeXrayTraits >
 template <> XRAY XRAY::singleton(0);
 template class XRAY;
 #undef XRAY
 
-#define XRAY XrayWrapper<DirectWrapper, ProxyXrayTraits >
-template <> XRAY XRAY::singleton(0);
-template class XRAY;
-#undef XRAY
-
 #define XRAY XrayWrapper<DirectWrapper, DOMXrayTraits >
 template <> XRAY XRAY::singleton(0);
 template class XRAY;
 #undef XRAY
 
 }
--- a/js/xpconnect/wrappers/XrayWrapper.h
+++ b/js/xpconnect/wrappers/XrayWrapper.h
@@ -41,17 +41,16 @@ GetNativePropertiesObject(JSContext *cx,
 class XrayTraits;
 class XPCWrappedNativeXrayTraits;
 class ProxyXrayTraits;
 class DOMXrayTraits;
 
 
 enum XrayType {
     XrayForDOMObject,
-    XrayForDOMProxyObject,
     XrayForWrappedNative,
     NotXray
 };
 
 XrayType GetXrayType(JSObject *obj);
 XrayTraits* GetXrayTraits(JSObject *obj);
 
 // NB: Base *must* derive from JSProxyHandler
@@ -89,17 +88,16 @@ class XrayWrapper : public Base {
 
     static XrayWrapper singleton;
 
   private:
     bool enumerate(JSContext *cx, JSObject *wrapper, unsigned flags,
                    JS::AutoIdVector &props);
 };
 
-typedef XrayWrapper<js::CrossCompartmentWrapper, ProxyXrayTraits > XrayProxy;
 typedef XrayWrapper<js::CrossCompartmentWrapper, DOMXrayTraits > XrayDOM;
 
 class SandboxProxyHandler : public js::IndirectWrapper {
 public:
     SandboxProxyHandler() : js::IndirectWrapper(0)
     {
     }
 
--- a/layout/base/nsChildIterator.h
+++ b/layout/base/nsChildIterator.h
@@ -89,17 +89,17 @@ public:
   ChildIterator operator--(int) {
     ChildIterator result(*this);
     --(*this);
     return result;
   }
 
   nsIContent* get() const {
     if (XBLInvolved()) {
-      return mNodes->GetNodeAt(mIndex);
+      return mNodes->Item(mIndex);
     }
 
     return mChild;
   }
 
   nsIContent* operator*() const { return get(); }
 
   bool operator==(const ChildIterator& aOther) const {
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -417,17 +417,17 @@ nsFrameManager::ClearAllUndisplayedConte
   // the content list via GetXBLChildNodesFor and just ignore any nodes we
   // don't care about.
   nsINodeList* list =
     aParentContent->OwnerDoc()->BindingManager()->GetXBLChildNodesFor(aParentContent);
   if (list) {
     uint32_t length;
     list->GetLength(&length);
     for (uint32_t i = 0; i < length; ++i) {
-      nsIContent* child = list->GetNodeAt(i);
+      nsIContent* child = list->Item(i);
       if (child->GetParent() != aParentContent) {
         ClearUndisplayedContentIn(child, child->GetParent());
       }
     }
   }
 }
 
 //----------------------------------------------------------------------
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -676,17 +676,16 @@ pref("dom.send_after_paint_to_content", 
 
 // Timeout clamp in ms for timeouts we clamp
 pref("dom.min_timeout_value", 4);
 // And for background windows
 pref("dom.min_background_timeout_value", 1000);
 
 // Use the new DOM bindings (only affects any scopes created after the pref is
 // changed)
-pref("dom.new_bindings", true);
 pref("dom.experimental_bindings", true);
 
 // Don't use new input types
 pref("dom.experimental_forms", false);
 
 // Parsing perf prefs. For now just mimic what the old code did.
 #ifndef XP_WIN
 pref("content.sink.pending_event_mode", 0);
--- a/xpcom/idl-parser/xpidl.py
+++ b/xpcom/idl-parser/xpidl.py
@@ -466,30 +466,16 @@ class BaseInterface(object):
         self.namemap = NameMap()
         self.doccomments = doccomments
         self.nativename = name
 
         for m in members:
             if not isinstance(m, CDATA):
                 self.namemap.set(m)
 
-        self.ops = {
-            'index':
-                {
-                    'getter': None,
-                    'setter': None
-                },
-            'name':
-                {
-                    'getter': None,
-                    'setter': None
-                },
-            'stringifier': None
-            }
-
     def __eq__(self, other):
         return self.name == other.name and self.location == other.location
 
     def resolve(self, parent):
         self.idl = parent
 
         # Hack alert: if an identifier is already present, libIDL assigns
         # doc comments incorrectly. This is quirks-mode extraordinaire!
@@ -516,26 +502,18 @@ class BaseInterface(object):
                 raise IDLError("%s '%s' inherits from non-%s type '%s'" % (self.kind, self.name, self.kind, self.base), self.location)
 
             if self.attributes.scriptable and not realbase.attributes.scriptable:
                 print >>sys.stderr, IDLError("interface '%s' is scriptable but derives from non-scriptable '%s'" % (self.name, self.base), self.location, warning=True)
 
             if self.attributes.scriptable and realbase.attributes.builtinclass and not self.attributes.builtinclass:
                 raise IDLError("interface '%s' is not builtinclass but derives from builtinclass '%s'" % (self.name, self.base), self.location)
 
-        forwardedMembers = set()
         for member in self.members:
             member.resolve(self)
-            if member.kind is 'method' and member.forward:
-                forwardedMembers.add(member.forward)
-        for member in self.members:
-            if member.kind is 'method' and member.name in forwardedMembers:
-                forwardedMembers.remove(member.name)
-        for member in forwardedMembers:
-            raise IDLError("member '%s' on interface '%s' forwards to '%s' which is not on the interface itself" % (member.name, self.name, member.forward), self.location)
 
         # The number 250 is NOT arbitrary; this number is the maximum number of
         # stub entries defined in xpcom/reflect/xptcall/public/genstubs.pl
         # Do not increase this value without increasing the number in that
         # location, or you WILL cause otherwise unknown problems!
         if self.countEntries() > 250 and not self.attributes.builtinclass:
             raise IDLError("interface '%s' has too many entries" % self.name,
                 self.location)
@@ -818,20 +796,16 @@ class Method(object):
     kind = 'method'
     noscript = False
     notxpcom = False
     binaryname = None
     implicit_jscontext = False
     nostdcall = False
     optional_argc = False
     deprecated = False
-    getter = False
-    setter = False
-    stringifier = False
-    forward = None
 
     def __init__(self, type, name, attlist, paramlist, location, doccomments, raises):
         self.type = type
         self.name = name
         self.attlist = attlist
         self.params = paramlist
         self.location = location
         self.doccomments = doccomments
@@ -840,91 +814,44 @@ class Method(object):
         for name, value, aloc in attlist:
             if name == 'binaryname':
                 if value is None:
                     raise IDLError("binaryname attribute requires a value",
                                    aloc)
 
                 self.binaryname = value
                 continue
-            if name == 'forward':
-                if value is None:
-                    raise IDLError("forward attribute requires a value",
-                                   aloc)
-
-                self.forward = value
-                continue
 
             if value is not None:
                 raise IDLError("Unexpected attribute value", aloc)
 
             if name == 'noscript':
                 self.noscript = True
             elif name == 'notxpcom':
                 self.notxpcom = True
             elif name == 'implicit_jscontext':
                 self.implicit_jscontext = True
             elif name == 'optional_argc':
                 self.optional_argc = True
             elif name == 'deprecated':
                 self.deprecated = True
             elif name == 'nostdcall':
                 self.nostdcall = True
-            elif name == 'getter':
-                if (len(self.params) != 1):
-                    raise IDLError("Methods marked as getter must take 1 argument", aloc)
-                self.getter = True
-            elif name == 'setter':
-                if (len(self.params) != 2):
-                    raise IDLError("Methods marked as setter must take 2 arguments", aloc)
-                self.setter = True
-            elif name == 'stringifier':
-                if (len(self.params) != 0):
-                    raise IDLError("Methods marked as stringifier must take 0 arguments", aloc)
-                self.stringifier = True
             else:
                 raise IDLError("Unexpected attribute '%s'" % name, aloc)
 
         self.namemap = NameMap()
         for p in paramlist:
             self.namemap.set(p)
 
     def resolve(self, iface):
         self.iface = iface
         self.realtype = self.iface.idl.getName(self.type, self.location)
         for p in self.params:
             p.resolve(self)
-        if self.getter:
-            if getBuiltinOrNativeTypeName(self.params[0].realtype) == 'unsigned long':
-                ops = 'index'
-            else:
-                if getBuiltinOrNativeTypeName(self.params[0].realtype) != '[domstring]':
-                    raise IDLError("a getter must take a single unsigned long or DOMString argument" % self.iface.name, self.location)
-                ops = 'name'
-            if self.iface.ops[ops]['getter']:
-                raise IDLError("a %s getter was already defined on interface '%s'" % (ops, self.iface.name), self.location)
-            self.iface.ops[ops]['getter'] = self
-        if self.setter:
-            if getBuiltinOrNativeTypeName(self.params[0].realtype) == 'unsigned long':
-                ops = 'index'
-            else:
-                if getBuiltinOrNativeTypeName(self.params[0].realtype) != '[domstring]':
-                    print getBuiltinOrNativeTypeName(self.params[0].realtype)
-                    raise IDLError("a setter must take a unsigned long or DOMString argument" % self.iface.name, self.location)
-                ops = 'name'
-            if self.iface.ops[ops]['setter']:
-                raise IDLError("a %s setter was already defined on interface '%s'" % (ops, self.iface.name), self.location)
-            self.iface.ops[ops]['setter'] = self
-        if self.stringifier:
-            if self.iface.ops['stringifier']:
-                raise IDLError("a stringifier was already defined on interface '%s'" % self.iface.name, self.location)
-            if getBuiltinOrNativeTypeName(self.realtype) != '[domstring]':
-                raise IDLError("'stringifier' attribute can only be used on methods returning DOMString",
-                               self.location)
-            self.iface.ops['stringifier'] = self
         for p in self.params:
             if p.retval and p != self.params[-1]:
                 raise IDLError("'retval' parameter '%s' is not the last parameter" % p.name, self.location)
             if p.size_is:
                 found_size_param = False
                 for size_param in self.params:
                     if p.size_is == size_param.name:
                         found_size_param = True