Merge m-c to inbound.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 15 Nov 2012 20:34:51 -0500
changeset 113447 b7c7be527638eb90e30e46f757582cb77924afbc
parent 113446 19e0634007b3d299a4e44f35c98ceb3bd5c10727 (current diff)
parent 113409 58ebb638a7ea6c3a4a19fa45c0bd8b9818c12542 (diff)
child 113448 ed72449453b499ffeb66bf4053d6faed65406fe1
push id23872
push useremorley@mozilla.com
push dateFri, 16 Nov 2012 17:06:27 +0000
treeherdermozilla-central@a7ed19f7d21a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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
Merge m-c to inbound.
content/base/public/nsContentUtils.h
content/events/src/nsXMLEventsElement.cpp
content/events/src/nsXMLEventsManager.cpp
content/events/src/nsXMLEventsManager.h
content/xtf/Makefile.in
content/xtf/public/Makefile.in
content/xtf/public/nsIXMLContentBuilder.idl
content/xtf/public/nsIXTFAttributeHandler.idl
content/xtf/public/nsIXTFElement.idl
content/xtf/public/nsIXTFElementFactory.idl
content/xtf/public/nsIXTFElementWrapper.idl
content/xtf/public/nsIXTFPrivate.idl
content/xtf/readme.txt
content/xtf/src/Makefile.in
content/xtf/src/nsIXTFService.h
content/xtf/src/nsXMLContentBuilder.cpp
content/xtf/src/nsXTFElementWrapper.cpp
content/xtf/src/nsXTFElementWrapper.h
content/xtf/src/nsXTFInterfaceAggregator.cpp
content/xtf/src/nsXTFInterfaceAggregator.h
content/xtf/src/nsXTFService.cpp
content/xtf/src/nsXTFWeakTearoff.cpp
content/xtf/src/nsXTFWeakTearoff.h
content/xtf/test/Makefile.in
content/xtf/test/unit/test_xtf.js
content/xtf/test/unit/xpcshell.ini
content/xtf/test/unit/xtfComponent.js
content/xtf/test/unit/xtfComponent.manifest
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -144,17 +144,16 @@
 @BINPATH@/components/commandlines.xpt
 @BINPATH@/components/composer.xpt
 @BINPATH@/components/content_base.xpt
 @BINPATH@/components/content_events.xpt
 @BINPATH@/components/content_canvas.xpt
 @BINPATH@/components/content_htmldoc.xpt
 @BINPATH@/components/content_html.xpt
 @BINPATH@/components/content_xslt.xpt
-@BINPATH@/components/content_xtf.xpt
 @BINPATH@/components/cookie.xpt
 @BINPATH@/components/directory.xpt
 @BINPATH@/components/docshell.xpt
 @BINPATH@/components/dom.xpt
 @BINPATH@/components/dom_activities.xpt
 @BINPATH@/components/dom_apps.xpt
 @BINPATH@/components/dom_base.xpt
 #ifdef MOZ_B2G_RIL
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -153,17 +153,16 @@
 @BINPATH@/components/commandlines.xpt
 @BINPATH@/components/composer.xpt
 @BINPATH@/components/content_base.xpt
 @BINPATH@/components/content_events.xpt
 @BINPATH@/components/content_canvas.xpt
 @BINPATH@/components/content_htmldoc.xpt
 @BINPATH@/components/content_html.xpt
 @BINPATH@/components/content_xslt.xpt
-@BINPATH@/components/content_xtf.xpt
 @BINPATH@/components/cookie.xpt
 @BINPATH@/components/directory.xpt
 @BINPATH@/components/docshell.xpt
 @BINPATH@/components/dom.xpt
 @BINPATH@/components/dom_apps.xpt
 @BINPATH@/components/dom_base.xpt
 @BINPATH@/components/dom_system.xpt
 #ifdef MOZ_B2G_RIL
--- a/configure.in
+++ b/configure.in
@@ -4239,17 +4239,16 @@ MOZ_SAFE_BROWSING=
 MOZ_HELP_VIEWER=
 MOZ_SPELLCHECK=1
 MOZ_ANDROID_OMTC=
 MOZ_ONLY_TOUCH_EVENTS=
 MOZ_TOOLKIT_SEARCH=1
 MOZ_UI_LOCALE=en-US
 MOZ_UNIVERSALCHARDET=1
 MOZ_URL_CLASSIFIER=
-MOZ_XTF=1
 MOZ_XUL=1
 MOZ_ZIPWRITER=1
 NS_PRINTING=1
 MOZ_PDF_PRINTING=
 MOZ_DISABLE_DOMCRYPTO=
 NSS_DISABLE_DBM=
 NECKO_WIFI=1
 NECKO_COOKIES=1
@@ -5701,27 +5700,16 @@ dnl ====================================
 dnl NegotiateAuth
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(negotiateauth,
 [  --disable-negotiateauth Disable GSS-API negotiation ],
     MOZ_AUTH_EXTENSION=,
     MOZ_AUTH_EXTENSION=1 )
 
 dnl ========================================================
-dnl XTF
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(xtf,
-[  --disable-xtf           Disable XTF (pluggable xml tags) support],
-    MOZ_XTF=,
-    MOZ_XTF=1 )
-if test "$MOZ_XTF"; then
-  AC_DEFINE(MOZ_XTF)
-fi
-
-dnl ========================================================
 dnl Pref extensions (autoconfig)
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(pref-extensions,
 [  --disable-pref-extensions
                           Disable pref extensions such as autoconfig],
   MOZ_PREF_EXTENSIONS=,
   MOZ_PREF_EXTENSIONS=1 )
 
@@ -6069,22 +6057,16 @@ if test `echo "$MOZ_EXTENSIONS" | grep -
 fi
 AC_SUBST(MOZ_GIO_COMPONENT)
 
 if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
     AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
     MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
 fi
 
-dnl xforms requires xtf
-if test -z "$MOZ_XTF" -a `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
-    AC_MSG_WARN([Cannot build XForms without XTF support.  Removing XForms from MOZ_EXTENSIONS.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
-fi
-
 dnl Remove dupes
 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
 
 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
 dnl when trying to build a nonexistent extension.
 for extension in $MOZ_EXTENSIONS; do
     if test ! -d "${srcdir}/extensions/${extension}"; then
         AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
@@ -8308,17 +8290,16 @@ AC_SUBST(WINDRES)
 AC_SUBST(IMPLIB)
 AC_SUBST(FILTER)
 AC_SUBST(BIN_FLAGS)
 AC_SUBST(MOZ_WIDGET_TOOLKIT)
 AC_SUBST(MOZ_UPDATE_XTERM)
 AC_SUBST(MOZ_PLATFORM_MAEMO)
 AC_SUBST(MOZ_AUTH_EXTENSION)
 AC_SUBST(MOZ_PERMISSIONS)
-AC_SUBST(MOZ_XTF)
 AC_SUBST(MOZ_PREF_EXTENSIONS)
 AC_SUBST(MOZ_JS_LIBS)
 AC_SUBST(MOZ_PSM)
 AC_SUBST(MOZ_DEBUG)
 AC_SUBST(MOZ_DEBUG_SYMBOLS)
 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
 AC_SUBST(MOZ_DEBUG_FLAGS)
--- a/content/Makefile.in
+++ b/content/Makefile.in
@@ -12,17 +12,13 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE		= content
 PARALLEL_DIRS = base canvas events html mathml/content/src smil svg xml xul xbl xslt
 
 ifdef MOZ_MEDIA
 PARALLEL_DIRS	+= media
 endif
 
-ifdef MOZ_XTF
-PARALLEL_DIRS   += xtf
-endif
-
 ifdef ENABLE_TESTS
 TOOL_DIRS += test
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/content/base/public/nsContentCreatorFunctions.h
+++ b/content/base/public/nsContentCreatorFunctions.h
@@ -92,13 +92,9 @@ nsresult
 NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
                  mozilla::dom::FromParser aFromParser);
 
 nsresult
 NS_NewGenConImageContent(nsIContent** aResult,
                          already_AddRefed<nsINodeInfo> aNodeInfo,
                          imgIRequest* aImageRequest);
 
-nsresult
-NS_NewXMLEventsElement(nsIContent** aResult,
-                       already_AddRefed<nsINodeInfo> aNodeInfo);
-
 #endif // nsContentCreatorFunctions_h__
--- a/content/base/public/nsContentUtils.h
+++ b/content/base/public/nsContentUtils.h
@@ -85,19 +85,16 @@ class nsIInterfaceRequestor;
 class nsINodeInfo;
 template<class E> class nsCOMArray;
 template<class K, class V> class nsRefPtrHashtable;
 struct JSRuntime;
 class nsIWidget;
 class nsIDragSession;
 class nsIPresShell;
 class nsIXPConnectJSObjectHolder;
-#ifdef MOZ_XTF
-class nsIXTFService;
-#endif
 #ifdef IBMBIDI
 class nsIBidiKeyboard;
 #endif
 class nsIMIMEHeaderParam;
 class nsIObserver;
 class nsPresContext;
 class nsIChannel;
 class nsAutoScriptBlockerSuppressNodeRemoved;
@@ -453,20 +450,16 @@ public:
     return sNameSpaceManager;
   }
 
   static nsIIOService* GetIOService()
   {
     return sIOService;
   }
 
-#ifdef MOZ_XTF
-  static nsIXTFService* GetXTFService();
-#endif
-
 #ifdef IBMBIDI
   static nsIBidiKeyboard* GetBidiKeyboard();
 #endif
   
   /**
    * Get the cache security manager service. Can return null if the layout
    * module has been shut down.
    */
@@ -2217,20 +2210,16 @@ private:
   static nsIThreadJSContextStack *sThreadJSContextStack;
 
   static nsIParserService *sParserService;
 
   static nsINameSpaceManager *sNameSpaceManager;
 
   static nsIIOService *sIOService;
 
-#ifdef MOZ_XTF
-  static nsIXTFService *sXTFService;
-#endif
-
   static bool sImgLoaderInitialized;
   static void InitImgLoader();
 
   // The following four members are initialized lazily
   static imgILoader* sImgLoader;
   static imgILoader* sPrivateImgLoader;
   static imgICache* sImgCache;
   static imgICache* sPrivateImgCache;
--- a/content/base/public/nsIDocument.h
+++ b/content/base/public/nsIDocument.h
@@ -74,18 +74,18 @@ class ImageLoader;
 
 namespace dom {
 class Link;
 class Element;
 } // namespace dom
 } // namespace mozilla
 
 #define NS_IDOCUMENT_IID \
-{ 0x20d19edb, 0xa74c, 0x4ce4, \
-  { 0xb2, 0x7c, 0x5b, 0xdd, 0x6f, 0xbd, 0x2b, 0x66 } }
+{ 0xd69b94c2, 0x92ed, 0x4baa, \
+  { 0x82, 0x08, 0x56, 0xe4, 0xc4, 0xb3, 0xf3, 0xc8 } }
 
 // Flag for AddStyleSheet().
 #define NS_STYLESHEET_FROM_CATALOG                (1 << 0)
 
 // Enum for requesting a particular type of document when creating a doc
 enum DocumentFlavor {
   DocumentFlavorLegacyGuess, // compat with old code until made HTML5-compliant
   DocumentFlavorHTML, // HTMLDocument with HTMLness bit set to true
@@ -954,18 +954,16 @@ public:
   }
   bool IsXUL() const
   {
     return mIsXUL;
   }
 
   virtual bool IsScriptEnabled() = 0;
 
-  virtual void AddXMLEventsContent(nsIContent * aXMLEventsElement) = 0;
-
   /**
    * Create an element with the specified name, prefix and namespace ID.
    */
   virtual nsresult CreateElem(const nsAString& aName, nsIAtom *aPrefix,
                               int32_t aNamespaceID,
                               nsIContent** aResult) = 0;
 
   /**
--- a/content/base/public/nsINameSpaceManager.h
+++ b/content/base/public/nsINameSpaceManager.h
@@ -23,18 +23,17 @@ static const int32_t kNameSpaceID_None =
 #define kNameSpaceID_XHTML    3
 #define kNameSpaceID_XLink    4
 #define kNameSpaceID_XSLT     5
 #define kNameSpaceID_XBL      6
 #define kNameSpaceID_MathML   7
 #define kNameSpaceID_RDF      8
 #define kNameSpaceID_XUL      9
 #define kNameSpaceID_SVG      10
-#define kNameSpaceID_XMLEvents 11
-#define kNameSpaceID_LastBuiltin          11 // last 'built-in' namespace
+#define kNameSpaceID_LastBuiltin          10 // last 'built-in' namespace
  
 #define NS_NAMESPACEMANAGER_CONTRACTID "@mozilla.org/content/namespacemanager;1"
 
 #define NS_INAMESPACEMANAGER_IID \
   { 0xd74e83e6, 0xf932, 0x4289, \
     { 0xac, 0x95, 0x9e, 0x10, 0x24, 0x30, 0x88, 0xd6 } }
 
 /**
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -1855,20 +1855,16 @@ Element::SetAttrAndNotify(int32_t aNames
   }
 
   UpdateState(aNotify);
 
   if (aNotify) {
     nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, aModType);
   }
 
-  if (aNamespaceID == kNameSpaceID_XMLEvents && 
-      aName == nsGkAtoms::event && mNodeInfo->GetDocument()) {
-    mNodeInfo->GetDocument()->AddXMLEventsContent(this);
-  }
   if (aCallAfterSetAttr) {
     rv = AfterSetAttr(aNamespaceID, aName, &aValueForAfterSetAttr, aNotify);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   if (aFireMutation) {
     nsMutationEvent mutation(true, NS_MUTATION_ATTRMODIFIED);
 
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -63,20 +63,16 @@
 #include "nsILoadGroup.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsContentPolicyUtils.h"
 #include "nsNodeInfoManager.h"
 #include "nsCRT.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMEventTarget.h"
-#ifdef MOZ_XTF
-#include "nsIXTFService.h"
-static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
-#endif
 #include "nsIMIMEService.h"
 #include "nsLWBrkCIID.h"
 #include "nsILineBreaker.h"
 #include "nsIWordBreaker.h"
 #include "nsUnicodeProperties.h"
 #include "harfbuzz/hb.h"
 #include "nsIJSRuntimeService.h"
 #include "nsBindingManager.h"
@@ -190,19 +186,16 @@ const char kLoadAsData[] = "loadAsData";
 
 nsIDOMScriptObjectFactory *nsContentUtils::sDOMScriptObjectFactory = nullptr;
 nsIXPConnect *nsContentUtils::sXPConnect;
 nsIScriptSecurityManager *nsContentUtils::sSecurityManager;
 nsIThreadJSContextStack *nsContentUtils::sThreadJSContextStack;
 nsIParserService *nsContentUtils::sParserService = nullptr;
 nsINameSpaceManager *nsContentUtils::sNameSpaceManager;
 nsIIOService *nsContentUtils::sIOService;
-#ifdef MOZ_XTF
-nsIXTFService *nsContentUtils::sXTFService = nullptr;
-#endif
 imgILoader *nsContentUtils::sImgLoader;
 imgILoader *nsContentUtils::sPrivateImgLoader;
 imgICache *nsContentUtils::sImgCache;
 imgICache *nsContentUtils::sPrivateImgCache;
 nsIConsoleService *nsContentUtils::sConsoleService;
 nsDataHashtable<nsISupportsHashKey, EventNameMapping>* nsContentUtils::sAtomEventTable = nullptr;
 nsDataHashtable<nsStringHashKey, EventNameMapping>* nsContentUtils::sStringEventTable = nullptr;
 nsCOMArray<nsIAtom>* nsContentUtils::sUserDefinedEvents = nullptr;
@@ -950,31 +943,16 @@ nsContentUtils::ParseSandboxAttributeToF
         out &= ~SANDBOXED_POINTER_LOCK;
       }
     }
   }
 
   return out;
 }
 
-#ifdef MOZ_XTF
-nsIXTFService*
-nsContentUtils::GetXTFService()
-{
-  if (!sXTFService) {
-    nsresult rv = CallGetService(kXTFServiceCID, &sXTFService);
-    if (NS_FAILED(rv)) {
-      sXTFService = nullptr;
-    }
-  }
-
-  return sXTFService;
-}
-#endif
-
 #ifdef IBMBIDI
 nsIBidiKeyboard*
 nsContentUtils::GetBidiKeyboard()
 {
   if (!sBidiKeyboard) {
     nsresult rv = CallGetService("@mozilla.org/widget/bidikeyboard;1", &sBidiKeyboard);
     if (NS_FAILED(rv)) {
       sBidiKeyboard = nullptr;
@@ -1468,19 +1446,16 @@ nsContentUtils::Shutdown()
   sXPConnect = nullptr;
   sThreadJSContextStack = nullptr;
   NS_IF_RELEASE(sSecurityManager);
   NS_IF_RELEASE(sNameSpaceManager);
   NS_IF_RELEASE(sParserService);
   NS_IF_RELEASE(sIOService);
   NS_IF_RELEASE(sLineBreaker);
   NS_IF_RELEASE(sWordBreaker);
-#ifdef MOZ_XTF
-  NS_IF_RELEASE(sXTFService);
-#endif
   NS_IF_RELEASE(sImgLoader);
   NS_IF_RELEASE(sPrivateImgLoader);
   NS_IF_RELEASE(sImgCache);
   NS_IF_RELEASE(sPrivateImgCache);
 #ifdef IBMBIDI
   NS_IF_RELEASE(sBidiKeyboard);
 #endif
 
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -85,18 +85,16 @@
 #include "nsIDOMElement.h"
 #include "nsFocusManager.h"
 
 // for radio group stuff
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIRadioVisitor.h"
 #include "nsIFormControl.h"
 
-#include "nsXMLEventsManager.h"
-
 #include "nsBidiUtils.h"
 #include "mozilla/dom/DirectionalityUtils.h"
 
 #include "nsIDOMUserDataHandler.h"
 #include "nsIDOMXPathEvaluator.h"
 #include "nsIXPathEvaluatorInternal.h"
 #include "nsIParserService.h"
 #include "nsContentCreatorFunctions.h"
@@ -1843,26 +1841,16 @@ nsIDocument::GetExtraPropertyTable(uint1
   NS_ASSERTION(aCategory > 0, "Category 0 should have already been handled");
   while (aCategory >= mExtraPropertyTables.Length() + 1) {
     mExtraPropertyTables.AppendElement(new nsPropertyTable());
   }
   return mExtraPropertyTables[aCategory - 1];
 }
 
 void
-nsDocument::AddXMLEventsContent(nsIContent *aXMLEventsElement)
-{
-  if (!mXMLEventsManager) {
-    mXMLEventsManager = new nsXMLEventsManager();
-    AddObserver(mXMLEventsManager);
-  }
-  mXMLEventsManager->AddXMLEventsContent(aXMLEventsElement);
-}
-
-void
 nsDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
 {
   nsCOMPtr<nsIURI> uri;
   nsCOMPtr<nsIPrincipal> principal;
   if (aChannel) {
     // Note: this code is duplicated in nsXULDocument::StartDocumentLoad and
     // nsScriptSecurityManager::GetChannelPrincipal.
     // Note: this should match nsDocShell::OnLoadingSite
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -83,17 +83,16 @@ class nsIOutputStream;
 class nsDocument;
 class nsIDTD;
 class nsIRadioVisitor;
 class nsIFormControl;
 struct nsRadioGroupStruct;
 class nsOnloadBlocker;
 class nsUnblockOnloadEvent;
 class nsChildContentList;
-class nsXMLEventsManager;
 class nsHTMLStyleSheet;
 class nsHTMLCSSStyleSheet;
 class nsDOMNavigationTiming;
 class nsWindowSizes;
 class nsHtml5TreeOpExecutor;
 
 /**
  * Right now our identifier map entries contain information for 'name'
@@ -766,18 +765,16 @@ public:
 
   // nsIInlineEventHandlers
   NS_DECL_NSIINLINEEVENTHANDLERS
 
   // nsIObserver
   NS_DECL_NSIOBSERVER
 
   virtual nsresult Init();
-  
-  virtual void AddXMLEventsContent(nsIContent * aXMLEventsElement);
 
   virtual nsresult CreateElem(const nsAString& aName, nsIAtom *aPrefix,
                               int32_t aNamespaceID,
                               nsIContent **aResult);
 
   nsresult CreateElement(const nsAString& aTagName,
                          nsIContent** aReturn);
   nsresult CreateElementNS(const nsAString& aNamespaceURI,
@@ -1240,17 +1237,16 @@ protected:
 
   uint8_t mXMLDeclarationBits;
 
   nsInterfaceHashtable<nsPtrHashKey<nsIContent>, nsPIBoxObject> *mBoxObjectTable;
 
   // The channel that got passed to StartDocumentLoad(), if any
   nsCOMPtr<nsIChannel> mChannel;
   nsRefPtr<nsHTMLCSSStyleSheet> mStyleAttrStyleSheet;
-  nsRefPtr<nsXMLEventsManager> mXMLEventsManager;
 
   // Our update nesting level
   uint32_t mUpdateNestLevel;
 
   // The application cache that this document is associated with, if
   // any.  This can change during the lifetime of the document.
   nsCOMPtr<nsIApplicationCache> mApplicationCache;
 
--- a/content/base/src/nsNameSpaceManager.cpp
+++ b/content/base/src/nsNameSpaceManager.cpp
@@ -13,37 +13,29 @@
 #include "nsAutoPtr.h"
 #include "nsINodeInfo.h"
 #include "nsCOMArray.h"
 #include "nsTArray.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsDataHashtable.h"
 #include "nsString.h"
 
-#ifdef MOZ_XTF
-#include "nsIServiceManager.h"
-#include "nsIXTFService.h"
-#include "nsContentUtils.h"
-static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
-#endif
-
 using namespace mozilla;
 using namespace mozilla::dom;
 
 #define kXMLNSNameSpaceURI "http://www.w3.org/2000/xmlns/"
 #define kXMLNameSpaceURI "http://www.w3.org/XML/1998/namespace"
 #define kXHTMLNameSpaceURI "http://www.w3.org/1999/xhtml"
 #define kXLinkNameSpaceURI "http://www.w3.org/1999/xlink"
 #define kXSLTNameSpaceURI "http://www.w3.org/1999/XSL/Transform"
 #define kXBLNameSpaceURI "http://www.mozilla.org/xbl"
 #define kMathMLNameSpaceURI "http://www.w3.org/1998/Math/MathML"
 #define kRDFNameSpaceURI "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 #define kXULNameSpaceURI "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
 #define kSVGNameSpaceURI "http://www.w3.org/2000/svg"
-#define kXMLEventsNameSpaceURI "http://www.w3.org/2001/xml-events"
 
 class nsNameSpaceKey : public PLDHashEntryHdr
 {
 public:
   typedef const nsAString* KeyType;
   typedef const nsAString* KeyTypePointer;
 
   nsNameSpaceKey(KeyTypePointer aKey) : mKey(aKey)
@@ -121,17 +113,16 @@ nsresult NameSpaceManagerImpl::Init()
   REGISTER_NAMESPACE(kXHTMLNameSpaceURI, kNameSpaceID_XHTML);
   REGISTER_NAMESPACE(kXLinkNameSpaceURI, kNameSpaceID_XLink);
   REGISTER_NAMESPACE(kXSLTNameSpaceURI, kNameSpaceID_XSLT);
   REGISTER_NAMESPACE(kXBLNameSpaceURI, kNameSpaceID_XBL);
   REGISTER_NAMESPACE(kMathMLNameSpaceURI, kNameSpaceID_MathML);
   REGISTER_NAMESPACE(kRDFNameSpaceURI, kNameSpaceID_RDF);
   REGISTER_NAMESPACE(kXULNameSpaceURI, kNameSpaceID_XUL);
   REGISTER_NAMESPACE(kSVGNameSpaceURI, kNameSpaceID_SVG);
-  REGISTER_NAMESPACE(kXMLEventsNameSpaceURI, kNameSpaceID_XMLEvents);
 
 #undef REGISTER_NAMESPACE
 
   return NS_OK;
 }
 
 nsresult
 NameSpaceManagerImpl::RegisterNameSpace(const nsAString& aURI, 
@@ -206,41 +197,28 @@ NS_NewElement(nsIContent** aResult,
   }
 #endif
   if (ns == kNameSpaceID_MathML) {
     return NS_NewMathMLElement(aResult, aNodeInfo);
   }
   if (ns == kNameSpaceID_SVG) {
     return NS_NewSVGElement(aResult, aNodeInfo, aFromParser);
   }
-  if (ns == kNameSpaceID_XMLEvents) {
-    return NS_NewXMLEventsElement(aResult, aNodeInfo);
-  }
-#ifdef MOZ_XTF
-  if (ns > kNameSpaceID_LastBuiltin) {
-    nsIXTFService* xtfService = nsContentUtils::GetXTFService();
-    NS_ASSERTION(xtfService, "could not get xtf service");
-    if (xtfService &&
-        NS_SUCCEEDED(xtfService->CreateElement(aResult, aNodeInfo)))
-      return NS_OK;
-  }
-#endif
   return NS_NewXMLElement(aResult, aNodeInfo);
 }
 
 bool
 NameSpaceManagerImpl::HasElementCreator(int32_t aNameSpaceID)
 {
   return aNameSpaceID == kNameSpaceID_XHTML ||
 #ifdef MOZ_XUL
          aNameSpaceID == kNameSpaceID_XUL ||
 #endif
          aNameSpaceID == kNameSpaceID_MathML ||
          aNameSpaceID == kNameSpaceID_SVG ||
-         aNameSpaceID == kNameSpaceID_XMLEvents ||
          false;
 }
 
 nsresult NameSpaceManagerImpl::AddNameSpace(const nsAString& aURI,
                                             const int32_t aNameSpaceID)
 {
   if (aNameSpaceID < 0) {
     // We've wrapped...  Can't do anything else here; just bail.
--- a/content/events/src/Makefile.in
+++ b/content/events/src/Makefile.in
@@ -38,18 +38,16 @@ CPPSRCS		= \
 		nsDOMMutationEvent.cpp \
 		nsDOMDeviceMotionEvent.cpp \
 		nsDOMBeforeUnloadEvent.cpp \
 		nsDOMXULCommandEvent.cpp \
 		nsDOMCommandEvent.cpp \
 		nsDOMMessageEvent.cpp \
 		nsPaintRequest.cpp \
 		nsPrivateTextRange.cpp \
-		nsXMLEventsManager.cpp \
-		nsXMLEventsElement.cpp \
 		nsAsyncDOMEvent.cpp \
 		nsEventDispatcher.cpp \
 		nsIMEStateManager.cpp \
 		nsContentEventHandler.cpp \
 		nsEventListenerService.cpp \
 		nsDOMDataTransfer.cpp \
 		nsDOMNotifyPaintEvent.cpp \
 		nsDOMNotifyAudioAvailableEvent.cpp \
deleted file mode 100644
--- a/content/events/src/nsXMLEventsElement.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsXMLElement.h"
-#include "nsGkAtoms.h"
-#include "nsIDocument.h"
-
-class nsXMLEventsElement : public nsXMLElement {
-public:
-  nsXMLEventsElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  virtual ~nsXMLEventsElement();
-
-  virtual nsIAtom *GetIDAttributeName() const;
-  virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, 
-                           nsIAtom* aPrefix, const nsAString& aValue,
-                           bool aNotify);
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-};
-
-nsXMLEventsElement::nsXMLEventsElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsXMLElement(aNodeInfo)
-{
-}
-
-nsXMLEventsElement::~nsXMLEventsElement()
-{
-}
-
-nsIAtom *
-nsXMLEventsElement::GetIDAttributeName() const
-{
-  if (mNodeInfo->Equals(nsGkAtoms::listener))
-    return nsGkAtoms::id;
-  return nsXMLElement::GetIDAttributeName();
-}
-
-nsresult
-nsXMLEventsElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
-                            const nsAString& aValue, bool aNotify)
-{
-  if (mNodeInfo->Equals(nsGkAtoms::listener) && 
-      mNodeInfo->GetDocument() && aNameSpaceID == kNameSpaceID_None && 
-      aName == nsGkAtoms::event)
-    mNodeInfo->GetDocument()->AddXMLEventsContent(this);
-  return nsXMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
-                                   aNotify);
-}
-
-NS_IMPL_ELEMENT_CLONE(nsXMLEventsElement)
-
-nsresult
-NS_NewXMLEventsElement(nsIContent** aInstancePtrResult,
-                       already_AddRefed<nsINodeInfo> aNodeInfo)
-{
-  nsXMLEventsElement* it = new nsXMLEventsElement(aNodeInfo);
-  if (!it) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-  NS_ADDREF(*aInstancePtrResult = it);
-  return NS_OK;
-}
-
deleted file mode 100644
--- a/content/events/src/nsXMLEventsManager.cpp
+++ /dev/null
@@ -1,389 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIDOMMutationEvent.h"
-#include "nsXMLEventsManager.h"
-#include "nsGkAtoms.h"
-#include "nsIDOMElement.h"
-#include "nsIDOMEventTarget.h"
-#include "nsNetUtil.h"
-#include "nsIURL.h"
-#include "nsIDOMEventListener.h"
-#include "nsINameSpaceManager.h"
-#include "nsINodeInfo.h"
-#include "mozilla/dom/Element.h"
-
-using namespace mozilla::dom;
-
-bool nsXMLEventsListener::InitXMLEventsListener(nsIDocument * aDocument,
-                                                  nsXMLEventsManager * aManager,
-                                                  nsIContent * aContent)
-{
-  nsresult rv;
-  int32_t nameSpaceID;
-  if (aContent->GetDocument() != aDocument)
-    return false;
-  if (aContent->NodeInfo()->Equals(nsGkAtoms::listener,
-                                   kNameSpaceID_XMLEvents))
-    nameSpaceID = kNameSpaceID_None;
-  else
-    nameSpaceID = kNameSpaceID_XMLEvents;
-  nsAutoString eventType;
-  aContent->GetAttr(nameSpaceID, nsGkAtoms::event, eventType);
-  if (eventType.IsEmpty())
-    return false;
-  nsAutoString handlerURIStr;
-  bool hasHandlerURI = false;
-  nsIContent *handler = nullptr;
-  nsAutoString observerID;
-  nsAutoString targetIdref;
-  
-  if (aContent->GetAttr(nameSpaceID, nsGkAtoms::handler, handlerURIStr)) {
-    hasHandlerURI = true;
-    nsAutoCString handlerRef;
-    nsCOMPtr<nsIURI> handlerURI;
-    bool equals = false;
-    nsIURI *docURI = aDocument->GetDocumentURI();
-    nsIURI *baseURI = aDocument->GetDocBaseURI();
-    rv = NS_NewURI( getter_AddRefs(handlerURI), handlerURIStr, nullptr, baseURI);
-    if (NS_SUCCEEDED(rv)) {
-      handlerURI->GetRef(handlerRef);
-      // We support only XML Events Basic.
-      rv = docURI->EqualsExceptRef(handlerURI, &equals);
-      if (NS_SUCCEEDED(rv) && equals) {
-        handler = aDocument->GetElementById(NS_ConvertUTF8toUTF16(handlerRef));
-      }
-    }
-  }
-  else
-    handler = aContent;
-  if (!handler)
-    return false;
-
-  aContent->GetAttr(nameSpaceID, nsGkAtoms::target, targetIdref);
-
-  bool hasObserver = 
-    aContent->GetAttr(nameSpaceID, nsGkAtoms::observer, observerID);
-
-  bool capture =
-    aContent->AttrValueIs(nameSpaceID, nsGkAtoms::phase,
-                          nsGkAtoms::capture, eCaseMatters);
-
-  bool stopPropagation = 
-    aContent->AttrValueIs(nameSpaceID, nsGkAtoms::propagate,
-                          nsGkAtoms::stop, eCaseMatters);
-
-  bool cancelDefault = 
-    aContent->AttrValueIs(nameSpaceID, nsGkAtoms::defaultAction,
-                          nsGkAtoms::cancel, eCaseMatters);
-
-  nsIContent *observer = nullptr;
-  if (!hasObserver) {
-    if (!hasHandlerURI) //Parent should be the observer
-      observer = aContent->GetParent();
-    else //We have the handler, so this is the observer
-      observer = aContent;
-  }
-  else if (!observerID.IsEmpty()) {
-    observer = aDocument->GetElementById(observerID);
-  }
-  nsCOMPtr<nsIDOMEventTarget> eventObserver(do_QueryInterface(observer));
-  if (eventObserver) {
-    nsXMLEventsListener * eli = new nsXMLEventsListener(aManager,
-                                                        aContent,
-                                                        observer,
-                                                        handler,
-                                                        eventType,
-                                                        capture,
-                                                        stopPropagation,
-                                                        cancelDefault,
-                                                        targetIdref);
-    if (eli) {
-      nsresult rv = eventObserver->AddEventListener(eventType, eli, capture);
-      if (NS_SUCCEEDED(rv)) {
-        aManager->RemoveXMLEventsContent(aContent);
-        aManager->RemoveListener(aContent);
-        aManager->AddListener(aContent, eli);
-        return true;
-      }
-      else
-        delete eli;
-    }
-  }
-  return false;
-}
-
-nsXMLEventsListener::nsXMLEventsListener(nsXMLEventsManager * aManager,
-                                         nsIContent * aElement,
-                                         nsIContent * aObserver,
-                                         nsIContent * aHandler,
-                                         const nsAString& aEvent,
-                                         bool aPhase,
-                                         bool aStopPropagation,
-                                         bool aCancelDefault,
-                                         const nsAString& aTarget)
- : mManager(aManager),
-   mElement(aElement),
-   mObserver(aObserver),
-   mHandler(aHandler),
-   mEvent(aEvent),
-   mPhase(aPhase),
-   mStopPropagation(aStopPropagation),
-   mCancelDefault(aCancelDefault)
-{
-  if (!aTarget.IsEmpty())
-    mTarget = do_GetAtom(aTarget);
-}
-
-nsXMLEventsListener::~nsXMLEventsListener()
-{
-}
-
-void nsXMLEventsListener::Unregister()
-{
-  nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(mObserver);
-  if (target) {
-    target->RemoveEventListener(mEvent, this, mPhase);
-  }
-  mObserver = nullptr;
-  mHandler = nullptr;
-}
-
-void nsXMLEventsListener::SetIncomplete()
-{
-  Unregister();
-  mManager->AddXMLEventsContent(mElement);
-  mElement = nullptr;
-}
-
-bool nsXMLEventsListener::ObserverEquals(nsIContent * aTarget)
-{
-  return aTarget == mObserver;
-}
-
-bool nsXMLEventsListener::HandlerEquals(nsIContent * aTarget)
-{
-  return aTarget == mHandler;
-}
-
-NS_IMPL_ISUPPORTS1(nsXMLEventsListener, nsIDOMEventListener)
-NS_IMETHODIMP
-nsXMLEventsListener::HandleEvent(nsIDOMEvent* aEvent)
-{
-  if (!aEvent) 
-    return NS_ERROR_INVALID_ARG;
-  bool targetMatched = true;
-  nsCOMPtr<nsIDOMEvent> event(aEvent);
-  if (mTarget) {
-    targetMatched = false;
-    nsCOMPtr<nsIDOMEventTarget> target;
-    aEvent->GetTarget(getter_AddRefs(target));
-    nsCOMPtr<nsIContent> targetEl(do_QueryInterface(target));
-    if (targetEl && targetEl->GetID() == mTarget) 
-        targetMatched = true;
-  }
-  if (!targetMatched)
-    return NS_OK;
-  nsCOMPtr<nsIDOMEventListener> handler(do_QueryInterface(mHandler));
-  if (handler) {
-    nsresult rv = handler->HandleEvent(event);
-    if (NS_SUCCEEDED(rv)) {
-      if (mStopPropagation)
-        event->StopPropagation();
-      if (mCancelDefault)
-        event->PreventDefault();
-    }
-    return rv;
-  }
-  return NS_OK;
-}
-
-
-//XMLEventsManager / DocumentObserver
-
-static PLDHashOperator EnumAndUnregisterListener(nsISupports * aContent,
-                                                 nsCOMPtr<nsXMLEventsListener> & aListener,
-                                                 void * aData)
-{
-  if (aListener)
-    aListener->Unregister();
-  return PL_DHASH_NEXT;
-}
-
-static PLDHashOperator EnumAndSetIncomplete(nsISupports * aContent,
-                                            nsCOMPtr<nsXMLEventsListener> & aListener,
-                                            void * aData)
-{
-  if (aListener && aData) {
-    nsCOMPtr<nsIContent> content = static_cast<nsIContent *>(aData);
-    if (content) { 
-      if (aListener->ObserverEquals(content) || aListener->HandlerEquals(content)) {
-        aListener->SetIncomplete();
-        return PL_DHASH_REMOVE;
-      }
-    }
-  }
-  return PL_DHASH_NEXT;
-}
-
-nsXMLEventsManager::nsXMLEventsManager()
-{
-  mListeners.Init();
-}
-nsXMLEventsManager::~nsXMLEventsManager()
-{
-}
-
-NS_IMPL_ISUPPORTS2(nsXMLEventsManager, nsIDocumentObserver, nsIMutationObserver)
-
-void nsXMLEventsManager::AddXMLEventsContent(nsIContent * aContent)
-{
-  mIncomplete.RemoveObject(aContent);
-  mIncomplete.AppendObject(aContent);
-}
-
-void nsXMLEventsManager::RemoveXMLEventsContent(nsIContent * aContent)
-{
-  mIncomplete.RemoveObject(aContent);
-}
-
-void nsXMLEventsManager::AddListener(nsIContent * aContent, 
-                                     nsXMLEventsListener * aListener)
-{
-  mListeners.Put(aContent, aListener);
-}
-
-bool nsXMLEventsManager::RemoveListener(nsIContent * aContent)
-{
-  nsCOMPtr<nsXMLEventsListener> listener;
-  mListeners.Get(aContent, getter_AddRefs(listener));
-  if (listener) {
-    listener->Unregister();
-    mListeners.Remove(aContent);
-    return true;
-  }
-  return false;
-}
-
-void nsXMLEventsManager::AddListeners(nsIDocument* aDocument)
-{
-  nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
-
-  nsIContent *cur;
-  for (int i = 0; i < mIncomplete.Count(); ++i) {
-    cur = mIncomplete[i];
-    //If this succeeds, the object will be removed from mIncomplete
-    if (nsXMLEventsListener::InitXMLEventsListener(aDocument, this, cur))
-      --i;
-  }
-}
-
-void 
-nsXMLEventsManager::NodeWillBeDestroyed(const nsINode* aNode)
-{
-  nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
-  mIncomplete.Clear();
-  mListeners.Enumerate(EnumAndUnregisterListener, this);
-  mListeners.Clear();
-}
-
-void 
-nsXMLEventsManager::EndLoad(nsIDocument* aDocument)
-{
-  AddListeners(aDocument);
-}
-
-void
-nsXMLEventsManager::AttributeChanged(nsIDocument* aDocument,
-                                     Element* aElement,
-                                     int32_t aNameSpaceID,
-                                     nsIAtom* aAttribute,
-                                     int32_t aModType)
-{
-  nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
-
-  if (aNameSpaceID == kNameSpaceID_XMLEvents &&
-      (aAttribute == nsGkAtoms::event ||
-       aAttribute == nsGkAtoms::handler ||
-       aAttribute == nsGkAtoms::target ||
-       aAttribute == nsGkAtoms::observer ||
-       aAttribute == nsGkAtoms::phase ||
-       aAttribute == nsGkAtoms::propagate)) {
-    RemoveListener(aElement);
-    AddXMLEventsContent(aElement);
-    nsXMLEventsListener::InitXMLEventsListener(aDocument, this, aElement);
-  }
-  else {
-    if (aElement->NodeInfo()->Equals(nsGkAtoms::listener,
-                                     kNameSpaceID_XMLEvents)) {
-      RemoveListener(aElement);
-      AddXMLEventsContent(aElement);
-      nsXMLEventsListener::InitXMLEventsListener(aDocument, this, aElement);
-    }
-    else if (aElement->GetIDAttributeName() == aAttribute) {
-      if (aModType == nsIDOMMutationEvent::REMOVAL)
-        mListeners.Enumerate(EnumAndSetIncomplete, aElement);
-      else if (aModType == nsIDOMMutationEvent::MODIFICATION) {
-        //Remove possible listener
-        mListeners.Enumerate(EnumAndSetIncomplete, aElement);
-        //Add new listeners
-        AddListeners(aDocument);
-      }
-      else {
-        //If we are adding the ID attribute, we must check whether we can 
-        //add new listeners
-        AddListeners(aDocument);
-      }
-    }
-  }
-}
-
-void
-nsXMLEventsManager::ContentAppended(nsIDocument* aDocument,
-                                    nsIContent* aContainer,
-                                    nsIContent* aFirstNewContent,
-                                    int32_t aNewIndexInContainer)
-{
-  AddListeners(aDocument);
-}
-
-void
-nsXMLEventsManager::ContentInserted(nsIDocument* aDocument,
-                                    nsIContent* aContainer,
-                                    nsIContent* aChild,
-                                    int32_t aIndexInContainer)
-{
-  AddListeners(aDocument);
-}
-
-void
-nsXMLEventsManager::ContentRemoved(nsIDocument* aDocument,
-                                   nsIContent* aContainer,
-                                   nsIContent* aChild,
-                                   int32_t aIndexInContainer,
-                                   nsIContent* aPreviousSibling)
-{
-  if (!aChild || !aChild->IsElement())
-    return;
-  //Note, we can't use IDs here, the observer may not always have an ID.
-  //And to remember: the same observer can be referenced by many 
-  //XMLEventsListeners
-
-  nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
-
-  //If the content was an XML Events observer or handler
-  mListeners.Enumerate(EnumAndSetIncomplete, aChild);
-
-  //If the content was an XML Events attributes container
-  if (RemoveListener(aChild)) {
-    //for aContainer.appendChild(aContainer.removeChild(aChild));
-    AddXMLEventsContent(aChild);
-  }
-
-  uint32_t count = aChild->GetChildCount();
-  for (uint32_t i = 0; i < count; ++i) {
-    ContentRemoved(aDocument, aChild, aChild->GetChildAt(i), i, aChild->GetPreviousSibling());
-  }
-}
deleted file mode 100644
--- a/content/events/src/nsXMLEventsManager.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsXMLEventsManager_h___
-#define nsXMLEventsManager_h___
-
-#include "nsCOMPtr.h"
-#include "nsIDocument.h"
-#include "nsIContent.h"
-#include "nsCOMArray.h"
-#include "nsIDOMEventListener.h"
-#include "nsInterfaceHashtable.h"
-#include "nsIAtom.h"
-#include "nsStubDocumentObserver.h"
-#include "mozilla/Attributes.h"
-
-/*
- * The implementation of the XML Events Basic profile
- */
-
-class nsXMLEventsManager;
-class nsXMLEventsListener MOZ_FINAL : public nsIDOMEventListener {
-public:
-  static bool InitXMLEventsListener(nsIDocument * aDocument, 
-                                      nsXMLEventsManager * aManager, 
-                                      nsIContent * aContent);
-  nsXMLEventsListener(nsXMLEventsManager * aManager,
-                      nsIContent * aElement,
-                      nsIContent* aObserver,
-                      nsIContent * aHandler,
-                      const nsAString& aEvent,
-                      bool aPhase,
-                      bool aStopPropagation,
-                      bool aCancelDefault,
-                      const nsAString& aTarget);
-  ~nsXMLEventsListener();
-  void Unregister();
-  //Removes this event listener from observer and adds the element back to the
-  //list of incomplete XML Events declarations in XMLEventsManager
-  void SetIncomplete();
-  bool ObserverEquals(nsIContent * aTarget);
-  bool HandlerEquals(nsIContent * aTarget);
-  
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMEVENTLISTENER
-private:
-  nsXMLEventsManager * mManager;
-  nsCOMPtr<nsIContent> mElement;
-  nsCOMPtr<nsIContent> mObserver;
-  nsCOMPtr<nsIContent> mHandler;
-  nsString mEvent;
-  nsCOMPtr<nsIAtom> mTarget;
-  bool mPhase;
-  bool mStopPropagation;
-  bool mCancelDefault;
-  
-};
-
-class nsXMLEventsManager MOZ_FINAL : public nsStubDocumentObserver {
-public:
-  nsXMLEventsManager();
-  ~nsXMLEventsManager();
-  NS_DECL_ISUPPORTS
-
-  // nsIDocumentObserver
-  NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD
-
-  // nsIMutationObserver
-  NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
-  NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
-  NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
-  NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
-  NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
-
-  void AddXMLEventsContent(nsIContent * aContent);
-  void RemoveXMLEventsContent(nsIContent * aContent);
-  void AddListener(nsIContent * aContent, nsXMLEventsListener * aListener);
-  //Returns true if a listener was removed.
-  bool RemoveListener(nsIContent * aXMLElement);
-private:
-  void AddListeners(nsIDocument* aDocument);
-  nsInterfaceHashtable<nsISupportsHashKey,nsXMLEventsListener> mListeners;
-  nsCOMArray<nsIContent> mIncomplete;
-};
-
-#endif /* nsXMLEventsManager_h___ */
--- a/content/xml/document/src/nsXMLContentSink.cpp
+++ b/content/xml/document/src/nsXMLContentSink.cpp
@@ -529,19 +529,16 @@ nsXMLContentSink::CloseElement(nsIConten
        (nodeInfo->NameAtom() == nsGkAtoms::select ||
         nodeInfo->NameAtom() == nsGkAtoms::textarea ||
 #ifdef MOZ_MEDIA
         nodeInfo->NameAtom() == nsGkAtoms::video ||
         nodeInfo->NameAtom() == nsGkAtoms::audio ||
 #endif
         nodeInfo->NameAtom() == nsGkAtoms::object ||
         nodeInfo->NameAtom() == nsGkAtoms::applet))
-#ifdef MOZ_XTF
-      || nodeInfo->NamespaceID() > kNameSpaceID_LastBuiltin
-#endif
       || nodeInfo->NameAtom() == nsGkAtoms::title
       ) {
     aContent->DoneAddingChildren(HaveNotifiedForCurrentContent());
   }
   
   if (IsMonolithicContainer(nodeInfo)) {
     mInMonolithicContainer--;
   }
@@ -1011,21 +1008,16 @@ nsXMLContentSink::HandleStartElement(con
   // of the id attribute is known.
   if (aIndex != -1 && NS_SUCCEEDED(result)) {
     nsCOMPtr<nsIAtom> IDAttr = do_GetAtom(aAtts[aIndex]);
 
     if (IDAttr) {
       nodeInfo->SetIDAttributeAtom(IDAttr);
     }
   }
-  
-#ifdef MOZ_XTF
-  if (nameSpaceID > kNameSpaceID_LastBuiltin)
-    content->BeginAddingChildren();
-#endif
 
   // Set the attributes on the new content element
   result = AddAttributes(aAtts, content);
 
   if (NS_OK == result) {
     // Store the element 
     if (!SetDocElement(nameSpaceID, localName, content) && appendContent) {
       NS_ENSURE_TRUE(parent, NS_ERROR_UNEXPECTED);
deleted file mode 100644
--- a/content/xtf/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-PARALLEL_DIRS	=  public src
-
-TEST_DIRS += test
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/content/xtf/public/Makefile.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= content
-XPIDL_MODULE    = content_xtf
-
-XPIDLSRCS = \
-	nsIXMLContentBuilder.idl \
-	nsIXTFAttributeHandler.idl \
-	nsIXTFElement.idl \
-	nsIXTFElementFactory.idl \
-	nsIXTFElementWrapper.idl \
-	nsIXTFPrivate.idl \
-	$(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/content/xtf/public/nsIXMLContentBuilder.idl
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIDOMElement;
-interface nsIDOMDocument;
-
-[scriptable, uuid(e9c4cd4f-cd41-43d0-bf3b-48abb9cde90f)]
-interface nsIXMLContentBuilder : nsISupports
-{
-  // (Re-)Initialize this builder. Set 'root' as the new root and
-  // current element. If 'root' is null, the first element built (with
-  // 'beginElement()') will become the new root. Also resets the
-  // element namespace.
-  void clear(in nsIDOMElement root);
-
-  // Set the document which will be used by 'beginElement()' to create
-  // elements. If null, the builder will create a new XML document
-  // internally.
-  void setDocument(in nsIDOMDocument doc);
-  
-  // Set the namespace for all elements built subsequently
-  void setElementNamespace(in AString ns);
-
-  // Create an element. The element will become the 'current' element,
-  // i.e. the target for attributes (via 'attrib()') or child content
-  // (via subsequent begin/endElement()-calls), until it is 'closed'
-  // with a call to 'endElement()'.
-  void beginElement(in AString tagname);
-  void endElement();
-
-  // Set an attribute on the current element
-  void attrib(in AString name, in AString value);
-
-  // Create a textNode
-  void textNode(in AString text);
-  
-  readonly attribute nsIDOMElement root;
-  readonly attribute nsIDOMElement current;
-};
-
-%{C++
-
-// {E09AF32D-2A54-4D76-9EF0-3070E83F8BE7}
-#define NS_XMLCONTENTBUILDER_CID \
-{ 0xe09af32d, 0x2a54, 0x4d76, { 0x9e, 0xf0, 0x30, 0x70, 0xe8, 0x3f, 0x8b, 0xe7 } }
-    
-#define NS_XMLCONTENTBUILDER_CONTRACTID "@mozilla.org/xtf/xml-contentbuilder;1"
-
-nsresult NS_NewXMLContentBuilder(nsIXMLContentBuilder** aResult);
-
-%}
-
deleted file mode 100644
--- a/content/xtf/public/nsIXTFAttributeHandler.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-interface nsIAtom;
-
-[scriptable, uuid(72152f7f-7e8d-43fd-8477-3f29ae8d240d)]
-interface nsIXTFAttributeHandler : nsISupports
-{
-  // If 'false' the given attribute will be handled by the wrapper.
-  // Namespaced attributes will always be handled by the wrapper. The
-  // set of attributes handled by the attribute handler should remain
-  // constant for its complete lifetime.
-  boolean handlesAttribute(in nsIAtom name);
-  
-  void setAttribute(in nsIAtom name, in AString newValue);
-  
-  void removeAttribute(in nsIAtom name);
-
-  // If the attribute 'name' is unknown the implementation should mark
-  // the returned string as being 'null' (i.e. return 'null' in JS;
-  // call SetIsVoid(PR_TRUE) in C++) rather than throw an exception.
-  // A 'void' result will be translated into the attribute missing
-  // by the wrapper. An empty result will be translated into
-  // the attribute having no value.
-  AString getAttribute(in nsIAtom name);
-  
-  boolean hasAttribute(in nsIAtom name);
-  
-  unsigned long getAttributeCount();
-
-  // note that this method should return an *atom* not a string.
-  nsIAtom getAttributeNameAt(in unsigned long index);
-};
deleted file mode 100644
--- a/content/xtf/public/nsIXTFElement.idl
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-interface nsIAtom;
-interface nsIDOMDocument;
-interface nsIDOMElement;
-interface nsIDOMNode;
-interface nsIDOMAttr;
-interface nsIDOMEvent;
-interface nsIXTFElementWrapper;
-
-[scriptable, uuid(4f144387-796d-4baf-8641-5db45dba1808)]
-interface nsIXTFElement : nsISupports
-{
-  // onCreated will be called before any notifications are sent to
-  // the xtf element.
-  //
-  // @param wrapper is a weak proxy to the wrapping element
-  // (i.e. holding a reference to this will not create a cycle).
-  void onCreated(in nsIXTFElementWrapper wrapper);
-
-  // called when the wrapper object is being destroyed.
-  void onDestroyed();
-
-  // If isAttributeHandler is set to 'true', the xtf element indicates
-  // that it wants to manage its own attributes. In this case it needs
-  // to implement the nsIXTFAttributeHandler interface in addition to
-  // its other interfaces. 'isAttributeHandler' must remain constant
-  // for the entire lifetime of the xtf element (i.e. before any
-  // onCreated()-calls until after onDestroyed()-calls).
-  readonly attribute boolean isAttributeHandler;
-  
-  // getScriptingInterfaces: This array serves 2 purposes: a) All
-  // interfaces in this array will automatically be accessible when
-  // our wrapper element is used from JS (other interfaces need to be
-  // explicitly QI'ed for), and b) All these interfaces are callable
-  // from unpriviliged script.
-  // @note 'Normal' DOM interfaces are always automatically scriptable.
-  void getScriptingInterfaces(out unsigned long count,
-                              [array, size_is(count), retval] out nsIIDPtr array);
-
-  // Notification mask constants:
-  // To receive a given event set the corresponding bit in
-  // nsIXTFElementWrapper::notificationMask.
-  const unsigned long NOTIFY_WILL_CHANGE_DOCUMENT  = 0x00000001;
-  const unsigned long NOTIFY_DOCUMENT_CHANGED      = 0x00000002;
-  
-  const unsigned long NOTIFY_WILL_CHANGE_PARENT    = 0x00000004;
-  const unsigned long NOTIFY_PARENT_CHANGED        = 0x00000008;
-  
-  const unsigned long NOTIFY_WILL_INSERT_CHILD     = 0x00000010;
-  const unsigned long NOTIFY_CHILD_INSERTED        = 0x00000020;
-  
-  const unsigned long NOTIFY_WILL_APPEND_CHILD     = 0x00000040;
-  const unsigned long NOTIFY_CHILD_APPENDED        = 0x00000080;
-  
-  const unsigned long NOTIFY_WILL_REMOVE_CHILD     = 0x00000100;
-  const unsigned long NOTIFY_CHILD_REMOVED         = 0x00000200;
-  
-  const unsigned long NOTIFY_WILL_SET_ATTRIBUTE    = 0x00000400;
-  const unsigned long NOTIFY_ATTRIBUTE_SET         = 0x00000800;
-  
-  const unsigned long NOTIFY_WILL_REMOVE_ATTRIBUTE = 0x00001000;
-  const unsigned long NOTIFY_ATTRIBUTE_REMOVED     = 0x00002000;
-  
-  const unsigned long NOTIFY_BEGIN_ADDING_CHILDREN = 0x00004000;
-  const unsigned long NOTIFY_DONE_ADDING_CHILDREN  = 0x00008000;
-  
-  const unsigned long NOTIFY_HANDLE_DEFAULT        = 0x00010000;
-
-  const unsigned long NOTIFY_PERFORM_ACCESSKEY     = 0x00020000;
-
-  // Event notifications:
-
-  void willChangeDocument(in nsIDOMDocument newDoc);
-  void documentChanged(in nsIDOMDocument newDoc);
-  
-  void willChangeParent(in nsIDOMElement newParent);
-  void parentChanged(in nsIDOMElement newParent);
-
-  void willInsertChild(in nsIDOMNode child, in unsigned long index);
-  void childInserted(in nsIDOMNode child, in unsigned long index);
-
-  void willAppendChild(in nsIDOMNode child);
-  void childAppended(in nsIDOMNode child);
-
-  void willRemoveChild(in unsigned long index);
-  void childRemoved(in unsigned long index);
-
-  void willSetAttribute(in nsIAtom name, in AString newValue);
-  void attributeSet(in nsIAtom name, in AString newValue);
-
-  void willRemoveAttribute(in nsIAtom name);
-  void attributeRemoved(in nsIAtom name);
-
-  // These are for batching of child insertions during document load
-
-  // beginAddingChildren is called before any attributes or child nodes are
-  // added to the element.
-  void beginAddingChildren();
-  void doneAddingChildren();
-
-  // The default handler for DOM Events.
-  // This method is called after the normal DOM event flow.
-  // If the return value is true, the event is marked as handled and
-  // other default handlers won't be able to handle it again.
-  boolean handleDefault(in nsIDOMEvent aEvent);
-
-  // Set this element to be equivalent to |aElement|.  This does not need
-  // to worry about copying attributes or child nodes, but should copy any
-  // other needed state.
-  void cloneState(in nsIDOMElement aElement);
-
-  /**
-   * Returns accesskey attribute node.
-   */
-  readonly attribute nsIDOMAttr accesskeyNode;
-
-  /**
-   * Performs accesskey. The method is called when accesskey is activated.
-   */
-  void performAccesskey();
-};
-
deleted file mode 100644
--- a/content/xtf/public/nsIXTFElementFactory.idl
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIXTFElement;
-
-[scriptable, uuid(27c10dca-2efc-416b-ae36-9794380a661e)]
-interface nsIXTFElementFactory : nsISupports
-{
-  nsIXTFElement createElement(in AString tagName);
-};
-
-%{C++
-    
-#define NS_XTF_ELEMENT_FACTORY_CONTRACTID         "@mozilla.org/xtf/element-factory;1"
-#define NS_XTF_ELEMENT_FACTORY_CONTRACTID_PREFIX  NS_XTF_ELEMENT_FACTORY_CONTRACTID "?namespace="
-
-%}
deleted file mode 100644
--- a/content/xtf/public/nsIXTFElementWrapper.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIAtom;
-interface nsIDOMElement;
-interface nsIDOMDocument;
-
-[scriptable, uuid(3697f9ed-d8bc-4c00-890f-7a702d5b4005)]
-interface nsIXTFElementWrapper : nsISupports
-{  
-  readonly attribute nsIDOMElement elementNode;
-  readonly attribute nsIDOMElement documentFrameElement;
-  
-  /**
-   * Events can be unmasked by setting the corresponding bit as given
-   * by the NOTIFY_* constants in nsIXTFElement:
-   */
-  attribute unsigned long notificationMask;
-
-  /**
-   * Sets the intrinsic state for the element.
-   * @see nsIContent::IntrinsicState().
-   */
-  void setIntrinsicState(in unsigned long long newState);
-
-  /**
-   * This sets the name of the class attribute.
-   * Should be called only during ::onCreated.
-   * Note! nsIXTFAttributeHandler can't be used to handle class attribute.
-   */
-  void setClassAttributeName(in nsIAtom name);
-};
-
deleted file mode 100644
--- a/content/xtf/public/nsIXTFPrivate.idl
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-/*
- * This interface can be used to give access to a private 'inner'
- * interface when an xtf element is accessed through its wrapper (or
- * more precisely: accessed through one of the wrapper-generated
- * nsXTFInterfaceAggregator proxies). For JS-implemented XTF elements
- * the inner interface can be used to gain access to the underlying
- * JSObject using xpconnect's "wrappedJSObject" mechanism (see
- * nsIXPConnect.idl).
- */
-
-[scriptable, uuid(13ef3d54-1dd1-4a5c-a8d5-a04a327fb9b6)]
-interface nsIXTFPrivate : nsISupports
-{
-  readonly attribute nsISupports inner;
-};
deleted file mode 100644
--- a/content/xtf/readme.txt
+++ /dev/null
@@ -1,164 +0,0 @@
-XTF: An eXtensible Tag Framework
-================================
-
-XTF allows you to extend Mozilla by implementing new XML elements in
-XPCOM modules. It is not a C++-version of XBL: XTF elements can be
-written in any XPCOM-compatible language. I myself tend to write most
-elements in JavaScript.
-
-XTF support needs to be explicitly switched on for Mozilla builds by
-specifying the configure option '--enable-xtf' (add "ac_add_options
---enabl-xtf" to your .mozconfig).
-
-To serve a particular namespace "urn:mycompany:mynamespace" with your
-own XTF elements, create an XPCOM component that implements the
-interface nsIXTFElementFactory, and register it with the component
-manager under the contract id
-"@mozilla.org/xtf/element-factory;1?namespace=urn:mycompany:mynamespace".
-Whenever Mozilla encounters a tag in your namespace it will call your
-factory's 'createElement()' function.  This function should either
-return a new xtf element (an object implementing 'nsIXTFElement' and
-some other interfaces, depending on type and required features), or
-'null'. In the later case, the implementation will build a generic XML
-element.
-
-All interfaces relevant to XTF factory modules and XTF elements can be
-found in mozilla/content/xtf/public/.  The implementation code itself
-is mainly spread over the directories mozilla/content/xtf/ and
-mozilla/layout/xtf/.
-
-Binding outermost elements (document elements)
-============================================== 
-
-Binding of outermost elements is not (yet) supported. Depending on
-what you use xtf elements for, this might or might not be a
-problem. If you use xtf to implement a whole new language, rather than
-just widgets that will get used in html, xul, or svg docs, then you'll
-probably want to wrap up your documents in an xml element for which
-you provide some style (e.g. via a ua style sheet), so that things get
-displayed instead of pretty printed. This outermost element can be in
-your xtf-served namespace, as long as your xtf factory returns a
-failure for this element's tagname. The implementation will then
-generate a generic XML element for this element.
-
-XTF and XUL
-===========
-
-When using XTF elements in XUL documents, note that the owner document
-(both wrapper.ownerDocument & wrapper.elementNode.ownerDocument) will
-be null at the time of the onCreated() call. (For XML and SVG
-documents, at least wrapper.ownerDocument should be non-null.)  This
-is unfortunate, since it is often advantageous to build the visual
-content tree at the time of the onCreated() call and not wait until
-the visual content is explicitly requested, so that attributes set on
-the xtf element can be mapped directly to elements in the visual
-content tree. It is possible to build the content tree using a
-different document than the ultimate target document, but this in turn
-leads to some subtleties with XBL-bound content - see below.
-
-
-XTF and XBL
-===========
-
-XTF elements generally behave well in conjunction with XBL. There are
-a few issues when using XBL-bound elements in an XTFVisual's
-visualContent that arise from the fact that XBL bindings are attached
-to elements at layout-time rather than content-tree contruction time:
-Accessing an XBL-bound element's interfaces or JS object before
-layout-time usually doesn't yield the expected result. E.g. a listbox
-won't have the members 'appendItem', 'clearSelection', etc. before
-layout-time, even if QI'ed for nsIDOMXULMenuListElement. Worse, if the
-visual content has been constructed in a different document (because
-the target doc wasn't available at the time of content tree
-construction time - see above), then the JS object obtained before
-layout time will be different to the one that will ultimately receive
-the bound implementation, i.e. even QI'ing at a later stage will
-fail. To work around these issues, XBL-bound content should a) either
-be build as late as possible (i.e. when requested by the wrapper with
-a call to nsIXTFVisual::GetVisualContent()) or b) if this is not a
-possibility (e.g. because you would like to map attributes directly
-into the visual content tree), all JS object references to the element
-should be re-resolved at the time of the first layout (listen in to
-DidLayout() notifications).
-
-
-Bugs
-====
-
-1.
-For xtf elements written in JS (and possibly C++ as well),
-constructing a visual's visualContent using the same document as the
-visual's leads to some nasty reference cycle which prevents the
-wrapper, inner xtf element, anonymous content and possibly the whole
-document from ever getting destroyed. A workaround is to construct the
-visualContent in a different document (e.g. setting the document in
-nsXMLContentBuilder to null, or not setting the document at all, will
-lead to new content being build in a new temporary document).
-
-
-2.
-XBL-bound elements behave strangely if *any* XUL content underneath
-them is accessed from JS too early.
-Example: 
-
-  <groupbox>
-   <caption><xtf:foo/></caption>
-   <label value="label text"/>
-  </groupbox>
-
-If the JS-implemented xtf element 'foo' accesses any xul content
-before it receives the 'didLayout' notification, the groupbox will not
-be properly build (it will not contain the label text). 'Accessing xul
-content' includes any operation that leads to a js wrapper being
-constructed for a xul element. E.g. if the xtf element listens in to
-parentChanged-notifications, a wrapper will be build for the
-notification's 'parent' parameter and groupbox construction
-mysteriously fails.
-
-
-3.
-Some XUL interfaces can't be used via XPCOM and thus might not work as
-expected. E.g. menulist's
-nsIDOMXULSelectControlElement::insertItemAt() is supposed to return an
-element of type nsIDOMXULSelectControlItemElement. However, since
-menulist's XBL implementation of insertItemAt creates a xul element
-which will only be bound when the next asynchronous layout occurs,
-QI'ing to nsIDOMXULSelectControlItemElement fails. The result is that
-the method call always fails when invoked through XPCOM.  A pragmatic
-solution would be to change the XUL interface signatures to return
-nsIDOMXULElement instead of nsIDOMXULSelectControlItemElement.
-
-
-4.  
-QI'ing a JS-implemented xtf element's wrapper from JS as in 
-
-  element.QueryInterface(Components.interface.nsIXTFPrivate);
-
-occasionally hits the assertion
-
-  ###!!! ASSERTION: tearoff not empty in dtor: 
-  '!(GetInterface()||GetNative()||GetJSObject())', 
-  file /home/alex/devel/mozilla/js/src/xpconnect/src/xpcinlines.h, line 627
-
-with the result that the QI succeeds (i.e. doesn't throw an exception)
-but the interface methods/properties aren't available on the element
-after the QI, even though element implements the given interface.
-
-This seems to happen if GC kicks in *afer* the xtf element is being
-queried for its interface ( resulting in the creation of an
-nsXTFInterfaceAggregator) but *before* the nsXTFInterfaceAggregator
-has been wrapped for JS use by XPCConvert::NativeData2JS().
-
-The workaround is to a) either expose the interface via
-getScriptingInterfaces (in which case it will be available to JS
-callers automatically), or b) call QI until the interface is correctly
-installed, e.g.:
-
-  while (!element.inner)
-    element.QueryInterface(Components.interface.nsIXTFPrivate);
-
-With this code the QI should succeed in the first or second iteration.
-
-
-
-07. October 2004 Alex Fritze <alex@croczilla.com>
deleted file mode 100644
--- a/content/xtf/src/Makefile.in
+++ /dev/null
@@ -1,43 +0,0 @@
-# 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/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= content
-LIBRARY_NAME	= gkcontentxtf_s
-LIBXUL_LIBRARY  = 1
-FAIL_ON_WARNINGS = 1
-
-CPPSRCS		= \
-		nsXMLContentBuilder.cpp \
-		nsXTFElementWrapper.cpp \
-		nsXTFInterfaceAggregator.cpp \
-		nsXTFService.cpp \
-		nsXTFWeakTearoff.cpp \
-		$(NULL)
-
-include $(topsrcdir)/config/config.mk
-
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
-EXPORTS 	=  \
-		nsIXTFService.h  \
-		$(NULL)
-
-
-include $(topsrcdir)/config/rules.mk
-
-INCLUDES += 	\
-		-I$(srcdir)/../../xml/content/src \
-		-I$(srcdir)/../../base/src \
-		-I$(topsrcdir)/dom \
-		$(NULL)
-
-DEFINES += -D_IMPL_NS_LAYOUT
deleted file mode 100644
--- a/content/xtf/src/nsIXTFService.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef __NS_IXTFSERVICE_H__
-#define __NS_IXTFSERVICE_H__
-
-#include "nsISupports.h"
-
-class nsIContent;
-class nsINodeInfo;
-
-// {4ac3826f-280e-4572-9ede-6c81a4797861}
-#define NS_IXTFSERVICE_IID                             \
-  { 0x4ac3826f, 0x280e, 0x4572, \
-    { 0x9e, 0xde, 0x6c, 0x81, 0xa4, 0x79, 0x78, 0x61 } }
-class nsIXTFService : public nsISupports
-{
-public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXTFSERVICE_IID)
-
-    // try to create an xtf element based on namespace
-    virtual nsresult CreateElement(nsIContent** aResult,
-                                   already_AddRefed<nsINodeInfo> aNodeInfo) = 0;
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(nsIXTFService, NS_IXTFSERVICE_IID)
-
-//----------------------------------------------------------------------
-// The one class implementing this interface:
-
-// {4EC832DA-6AE7-4185-807B-DADDCB5DA37A}
-#define NS_XTFSERVICE_CID                             \
-  { 0x4ec832da, 0x6ae7, 0x4185, { 0x80, 0x7b, 0xda, 0xdd, 0xcb, 0x5d, 0xa3, 0x7a } }
-
-#define NS_XTFSERVICE_CONTRACTID "@mozilla.org/xtf/xtf-service;1"
-
-nsresult NS_NewXTFService(nsIXTFService** aResult);
-
-#endif // __NS_IXTFSERVICE_H__
-
deleted file mode 100644
--- a/content/xtf/src/nsXMLContentBuilder.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsCOMPtr.h"
-#include "nsString.h"
-#include "nsIXMLContentBuilder.h"
-#include "nsINameSpaceManager.h"
-#include "nsIContent.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
-#include "nsIAtom.h"
-#include "nsContentCID.h"
-#include "nsIDocument.h"
-#include "nsIDOMElement.h"
-#include "nsIDOMDocument.h"
-#include "nsIDOMText.h"
-#include "nsNodeInfoManager.h"
-#include "nsContentCreatorFunctions.h"
-#include "nsContentUtils.h"
-#include "mozilla/Attributes.h"
-
-static NS_DEFINE_CID(kXMLDocumentCID, NS_XMLDOCUMENT_CID);
-
-class nsXMLContentBuilder MOZ_FINAL : public nsIXMLContentBuilder
-{
-protected:
-  friend nsresult NS_NewXMLContentBuilder(nsIXMLContentBuilder** aResult);
-  
-  nsXMLContentBuilder();
-  ~nsXMLContentBuilder();
-  
-public:
-  // nsISupports interface
-  NS_DECL_ISUPPORTS
-
-  // nsIXMLContentBuilder interface
-  NS_DECL_NSIXMLCONTENTBUILDER
-
-private:
-  void EnsureDoc();
-  
-  nsCOMPtr<nsIContent> mTop;
-  nsCOMPtr<nsIContent> mCurrent;
-  nsCOMPtr<nsIDocument> mDocument;
-  int32_t mNamespaceId;
-};
-
-//----------------------------------------------------------------------
-// implementation:
-
-nsXMLContentBuilder::nsXMLContentBuilder()
-    : mNamespaceId(kNameSpaceID_None)
-{
-#ifdef DEBUG
-//  printf("nsXMLContentBuilder CTOR\n");
-#endif
-}
-
-nsXMLContentBuilder::~nsXMLContentBuilder()
-{
-#ifdef DEBUG
-//  printf("~nsXMLContentBuilder\n");
-#endif
-}
-
-nsresult
-NS_NewXMLContentBuilder(nsIXMLContentBuilder** aResult)
-{
-  nsXMLContentBuilder* result = new nsXMLContentBuilder();
-  if (! result)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  NS_ADDREF(result);
-  *aResult = result;
-  return NS_OK;
-}
-
-//----------------------------------------------------------------------
-// nsISupports methods
-
-NS_IMPL_ISUPPORTS1(nsXMLContentBuilder, nsIXMLContentBuilder)
-
-//----------------------------------------------------------------------
-// nsIXMLContentBuilder implementation
-
-/* void clear (in nsIDOMElement root); */
-NS_IMETHODIMP nsXMLContentBuilder::Clear(nsIDOMElement *root)
-{
-  mCurrent = do_QueryInterface(root);
-  mTop = do_QueryInterface(root);
-  if (mNamespaceId != kNameSpaceID_None) {
-    mNamespaceId = kNameSpaceID_None;
-  }
-  return NS_OK;
-}
-
-/* void setDocument (in nsIDOMDocument doc); */
-NS_IMETHODIMP nsXMLContentBuilder::SetDocument(nsIDOMDocument *doc)
-{
-  mDocument = do_QueryInterface(doc);
-#ifdef DEBUG
-  if (!mDocument)
-    NS_WARNING("null document in nsXMLContentBuilder::SetDocument");
-#endif
-  return NS_OK;
-}
-
-/* void setElementNamespace (in AString ns); */
-NS_IMETHODIMP nsXMLContentBuilder::SetElementNamespace(const nsAString & ns)
-{
-  nsContentUtils::NameSpaceManager()->RegisterNameSpace(ns, mNamespaceId);
-  return NS_OK;
-}
-
-/* void beginElement (in AString tagname); */
-NS_IMETHODIMP nsXMLContentBuilder::BeginElement(const nsAString & tagname)
-{
-  nsCOMPtr<nsIContent> node;
-  {
-    EnsureDoc();
-    mDocument->CreateElem(tagname, nullptr, mNamespaceId, getter_AddRefs(node));
-  }
-  if (!node) {
-    NS_ERROR("could not create node");
-    return NS_ERROR_FAILURE;
-  }
-
-  // ok, we created a content element. now either append it to our
-  // top-level array or to the current element.
-  if (!mCurrent) {
-    if (mTop) {
-      NS_ERROR("Building of multi-rooted trees not supported");
-      return NS_ERROR_FAILURE;
-    }
-    mTop = node;
-    mCurrent = mTop;
-  }
-  else {    
-    mCurrent->AppendChildTo(node, true);
-    mCurrent = node;
-  }
-  
-  return NS_OK;
-}
-
-/* void endElement (); */
-NS_IMETHODIMP nsXMLContentBuilder::EndElement()
-{
-  NS_ASSERTION(mCurrent, "unbalanced begin/endelement");
-  mCurrent = mCurrent->GetParent();
-  return NS_OK;
-}
-
-/* void attrib (in AString name, in AString value); */
-NS_IMETHODIMP nsXMLContentBuilder::Attrib(const nsAString & name, const nsAString & value)
-{
-  NS_ASSERTION(mCurrent, "can't set attrib w/o open element");
-  nsCOMPtr<nsIAtom> nameAtom = do_GetAtom(name);
-  mCurrent->SetAttr(0, nameAtom, value, true);
-  return NS_OK;
-}
-
-/* void textNode (in AString text); */
-NS_IMETHODIMP nsXMLContentBuilder::TextNode(const nsAString & text)
-{
-  EnsureDoc();
-  NS_ASSERTION(mCurrent, "can't append textnode w/o open element");
-  nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(mDocument);
-  NS_ASSERTION(domDoc, "no dom document");
-
-  nsCOMPtr<nsIDOMText> textNode;
-  domDoc->CreateTextNode(text, getter_AddRefs(textNode));
-  NS_ASSERTION(textNode, "Failed to create text node");
-  nsCOMPtr<nsIContent> textContent = do_QueryInterface(textNode);
-  mCurrent->AppendChildTo(textContent, true);
-  return NS_OK;
-}
-
-/* readonly attribute nsIDOMElement root; */
-NS_IMETHODIMP nsXMLContentBuilder::GetRoot(nsIDOMElement * *aRoot)
-{
-  if (!mTop) {
-    *aRoot = nullptr;
-    return NS_OK;
-  }
-  return CallQueryInterface(mTop, aRoot);
-}
-
-/* readonly attribute nsIDOMElement current; */
-NS_IMETHODIMP nsXMLContentBuilder::GetCurrent(nsIDOMElement * *aCurrent)
-{
-  if (!mCurrent) {
-    *aCurrent = nullptr;
-    return NS_OK;
-  }  
-  return CallQueryInterface(mCurrent, aCurrent);
-}
-
-//----------------------------------------------------------------------
-// implementation helpers
-
-void nsXMLContentBuilder::EnsureDoc()
-{
-  if (!mDocument) {
-    mDocument = do_CreateInstance(kXMLDocumentCID);
-    // XXX should probably do some doc initialization here, such as
-    // setting the base url
-  }
-  NS_ASSERTION(mDocument, "null doc");
-}
deleted file mode 100644
--- a/content/xtf/src/nsXTFElementWrapper.cpp
+++ /dev/null
@@ -1,1016 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsXTFElementWrapper.h"
-#include "nsIXTFElement.h"
-#include "nsCOMPtr.h"
-#include "nsString.h"
-#include "nsXTFInterfaceAggregator.h"
-#include "nsIClassInfo.h"
-#include "nsPIDOMWindow.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsIDocument.h"
-#include "nsGkAtoms.h"
-#include "nsIPresShell.h"
-#include "nsPresContext.h"
-#include "nsEventStateManager.h"
-#include "nsEventListenerManager.h"
-#include "nsIDOMEvent.h"
-#include "nsGUIEvent.h"
-#include "nsContentUtils.h"
-#include "nsIXTFService.h"
-#include "nsIDOMAttr.h"
-#include "nsIAttribute.h"
-#include "nsDOMAttributeMap.h"
-#include "nsUnicharUtils.h"
-#include "nsEventDispatcher.h"
-#include "nsIProgrammingLanguage.h"
-#include "nsIXPConnect.h"
-#include "nsXTFWeakTearoff.h"
-#include "mozAutoDocUpdate.h"
-#include "nsFocusManager.h"
-
-using namespace mozilla;
-
-nsXTFElementWrapper::nsXTFElementWrapper(already_AddRefed<nsINodeInfo> aNodeInfo,
-                                         nsIXTFElement* aXTFElement)
-    : nsXTFElementWrapperBase(aNodeInfo),
-      mXTFElement(aXTFElement),
-      mNotificationMask(0),
-      mIntrinsicState(0),
-      mTmpAttrName(nsGkAtoms::_asterix) // XXX this is a hack, but names
-                                            // have to have a value
-{
-  // We never know when we might have a class
-  SetFlags(NODE_MAY_HAVE_CLASS);
-}
-
-nsXTFElementWrapper::~nsXTFElementWrapper()
-{
-  mXTFElement->OnDestroyed();
-  mXTFElement = nullptr;
-  if (mClassInfo) {
-    mClassInfo->Disconnect();
-    mClassInfo = nullptr;
-  }
-}
-
-nsresult
-nsXTFElementWrapper::Init()
-{
-  // pass a weak wrapper (non base object ref-counted), so that
-  // our mXTFElement can safely addref/release.
-  nsISupports* weakWrapper = nullptr;
-  nsresult rv = NS_NewXTFWeakTearoff(NS_GET_IID(nsIXTFElementWrapper),
-                                     (nsIXTFElementWrapper*)this,
-                                     &weakWrapper);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  mXTFElement->OnCreated(static_cast<nsIXTFElementWrapper*>(weakWrapper));
-  weakWrapper->Release();
-
-  bool innerHandlesAttribs = false;
-  GetXTFElement()->GetIsAttributeHandler(&innerHandlesAttribs);
-  if (innerHandlesAttribs)
-    mAttributeHandler = do_QueryInterface(GetXTFElement());
-  return NS_OK;
-}
-
-//----------------------------------------------------------------------
-// nsISupports implementation
-
-NS_IMPL_ADDREF_INHERITED(nsXTFElementWrapper, nsXTFElementWrapperBase)
-NS_IMPL_RELEASE_INHERITED(nsXTFElementWrapper, nsXTFElementWrapperBase)
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsXTFElementWrapper)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXTFElementWrapper,
-                                                  nsXTFElementWrapperBase)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mXTFElement)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAttributeHandler)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMETHODIMP
-nsXTFElementWrapper::QueryInterface(REFNSIID aIID, void** aInstancePtr)
-{
-  NS_PRECONDITION(aInstancePtr, "null out param");
-
-  NS_IMPL_QUERY_CYCLE_COLLECTION(nsXTFElementWrapper)
-  if (aIID.Equals(NS_GET_IID(nsIClassInfo)) ||
-      aIID.Equals(NS_GET_IID(nsXPCClassInfo))) {
-    if (!mClassInfo) {
-      mClassInfo = new nsXTFClassInfo(this);
-    }
-    NS_ADDREF(mClassInfo);
-    *aInstancePtr = static_cast<nsIClassInfo*>(mClassInfo);
-    return NS_OK;
-  }
-  if (aIID.Equals(NS_GET_IID(nsIXPCScriptable))) {
-    if (!mClassInfo) {
-      mClassInfo = new nsXTFClassInfo(this);
-    }
-    NS_ADDREF(mClassInfo);
-    *aInstancePtr = static_cast<nsIXPCScriptable*>(mClassInfo);
-    return NS_OK;
-  }
-  if (aIID.Equals(NS_GET_IID(nsIXTFElementWrapper))) {
-    *aInstancePtr = static_cast<nsIXTFElementWrapper*>(this);
-    NS_ADDREF_THIS();
-    return NS_OK;
-  }
-
-  nsresult rv = nsXTFElementWrapperBase::QueryInterface(aIID, aInstancePtr);
-  if (NS_SUCCEEDED(rv)) {
-    return rv;
-  }
-
-  // try to get get the interface from our wrapped element:
-  nsCOMPtr<nsISupports> inner;
-  QueryInterfaceInner(aIID, getter_AddRefs(inner));
-
-  if (inner) {
-    rv = NS_NewXTFInterfaceAggregator(aIID, inner,
-                                      static_cast<nsIContent*>(this),
-                                      aInstancePtr);
-
-    return rv;
-  }
-
-  return NS_ERROR_NO_INTERFACE;
-}
-
-nsXPCClassInfo*
-nsXTFElementWrapper::GetClassInfo()
-{
-  if (!mClassInfo) {
-    mClassInfo = new nsXTFClassInfo(this);
-  }
-  return mClassInfo;
-}
-
-//----------------------------------------------------------------------
-// nsIContent methods:
-
-nsresult
-nsXTFElementWrapper::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
-                                nsIContent* aBindingParent,
-                                bool aCompileEventHandlers)
-{
-  // XXXbz making up random order for the notifications... Perhaps
-  // this api should more closely match BindToTree/UnbindFromTree?
-  nsCOMPtr<nsIDOMElement> domParent;
-  if (aParent != GetParent()) {
-    domParent = do_QueryInterface(aParent);
-  }
-
-  nsCOMPtr<nsIDOMDocument> domDocument;
-  if (aDocument &&
-      (mNotificationMask & (nsIXTFElement::NOTIFY_WILL_CHANGE_DOCUMENT |
-                            nsIXTFElement::NOTIFY_DOCUMENT_CHANGED))) {
-    domDocument = do_QueryInterface(aDocument);
-  }
-
-  if (domDocument &&
-      (mNotificationMask & (nsIXTFElement::NOTIFY_WILL_CHANGE_DOCUMENT))) {
-    GetXTFElement()->WillChangeDocument(domDocument);
-  }
-
-  if (domParent &&
-      (mNotificationMask & (nsIXTFElement::NOTIFY_WILL_CHANGE_PARENT))) {
-    GetXTFElement()->WillChangeParent(domParent);
-  }
-
-  nsresult rv = nsXTFElementWrapperBase::BindToTree(aDocument, aParent,
-                                                    aBindingParent,
-                                                    aCompileEventHandlers);
-
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (mNotificationMask & nsIXTFElement::NOTIFY_PERFORM_ACCESSKEY)
-    RegUnregAccessKey(true);
-
-  if (domDocument &&
-      (mNotificationMask & (nsIXTFElement::NOTIFY_DOCUMENT_CHANGED))) {
-    GetXTFElement()->DocumentChanged(domDocument);
-  }
-
-  if (domParent &&
-      (mNotificationMask & (nsIXTFElement::NOTIFY_PARENT_CHANGED))) {
-    GetXTFElement()->ParentChanged(domParent);
-  }
-
-  return rv;  
-}
-
-void
-nsXTFElementWrapper::UnbindFromTree(bool aDeep, bool aNullParent)
-{
-  // XXXbz making up random order for the notifications... Perhaps
-  // this api should more closely match BindToTree/UnbindFromTree?
-
-  bool inDoc = IsInDoc();
-  if (inDoc &&
-      (mNotificationMask & nsIXTFElement::NOTIFY_WILL_CHANGE_DOCUMENT)) {
-    GetXTFElement()->WillChangeDocument(nullptr);
-  }
-
-  bool parentChanged = aNullParent && GetParent();
-
-  if (parentChanged &&
-      (mNotificationMask & nsIXTFElement::NOTIFY_WILL_CHANGE_PARENT)) {
-    GetXTFElement()->WillChangeParent(nullptr);
-  }
-
-  if (mNotificationMask & nsIXTFElement::NOTIFY_PERFORM_ACCESSKEY)
-    RegUnregAccessKey(false);
-
-  nsXTFElementWrapperBase::UnbindFromTree(aDeep, aNullParent);
-
-  if (parentChanged &&
-      (mNotificationMask & nsIXTFElement::NOTIFY_PARENT_CHANGED)) {
-    GetXTFElement()->ParentChanged(nullptr);
-  }
-
-  if (inDoc &&
-      (mNotificationMask & nsIXTFElement::NOTIFY_DOCUMENT_CHANGED)) {
-    GetXTFElement()->DocumentChanged(nullptr);
-  }
-}
-
-nsresult
-nsXTFElementWrapper::InsertChildAt(nsIContent* aKid, uint32_t aIndex,
-                                   bool aNotify)
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIDOMNode> domKid;
-  if (mNotificationMask & (nsIXTFElement::NOTIFY_WILL_INSERT_CHILD |
-                           nsIXTFElement::NOTIFY_CHILD_INSERTED))
-    domKid = do_QueryInterface(aKid);
-  
-  if (mNotificationMask & nsIXTFElement::NOTIFY_WILL_INSERT_CHILD)
-    GetXTFElement()->WillInsertChild(domKid, aIndex);
-  rv = nsXTFElementWrapperBase::InsertChildAt(aKid, aIndex, aNotify);
-  if (mNotificationMask & nsIXTFElement::NOTIFY_CHILD_INSERTED)
-    GetXTFElement()->ChildInserted(domKid, aIndex);
-  
-  return rv;
-}
-
-void
-nsXTFElementWrapper::RemoveChildAt(uint32_t aIndex, bool aNotify)
-{
-  if (mNotificationMask & nsIXTFElement::NOTIFY_WILL_REMOVE_CHILD)
-    GetXTFElement()->WillRemoveChild(aIndex);
-  nsXTFElementWrapperBase::RemoveChildAt(aIndex, aNotify);
-  if (mNotificationMask & nsIXTFElement::NOTIFY_CHILD_REMOVED)
-    GetXTFElement()->ChildRemoved(aIndex);
-}
-
-nsIAtom *
-nsXTFElementWrapper::GetIDAttributeName() const
-{
-  // XXX:
-  return nsGkAtoms::id;
-}
-
-nsresult
-nsXTFElementWrapper::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-                             nsIAtom* aPrefix, const nsAString& aValue,
-                             bool aNotify)
-{
-  nsresult rv;
-
-  if (aNameSpaceID == kNameSpaceID_None &&
-      (mNotificationMask & nsIXTFElement::NOTIFY_WILL_SET_ATTRIBUTE))
-    GetXTFElement()->WillSetAttribute(aName, aValue);
-
-  if (aNameSpaceID==kNameSpaceID_None && HandledByInner(aName)) {
-    rv = mAttributeHandler->SetAttribute(aName, aValue);
-    // XXX mutation events?
-  }
-  else { // let wrapper handle it
-    rv = nsXTFElementWrapperBase::SetAttr(aNameSpaceID, aName, aPrefix, aValue, aNotify);
-  }
-  
-  if (aNameSpaceID == kNameSpaceID_None &&
-      (mNotificationMask & nsIXTFElement::NOTIFY_ATTRIBUTE_SET))
-    GetXTFElement()->AttributeSet(aName, aValue);
-
-  if (mNotificationMask & nsIXTFElement::NOTIFY_PERFORM_ACCESSKEY) {
-    nsCOMPtr<nsIDOMAttr> accesskey;
-    GetXTFElement()->GetAccesskeyNode(getter_AddRefs(accesskey));
-    nsCOMPtr<nsIAttribute> attr(do_QueryInterface(accesskey));
-    if (attr && attr->NodeInfo()->Equals(aName, aNameSpaceID))
-      RegUnregAccessKey(true);
-  }
-
-  return rv;
-}
-
-bool
-nsXTFElementWrapper::GetAttr(int32_t aNameSpaceID, nsIAtom* aName, 
-                             nsAString& aResult) const
-{
-  if (aNameSpaceID==kNameSpaceID_None && HandledByInner(aName)) {
-    // XXX we don't do namespaced attributes yet
-    nsresult rv = mAttributeHandler->GetAttribute(aName, aResult);
-    return NS_SUCCEEDED(rv) && !aResult.IsVoid();
-  }
-  else { // try wrapper
-    return nsXTFElementWrapperBase::GetAttr(aNameSpaceID, aName, aResult);
-  }
-}
-
-bool
-nsXTFElementWrapper::HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const
-{
-  if (aNameSpaceID==kNameSpaceID_None && HandledByInner(aName)) {
-    bool rval = false;
-    mAttributeHandler->HasAttribute(aName, &rval);
-    return rval;
-  }
-  else { // try wrapper
-    return nsXTFElementWrapperBase::HasAttr(aNameSpaceID, aName);
-  }
-}
-
-bool
-nsXTFElementWrapper::AttrValueIs(int32_t aNameSpaceID,
-                                 nsIAtom* aName,
-                                 const nsAString& aValue,
-                                 nsCaseTreatment aCaseSensitive) const
-{
-  NS_ASSERTION(aName, "Must have attr name");
-  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
-
-  if (aNameSpaceID == kNameSpaceID_None && HandledByInner(aName)) {
-    nsAutoString ourVal;
-    if (!GetAttr(aNameSpaceID, aName, ourVal)) {
-      return false;
-    }
-    return aCaseSensitive == eCaseMatters ?
-      aValue.Equals(ourVal) :
-      aValue.Equals(ourVal, nsCaseInsensitiveStringComparator());
-  }
-
-  return nsXTFElementWrapperBase::AttrValueIs(aNameSpaceID, aName, aValue,
-                                              aCaseSensitive);
-}
-
-bool
-nsXTFElementWrapper::AttrValueIs(int32_t aNameSpaceID,
-                                 nsIAtom* aName,
-                                 nsIAtom* aValue,
-                                 nsCaseTreatment aCaseSensitive) const
-{
-  NS_ASSERTION(aName, "Must have attr name");
-  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
-  NS_ASSERTION(aValue, "Null value atom");
-
-  if (aNameSpaceID == kNameSpaceID_None && HandledByInner(aName)) {
-    nsAutoString ourVal;
-    if (!GetAttr(aNameSpaceID, aName, ourVal)) {
-      return false;
-    }
-    if (aCaseSensitive == eCaseMatters) {
-      return aValue->Equals(ourVal);
-    }
-    nsAutoString val;
-    aValue->ToString(val);
-    return val.Equals(ourVal, nsCaseInsensitiveStringComparator());
-  }
-
-  return nsXTFElementWrapperBase::AttrValueIs(aNameSpaceID, aName, aValue,
-                                              aCaseSensitive);
-}
-
-int32_t
-nsXTFElementWrapper::FindAttrValueIn(int32_t aNameSpaceID,
-                                     nsIAtom* aName,
-                                     AttrValuesArray* aValues,
-                                     nsCaseTreatment aCaseSensitive) const
-{
-  NS_ASSERTION(aName, "Must have attr name");
-  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
-  NS_ASSERTION(aValues, "Null value array");
-  
-  if (aNameSpaceID == kNameSpaceID_None && HandledByInner(aName)) {
-    nsAutoString ourVal;
-    if (!GetAttr(aNameSpaceID, aName, ourVal)) {
-      return ATTR_MISSING;
-    }
-    
-    for (int32_t i = 0; aValues[i]; ++i) {
-      if (aCaseSensitive == eCaseMatters) {
-        if ((*aValues[i])->Equals(ourVal)) {
-          return i;
-        }
-      } else {
-        nsAutoString val;
-        (*aValues[i])->ToString(val);
-        if (val.Equals(ourVal, nsCaseInsensitiveStringComparator())) {
-          return i;
-        }
-      }
-    }
-    return ATTR_VALUE_NO_MATCH;
-  }
-
-  return nsXTFElementWrapperBase::FindAttrValueIn(aNameSpaceID, aName, aValues,
-                                                  aCaseSensitive);
-}
-
-nsresult
-nsXTFElementWrapper::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttr, 
-                               bool aNotify)
-{
-  nsresult rv;
-
-  if (aNameSpaceID == kNameSpaceID_None &&
-      (mNotificationMask & nsIXTFElement::NOTIFY_WILL_REMOVE_ATTRIBUTE))
-    GetXTFElement()->WillRemoveAttribute(aAttr);
-
-  if (mNotificationMask & nsIXTFElement::NOTIFY_PERFORM_ACCESSKEY) {
-    nsCOMPtr<nsIDOMAttr> accesskey;
-    GetXTFElement()->GetAccesskeyNode(getter_AddRefs(accesskey));
-    nsCOMPtr<nsIAttribute> attr(do_QueryInterface(accesskey));
-    if (attr && attr->NodeInfo()->Equals(aAttr, aNameSpaceID))
-      RegUnregAccessKey(false);
-  }
-
-  if (aNameSpaceID==kNameSpaceID_None && HandledByInner(aAttr)) {
-    nsDOMSlots *slots = GetExistingDOMSlots();
-    if (slots && slots->mAttributeMap) {
-      slots->mAttributeMap->DropAttribute(aNameSpaceID, aAttr);
-    }
-    rv = mAttributeHandler->RemoveAttribute(aAttr);
-
-    // XXX if the RemoveAttribute() call fails, we might end up having removed
-    // the attribute from the attribute map even though the attribute is still
-    // on the element
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=296205
-
-    // XXX mutation events?
-  }
-  else { // try wrapper
-    rv = nsXTFElementWrapperBase::UnsetAttr(aNameSpaceID, aAttr, aNotify);
-  }
-
-  if (aNameSpaceID == kNameSpaceID_None &&
-      (mNotificationMask & nsIXTFElement::NOTIFY_ATTRIBUTE_REMOVED))
-    GetXTFElement()->AttributeRemoved(aAttr);
-
-  return rv;
-}
-
-const nsAttrName*
-nsXTFElementWrapper::GetAttrNameAt(uint32_t aIndex) const
-{
-  uint32_t innerCount=0;
-  if (mAttributeHandler) {
-    mAttributeHandler->GetAttributeCount(&innerCount);
-  }
-  
-  if (aIndex < innerCount) {
-    nsCOMPtr<nsIAtom> localName;
-    nsresult rv = mAttributeHandler->GetAttributeNameAt(aIndex, getter_AddRefs(localName));
-    NS_ENSURE_SUCCESS(rv, nullptr);
-
-    const_cast<nsXTFElementWrapper*>(this)->mTmpAttrName.SetTo(localName);
-    return &mTmpAttrName;
-  }
-  else { // wrapper handles attrib
-    return nsXTFElementWrapperBase::GetAttrNameAt(aIndex - innerCount);
-  }
-}
-
-uint32_t
-nsXTFElementWrapper::GetAttrCount() const
-{
-  uint32_t innerCount = 0;
-  if (mAttributeHandler) {
-    mAttributeHandler->GetAttributeCount(&innerCount);
-  }
-  // add wrapper attribs
-  return innerCount + nsXTFElementWrapperBase::GetAttrCount();
-}
-
-void
-nsXTFElementWrapper::BeginAddingChildren()
-{
-  if (mNotificationMask & nsIXTFElement::NOTIFY_BEGIN_ADDING_CHILDREN)
-    GetXTFElement()->BeginAddingChildren();
-}
-
-void
-nsXTFElementWrapper::DoneAddingChildren(bool aHaveNotified)
-{
-  if (mNotificationMask & nsIXTFElement::NOTIFY_DONE_ADDING_CHILDREN)
-    GetXTFElement()->DoneAddingChildren();
-}
-
-already_AddRefed<nsINodeInfo>
-nsXTFElementWrapper::GetExistingAttrNameFromQName(const nsAString& aStr) const
-{
-  nsINodeInfo* nodeInfo = nsXTFElementWrapperBase::GetExistingAttrNameFromQName(aStr).get();
-
-  // Maybe this attribute is handled by our inner element:
-  if (!nodeInfo) {
-    nsCOMPtr<nsIAtom> nameAtom = do_GetAtom(aStr);
-    if (HandledByInner(nameAtom)) 
-      nodeInfo = mNodeInfo->NodeInfoManager()->
-        GetNodeInfo(nameAtom, nullptr, kNameSpaceID_None,
-                    nsIDOMNode::ATTRIBUTE_NODE).get();
-  }
-  
-  return nodeInfo;
-}
-
-nsEventStates
-nsXTFElementWrapper::IntrinsicState() const
-{
-  nsEventStates retState = nsXTFElementWrapperBase::IntrinsicState();
-  if (mIntrinsicState.HasState(NS_EVENT_STATE_MOZ_READONLY)) {
-    retState &= ~NS_EVENT_STATE_MOZ_READWRITE;
-  } else if (mIntrinsicState.HasState(NS_EVENT_STATE_MOZ_READWRITE)) {
-    retState &= ~NS_EVENT_STATE_MOZ_READONLY;
-  }
-
-  return  retState | mIntrinsicState;
-}
-
-void
-nsXTFElementWrapper::PerformAccesskey(bool aKeyCausesActivation,
-                                      bool aIsTrustedEvent)
-{
-  if (mNotificationMask & nsIXTFElement::NOTIFY_PERFORM_ACCESSKEY) {
-    nsIFocusManager* fm = nsFocusManager::GetFocusManager();
-    if (fm)
-      fm->SetFocus(this, nsIFocusManager::FLAG_BYKEY);
-
-    if (aKeyCausesActivation)
-      GetXTFElement()->PerformAccesskey();
-  }
-}
-
-nsresult
-nsXTFElementWrapper::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
-{
-  *aResult = nullptr;
-  nsCOMPtr<nsIContent> it;
-  nsContentUtils::GetXTFService()->CreateElement(getter_AddRefs(it),
-                                                 aNodeInfo);
-  if (!it)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  nsXTFElementWrapper* wrapper =
-    static_cast<nsXTFElementWrapper*>(it.get());
-  nsresult rv = const_cast<nsXTFElementWrapper*>(this)->CopyInnerTo(wrapper);
-
-  if (NS_SUCCEEDED(rv)) {
-    if (mAttributeHandler) {
-      uint32_t innerCount = 0;
-      mAttributeHandler->GetAttributeCount(&innerCount);
-      for (uint32_t i = 0; i < innerCount; ++i) {
-        nsCOMPtr<nsIAtom> attrName;
-        mAttributeHandler->GetAttributeNameAt(i, getter_AddRefs(attrName));
-        if (attrName) {
-          nsAutoString value;
-          if (NS_SUCCEEDED(mAttributeHandler->GetAttribute(attrName, value)))
-            it->SetAttr(kNameSpaceID_None, attrName, value, true);
-        }
-      }
-    }
-    NS_ADDREF(*aResult = it);
-  }
-
-  // XXX CloneState should take |const nIDOMElement*|
-  wrapper->CloneState(const_cast<nsXTFElementWrapper*>(this));
-  return rv;
-}
-
-//----------------------------------------------------------------------
-// nsIDOMElement methods:
-
-void
-nsXTFElementWrapper::GetAttribute(const nsAString& aName, nsString& aReturn)
-{
-  const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
-  if (name) {
-    GetAttr(name->NamespaceID(), name->LocalName(), aReturn);
-    return;
-  }
-
-  // Maybe this attribute is handled by our inner element:
-  if (mAttributeHandler) {
-    nsresult rv = nsContentUtils::CheckQName(aName, false);
-    if (NS_FAILED(rv)) {
-      return; // XXX
-    }
-    nsCOMPtr<nsIAtom> nameAtom = do_GetAtom(aName);
-    if (HandledByInner(nameAtom)) {
-      GetAttr(kNameSpaceID_None, nameAtom, aReturn);
-      return;
-    }
-  }
-  
-  SetDOMStringToNull(aReturn);
-}
-
-void
-nsXTFElementWrapper::RemoveAttribute(const nsAString& aName,
-                                     ErrorResult& aError)
-{
-  const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
-
-  if (name) {
-    nsAttrName tmp(*name);
-    aError = UnsetAttr(name->NamespaceID(), name->LocalName(), true);
-    return;
-  }
-
-  // Maybe this attribute is handled by our inner element:
-  if (mAttributeHandler) {
-    nsCOMPtr<nsIAtom> nameAtom = do_GetAtom(aName);
-    aError = UnsetAttr(kNameSpaceID_None, nameAtom, true);
-  }
-}
-
-bool
-nsXTFElementWrapper::HasAttribute(const nsAString& aName) const
-{
-  const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
-  if (name) {
-    return true;
-  }
-  
-  // Maybe this attribute is handled by our inner element:
-  if (mAttributeHandler) {
-    nsCOMPtr<nsIAtom> nameAtom = do_GetAtom(aName);
-    return HasAttr(kNameSpaceID_None, nameAtom);
-  }
-
-  return false;
-}
-
-
-//----------------------------------------------------------------------
-// nsIClassInfo implementation
-
-/* void getInterfaces (out uint32_t count, [array, size_is (count), retval] out nsIIDPtr array); */
-NS_IMETHODIMP 
-nsXTFElementWrapper::GetInterfaces(uint32_t* aCount, nsIID*** aArray)
-{
-  *aArray = nullptr;
-  *aCount = 0;
-  uint32_t baseCount = 0;
-  nsIID** baseArray = nullptr;
-  uint32_t xtfCount = 0;
-  nsIID** xtfArray = nullptr;
-
-  nsCOMPtr<nsIClassInfo> baseCi = GetBaseXPCClassInfo();
-  if (baseCi) {
-    baseCi->GetInterfaces(&baseCount, &baseArray);
-  }
-
-  GetXTFElement()->GetScriptingInterfaces(&xtfCount, &xtfArray);
-  if (!xtfCount) {
-    *aCount = baseCount;
-    *aArray = baseArray;
-    return NS_OK;
-  } else if (!baseCount) {
-    *aCount = xtfCount;
-    *aArray = xtfArray;
-    return NS_OK;
-  }
-
-  uint32_t count = baseCount + xtfCount;
-  nsIID** iids = static_cast<nsIID**>
-                            (nsMemory::Alloc(count * sizeof(nsIID*)));
-  NS_ENSURE_TRUE(iids, NS_ERROR_OUT_OF_MEMORY);
-
-  uint32_t i = 0;
-  for (; i < baseCount; ++i) {
-    iids[i] = static_cast<nsIID*>
-                         (nsMemory::Clone(baseArray[i], sizeof(nsIID)));
-    if (!iids[i]) {
-      NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(baseCount, baseArray);
-      NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(xtfCount, xtfArray);
-      NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, iids);
-      return NS_ERROR_OUT_OF_MEMORY;
-    }
-  }
-
-  for (; i < count; ++i) {
-    iids[i] = static_cast<nsIID*>
-                         (nsMemory::Clone(xtfArray[i - baseCount], sizeof(nsIID)));
-    if (!iids[i]) {
-      NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(baseCount, baseArray);
-      NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(xtfCount, xtfArray);
-      NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, iids);
-      return NS_ERROR_OUT_OF_MEMORY;
-    }
-  }
-
-  NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(baseCount, baseArray);
-  NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(xtfCount, xtfArray);
-  *aArray = iids;
-  *aCount = count;
-
-  return NS_OK;
-}
-
-/* nsISupports getHelperForLanguage (in uint32_t language); */
-NS_IMETHODIMP 
-nsXTFElementWrapper::GetHelperForLanguage(uint32_t language,
-                                          nsISupports** aHelper)
-{
-  *aHelper = nullptr;
-  nsCOMPtr<nsIClassInfo> ci = GetBaseXPCClassInfo();
-  return
-    ci ? ci->GetHelperForLanguage(language, aHelper) : NS_ERROR_NOT_AVAILABLE;
-}
-
-/* readonly attribute string contractID; */
-NS_IMETHODIMP 
-nsXTFElementWrapper::GetContractID(char * *aContractID)
-{
-  *aContractID = nullptr;
-  return NS_OK;
-}
-
-/* readonly attribute string classDescription; */
-NS_IMETHODIMP 
-nsXTFElementWrapper::GetClassDescription(char * *aClassDescription)
-{
-  *aClassDescription = nullptr;
-  return NS_OK;
-}
-
-/* readonly attribute nsCIDPtr classID; */
-NS_IMETHODIMP 
-nsXTFElementWrapper::GetClassID(nsCID * *aClassID)
-{
-  *aClassID = nullptr;
-  return NS_OK;
-}
-
-/* readonly attribute uint32_t implementationLanguage; */
-NS_IMETHODIMP 
-nsXTFElementWrapper::GetImplementationLanguage(uint32_t *aImplementationLanguage)
-{
-  *aImplementationLanguage = nsIProgrammingLanguage::UNKNOWN;
-  return NS_OK;
-}
-
-/* readonly attribute uint32_t flags; */
-NS_IMETHODIMP 
-nsXTFElementWrapper::GetFlags(uint32_t *aFlags)
-{
-  *aFlags = nsIClassInfo::DOM_OBJECT;
-  return NS_OK;
-}
-
-/* [notxpcom] readonly attribute nsCID classIDNoAlloc; */
-NS_IMETHODIMP 
-nsXTFElementWrapper::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
-{
-  return NS_ERROR_NOT_AVAILABLE;
-}
-
-//----------------------------------------------------------------------
-// nsIXTFElementWrapper implementation:
-
-/* readonly attribute nsIDOMElement elementNode; */
-NS_IMETHODIMP
-nsXTFElementWrapper::GetElementNode(nsIDOMElement * *aElementNode)
-{
-  *aElementNode = (nsIDOMElement*)this;
-  NS_ADDREF(*aElementNode);
-  return NS_OK;
-}
-
-/* readonly attribute nsIDOMElement documentFrameElement; */
-NS_IMETHODIMP
-nsXTFElementWrapper::GetDocumentFrameElement(nsIDOMElement * *aDocumentFrameElement)
-{
-  *aDocumentFrameElement = nullptr;
-  
-  nsIDocument *doc = GetCurrentDoc();
-  if (!doc) {
-    NS_WARNING("no document");
-    return NS_OK;
-  }
-  nsCOMPtr<nsISupports> container = doc->GetContainer();
-  if (!container) {
-    NS_ERROR("no docshell");
-    return NS_ERROR_FAILURE;
-  }
-  nsCOMPtr<nsPIDOMWindow> pidomwin = do_GetInterface(container);
-  if (!pidomwin) {
-    NS_ERROR("no nsPIDOMWindow interface on docshell");
-    return NS_ERROR_FAILURE;
-  }
-  *aDocumentFrameElement = pidomwin->GetFrameElementInternal();
-  NS_IF_ADDREF(*aDocumentFrameElement);
-  return NS_OK;
-}
-
-/* attribute unsigned long notificationMask; */
-NS_IMETHODIMP
-nsXTFElementWrapper::GetNotificationMask(uint32_t *aNotificationMask)
-{
-  *aNotificationMask = mNotificationMask;
-  return NS_OK;
-}
-NS_IMETHODIMP
-nsXTFElementWrapper::SetNotificationMask(uint32_t aNotificationMask)
-{
-  mNotificationMask = aNotificationMask;
-  return NS_OK;
-}
-
-//----------------------------------------------------------------------
-// implementation helpers:
-bool
-nsXTFElementWrapper::QueryInterfaceInner(REFNSIID aIID, void** result)
-{
-  // We must ensure that the inner element has a distinct xpconnect
-  // identity, so we mustn't aggregate nsIXPConnectWrappedJS:
-  if (aIID.Equals(NS_GET_IID(nsIXPConnectWrappedJS))) return false;
-
-  GetXTFElement()->QueryInterface(aIID, result);
-  return (*result!=nullptr);
-}
-
-bool
-nsXTFElementWrapper::HandledByInner(nsIAtom *attr) const
-{
-  bool retval = false;
-  if (mAttributeHandler)
-    mAttributeHandler->HandlesAttribute(attr, &retval);
-  return retval;
-}
-
-/* [notxpcom,nostdcall] uint32_t getScriptableFlags(); */
-// This method isn't automatically forwarded safely because it's notxpcom, so
-// the IDL binding doesn't know what value to return.
-uint32_t
-nsXTFElementWrapper::GetScriptableFlags()
-{
-  return GetBaseXPCClassInfo() ? GetBaseXPCClassInfo()->GetScriptableFlags()
-                               : 0;
-}
-
-nsresult
-nsXTFElementWrapper::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
-{
-  nsresult rv = NS_OK;
-  if (aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
-      !(mNotificationMask & nsIXTFElement::NOTIFY_HANDLE_DEFAULT)) {
-    return rv;
-  }
-
-  if (!aVisitor.mDOMEvent) {
-    // We haven't made a DOMEvent yet.  Force making one now.
-    if (NS_FAILED(rv = nsEventDispatcher::CreateEvent(aVisitor.mPresContext,
-                                                      aVisitor.mEvent,
-                                                      EmptyString(),
-                                                      &aVisitor.mDOMEvent)))
-      return rv;
-  }
-  if (!aVisitor.mDOMEvent)
-    return NS_ERROR_FAILURE;
-  
-  bool defaultHandled = false;
-  nsIXTFElement* xtfElement = GetXTFElement();
-  if (xtfElement)
-    rv = xtfElement->HandleDefault(aVisitor.mDOMEvent, &defaultHandled);
-  if (defaultHandled)
-    aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
-  return rv;
-}
-
-NS_IMETHODIMP
-nsXTFElementWrapper::SetIntrinsicState(nsEventStates::InternalType aNewState)
-{
-  nsIDocument *doc = GetCurrentDoc();
-  nsEventStates newStates(aNewState);
-  nsEventStates bits = mIntrinsicState ^ newStates;
-
-  if (!doc || bits.IsEmpty())
-    return NS_OK;
-
-  NS_WARN_IF_FALSE(!newStates.HasAllStates(NS_EVENT_STATE_MOZ_READONLY |
-                                           NS_EVENT_STATE_MOZ_READWRITE),
-                   "Both READONLY and READWRITE are being set.  Yikes!!!");
-
-  mIntrinsicState = newStates;
-  UpdateState(true);
-
-  return NS_OK;
-}
-
-nsIAtom *
-nsXTFElementWrapper::GetClassAttributeName() const
-{
-  return mClassAttributeName;
-}
-
-const nsAttrValue*
-nsXTFElementWrapper::DoGetClasses() const
-{
-  const nsAttrValue* val = nullptr;
-  nsIAtom* clazzAttr = GetClassAttributeName();
-  if (clazzAttr) {
-    val = mAttrsAndChildren.GetAttr(clazzAttr);
-    // This is possibly the first time we need any classes.
-    if (val && val->Type() == nsAttrValue::eString) {
-      nsAutoString value;
-      val->ToString(value);
-      nsAttrValue newValue;
-      newValue.ParseAtomArray(value);
-      const_cast<nsAttrAndChildArray*>(&mAttrsAndChildren)->
-        SetAndTakeAttr(clazzAttr, newValue);
-    }
-  }
-  return val;
-}
-
-nsresult
-nsXTFElementWrapper::SetClassAttributeName(nsIAtom* aName)
-{
-  // The class attribute name can be set only once
-  if (mClassAttributeName || !aName)
-    return NS_ERROR_FAILURE;
-  
-  mClassAttributeName = aName;
-  return NS_OK;
-}
-
-void
-nsXTFElementWrapper::RegUnregAccessKey(bool aDoReg)
-{
-  nsIDocument* doc = GetCurrentDoc();
-  if (!doc)
-    return;
-
-  // Get presentation shell 0
-  nsIPresShell *presShell = doc->GetShell();
-  if (!presShell)
-    return;
-
-  nsPresContext *presContext = presShell->GetPresContext();
-  if (!presContext)
-    return;
-
-  nsEventStateManager *esm = presContext->EventStateManager();
-  if (!esm)
-    return;
-
-  // Register or unregister as appropriate.
-  nsCOMPtr<nsIDOMAttr> accesskeyNode;
-  GetXTFElement()->GetAccesskeyNode(getter_AddRefs(accesskeyNode));
-  if (!accesskeyNode)
-    return;
-
-  nsAutoString accessKey;
-  accesskeyNode->GetValue(accessKey);
-
-  if (aDoReg && !accessKey.IsEmpty())
-    esm->RegisterAccessKey(this, (uint32_t)accessKey.First());
-  else
-    esm->UnregisterAccessKey(this, (uint32_t)accessKey.First());
-}
-
-nsresult
-NS_NewXTFElementWrapper(nsIXTFElement* aXTFElement,
-                        already_AddRefed<nsINodeInfo> aNodeInfo,
-                        nsIContent** aResult)
-{
-  *aResult = nullptr;
-   NS_ENSURE_ARG(aXTFElement);
-
-  nsXTFElementWrapper* result = new nsXTFElementWrapper(aNodeInfo, aXTFElement);
-  if (!result) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  NS_ADDREF(result);
-
-  nsresult rv = result->Init();
-  if (NS_FAILED(rv)) {
-    NS_RELEASE(result);
-    return rv;
-  }
-
-  *aResult = result;
-  return NS_OK;
-}
-
-NS_IMPL_ISUPPORTS3(nsXTFClassInfo,
-                   nsIClassInfo,
-                   nsXPCClassInfo,
-                   nsIXPCScriptable)
deleted file mode 100644
--- a/content/xtf/src/nsXTFElementWrapper.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef __NS_XTFELEMENTWRAPPER_H__
-#define __NS_XTFELEMENTWRAPPER_H__
-
-#include "nsIXTFElementWrapper.h"
-#include "nsXMLElement.h"
-#include "nsIXTFAttributeHandler.h"
-#include "nsIXTFElement.h"
-#include "mozilla/Attributes.h"
-
-typedef nsXMLElement nsXTFElementWrapperBase;
-class nsXTFClassInfo;
-
-// Pseudo IID for nsXTFElementWrapper
-// {599EB85F-ABC0-4B52-A1B0-EA103D48E3AE}
-#define NS_XTFELEMENTWRAPPER_IID \
-{ 0x599eb85f, 0xabc0, 0x4b52, { 0xa1, 0xb0, 0xea, 0x10, 0x3d, 0x48, 0xe3, 0xae } }
-
-
-class nsXTFElementWrapper : public nsXTFElementWrapperBase,
-                            public nsIXTFElementWrapper
-{
-public:
-  nsXTFElementWrapper(already_AddRefed<nsINodeInfo> aNodeInfo, nsIXTFElement* aXTFElement);
-  virtual ~nsXTFElementWrapper();
-  nsresult Init();
-
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_XTFELEMENTWRAPPER_IID)
-
-  // nsISupports interface
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsXTFElementWrapper,
-                                                     nsXTFElementWrapperBase)
-
-  // nsIXTFElementWrapper
-  NS_DECL_NSIXTFELEMENTWRAPPER
-    
-  // nsIContent specializations:
-#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
-  using nsINode::GetProperty;
-  using nsINode::SetProperty;
-#endif
-
-  virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
-                              nsIContent* aBindingParent,
-                              bool aCompileEventHandlers);
-  virtual void UnbindFromTree(bool aDeep = true,
-                              bool aNullParent = true);
-  nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
-                         bool aNotify);
-  void RemoveChildAt(uint32_t aIndex, bool aNotify);
-  nsIAtom *GetIDAttributeName() const;
-  nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-                   nsIAtom* aPrefix, const nsAString& aValue,
-                   bool aNotify);
-  bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName, 
-                 nsAString& aResult) const;
-  bool HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const;
-  virtual bool AttrValueIs(int32_t aNameSpaceID, nsIAtom* aName,
-                             const nsAString& aValue,
-                             nsCaseTreatment aCaseSensitive) const;
-  virtual bool AttrValueIs(int32_t aNameSpaceID, nsIAtom* aName,
-                             nsIAtom* aValue,
-                             nsCaseTreatment aCaseSensitive) const;
-  virtual int32_t FindAttrValueIn(int32_t aNameSpaceID,
-                                  nsIAtom* aName,
-                                  AttrValuesArray* aValues,
-                                  nsCaseTreatment aCaseSensitive) const;
-  nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttr, 
-                     bool aNotify);
-  const nsAttrName* GetAttrNameAt(uint32_t aIndex) const;
-  uint32_t GetAttrCount() const;
-  virtual already_AddRefed<nsINodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const;
-
-  virtual nsEventStates IntrinsicState() const;
-
-  virtual void BeginAddingChildren();
-  virtual void DoneAddingChildren(bool aHaveNotified);
-
-  virtual nsIAtom *GetClassAttributeName() const;
-  virtual const nsAttrValue* DoGetClasses() const;
-
-  virtual void PerformAccesskey(bool aKeyCausesActivation,
-                                bool aIsTrustedEvent);
-
-  // Element specializations:
-  using nsXMLElement::GetAttribute;
-  using nsXMLElement::RemoveAttribute;
-  using nsXMLElement::HasAttribute;
-  virtual void GetAttribute(const nsAString& aName,
-                            nsString& aReturn) MOZ_OVERRIDE;
-  virtual void RemoveAttribute(const nsAString& aName,
-                               mozilla::ErrorResult& aError) MOZ_OVERRIDE;
-  virtual bool HasAttribute(const nsAString& aName) const MOZ_OVERRIDE;
-  
-  // nsIClassInfo interface
-  NS_DECL_NSICLASSINFO
-
-  // nsIXPCScriptable interface
-  NS_FORWARD_SAFE_NSIXPCSCRIPTABLE(GetBaseXPCClassInfo())
-
-  // nsXPCClassInfo
-  virtual void PreserveWrapper(nsISupports *aNative)
-  {
-    nsXPCClassInfo *ci = GetBaseXPCClassInfo();
-    if (ci) {
-      ci->PreserveWrapper(aNative);
-    }
-  }
-  virtual uint32_t GetInterfacesBitmap()
-  {
-    nsXPCClassInfo *ci = GetBaseXPCClassInfo();
-    return ci ? ci->GetInterfacesBitmap() :  0;
-  }
-
-  virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
-
-  nsresult CloneState(nsIDOMElement *aElement)
-  {
-    return GetXTFElement()->CloneState(aElement);
-  }
-  nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  virtual nsXPCClassInfo* GetClassInfo();
-
-  virtual void NodeInfoChanged(nsINodeInfo* aOldNodeInfo)
-  {
-  }
-
-protected:
-  virtual nsIXTFElement* GetXTFElement() const
-  {
-    return mXTFElement;
-  }
-
-  static nsXPCClassInfo* GetBaseXPCClassInfo()
-  {
-    return static_cast<nsXPCClassInfo*>(
-      NS_GetDOMClassInfoInstance(eDOMClassInfo_Element_id));
-  }
-
-  // implementation helpers:  
-  bool QueryInterfaceInner(REFNSIID aIID, void** result);
-
-  bool HandledByInner(nsIAtom* attr) const;
-
-  void RegUnregAccessKey(bool aDoReg);
-
-  nsCOMPtr<nsIXTFElement> mXTFElement;
-
-  uint32_t mNotificationMask;
-  nsCOMPtr<nsIXTFAttributeHandler> mAttributeHandler;
-
-  /*
-   * The intrinsic state of the element.
-   * @see nsIContent::IntrinsicState()
-   */
-  nsEventStates mIntrinsicState;
-
-  // Temporary owner used by GetAttrNameAt
-  nsAttrName mTmpAttrName;
-
-  nsCOMPtr<nsIAtom> mClassAttributeName;
-
-  nsRefPtr<nsXTFClassInfo> mClassInfo;
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(nsXTFElementWrapper, NS_XTFELEMENTWRAPPER_IID)
-
-class nsXTFClassInfo MOZ_FINAL : public nsXPCClassInfo
-{
-public:
-  nsXTFClassInfo(nsXTFElementWrapper* aWrapper) : mWrapper(aWrapper) {}
-
-  void Disconnect() { mWrapper = nullptr; }
-
-  NS_DECL_ISUPPORTS
-  NS_FORWARD_SAFE_NSICLASSINFO(mWrapper);
-  NS_FORWARD_SAFE_NSIXPCSCRIPTABLE(mWrapper);
-
-  // nsXPCClassInfo
-  virtual void PreserveWrapper(nsISupports* aNative)
-  {
-    if (mWrapper) {
-      mWrapper->PreserveWrapper(aNative);
-    }
-  }
-
-  virtual uint32_t GetInterfacesBitmap()
-  {
-    return mWrapper ? mWrapper->GetInterfacesBitmap() : 0;
-  }
-
-private:
-  nsXTFElementWrapper* mWrapper;  
-};
-
-/* [notxpcom,nostdcall] uint32_t getScriptableFlags(); */
-// This method isn't automatically forwarded safely because it's notxpcom, so
-// the IDL binding doesn't know what value to return.
-inline uint32_t
-nsXTFClassInfo::GetScriptableFlags()
-{
-  return mWrapper ? mWrapper->GetScriptableFlags() : 0;
-}
-
-nsresult
-NS_NewXTFElementWrapper(nsIXTFElement* aXTFElement, already_AddRefed<nsINodeInfo> aNodeInfo,
-                        nsIContent** aResult);
-
-#endif // __NS_XTFELEMENTWRAPPER_H__
deleted file mode 100644
--- a/content/xtf/src/nsXTFInterfaceAggregator.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsCOMPtr.h"
-#include "nsXPTCUtils.h"
-#include "nsIInterfaceInfo.h"
-#include "nsIInterfaceInfoManager.h"
-#include "nsServiceManagerUtils.h"
-#include "nsAutoPtr.h"
-#include "mozilla/Attributes.h"
-#ifdef DEBUG
-#include <stdio.h>
-#endif
-
-////////////////////////////////////////////////////////////////////////
-// nsXTFInterfaceAggregator class
-
-class nsXTFInterfaceAggregator MOZ_FINAL : protected nsAutoXPTCStub
-{
-protected:
-  friend nsresult
-  NS_NewXTFInterfaceAggregator(const nsIID& iid,
-                               nsISupports* inner,
-                               nsISupports* outer,
-                               void** result);
-
-  nsXTFInterfaceAggregator(const nsIID& iid,
-                           nsISupports* inner,
-                           nsISupports* outer,
-                           nsresult *rv);
-  ~nsXTFInterfaceAggregator();
-  
-public:
-  // nsISupports interface
-  NS_DECL_ISUPPORTS
-  
-  NS_IMETHOD CallMethod(uint16_t methodIndex,
-                        const XPTMethodDescriptor* info,
-                        nsXPTCMiniVariant* params);
-
-private:
-  nsISupports *mInner;
-  nsISupports *mOuter;
-  nsIID mIID;
-};
-
-//----------------------------------------------------------------------
-// implementation:
-
-nsXTFInterfaceAggregator::nsXTFInterfaceAggregator(const nsIID& iid,
-                                                   nsISupports* inner,
-                                                   nsISupports* outer,
-                                                   nsresult *rv)
-  : mInner(inner), mOuter(outer), mIID(iid)
-{
-#ifdef DEBUG
-//  printf("nsXTFInterfaceAggregator CTOR\n");
-#endif
-  mInner->AddRef();
-  mOuter->AddRef();
-
-  *rv = InitStub(iid);
-}
-
-nsXTFInterfaceAggregator::~nsXTFInterfaceAggregator()
-{
-#ifdef DEBUG
-//  printf("nsXTFInterfaceAggregator DTOR\n");
-#endif
-  mInner->Release();
-  mOuter->Release();
-}
-
-nsresult
-NS_NewXTFInterfaceAggregator(const nsIID& iid,
-                             nsISupports* inner,
-                             nsISupports* outer,
-                             void** aResult){
-  NS_PRECONDITION(aResult != nullptr, "null ptr");
-  if (!aResult)
-    return NS_ERROR_NULL_POINTER;
-
-  nsresult rv;
-
-  nsRefPtr<nsXTFInterfaceAggregator> result =
-    new nsXTFInterfaceAggregator(iid, inner, outer, &rv);
-  if (!result)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  if (NS_FAILED(rv))
-    return rv;
-
-  return result->QueryInterface(iid, aResult);
-}
-
-//----------------------------------------------------------------------
-// nsISupports implementation
-
-NS_IMPL_ADDREF(nsXTFInterfaceAggregator)
-NS_IMPL_RELEASE(nsXTFInterfaceAggregator)
-
-NS_IMETHODIMP
-nsXTFInterfaceAggregator::QueryInterface(REFNSIID aIID, void** aInstancePtr)
-{
-  NS_PRECONDITION(aInstancePtr, "null out param");
-
-  if (aIID.Equals(mIID)) {
-    *aInstancePtr = mXPTCStub;
-    NS_ADDREF_THIS();
-    return NS_OK;
-  }
-
-  return mOuter->QueryInterface(aIID, aInstancePtr);
-}
-
-//----------------------------------------------------------------------
-// nsXPTCStubBase implementation
-
-NS_IMETHODIMP
-nsXTFInterfaceAggregator::CallMethod(uint16_t methodIndex,
-                                     const XPTMethodDescriptor *info,
-                                     nsXPTCMiniVariant* params)
-{
-  NS_ASSERTION(methodIndex >= 3,
-               "huh? indirect nsISupports method call unexpected");
-
-  // prepare args:
-  int paramCount = info->num_args;
-  nsXPTCVariant* fullPars;
-  if (!paramCount) {
-    fullPars = nullptr;
-  }
-  else {
-    fullPars = new nsXPTCVariant[paramCount];
-    if (!fullPars)
-      return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  for (int i=0; i<paramCount; ++i) {
-    const nsXPTParamInfo& paramInfo = info->params[i];
-    uint8_t flags = paramInfo.IsOut() ? nsXPTCVariant::PTR_IS_DATA : 0;
-    fullPars[i].Init(params[i], paramInfo.GetType(), flags);
-  }
-  
-  // make the call:
-  nsresult rv = NS_InvokeByIndex(mInner,
-                                 methodIndex,
-                                 paramCount,
-                                 fullPars);
-  if (fullPars)
-    delete []fullPars;
-  return rv;
-}
deleted file mode 100644
--- a/content/xtf/src/nsXTFInterfaceAggregator.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef __NS_XTFINTERFACEAGGREGATOR_H__
-#define __NS_XTFINTERFACEAGGREGATOR_H__
-
-nsresult
-NS_NewXTFInterfaceAggregator(const nsIID& iid,
-                             nsISupports* inner,
-                             nsISupports* outer,
-                             void** result);
-
-
-#endif // __NS_XTFINTERFACEAGGREGATOR_H__
deleted file mode 100644
--- a/content/xtf/src/nsXTFService.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsCOMPtr.h"
-#include "nsINodeInfo.h"
-#include "nsIServiceManager.h"
-#include "nsIXTFElement.h"
-#include "nsIXTFElementFactory.h"
-#include "nsIXTFService.h"
-#include "nsInterfaceHashtable.h"
-#include "nsString.h"
-#include "nsXTFElementWrapper.h"
-#include "mozilla/Attributes.h"
-
-
-////////////////////////////////////////////////////////////////////////
-// nsXTFService class 
-class nsXTFService MOZ_FINAL : public nsIXTFService
-{
-protected:
-  friend nsresult NS_NewXTFService(nsIXTFService** aResult);
-  
-  nsXTFService();
-
-public:
-  // nsISupports interface
-  NS_DECL_ISUPPORTS
-
-  // nsIXTFService interface
-  nsresult CreateElement(nsIContent** aResult,
-                         already_AddRefed<nsINodeInfo> aNodeInfo);
-
-private:
-  nsInterfaceHashtable<nsUint32HashKey, nsIXTFElementFactory> mFactoryHash;
-};
-
-//----------------------------------------------------------------------
-// implementation:
-
-nsXTFService::nsXTFService()
-{
-  mFactoryHash.Init(); // XXX this can fail. move to Init()
-}
-
-nsresult
-NS_NewXTFService(nsIXTFService** aResult)
-{
-  NS_PRECONDITION(aResult != nullptr, "null ptr");
-  if (! aResult)
-    return NS_ERROR_NULL_POINTER;
-
-  nsXTFService* result = new nsXTFService();
-  if (! result)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  NS_ADDREF(result);
-  *aResult = result;
-  return NS_OK;
-}
-
-//----------------------------------------------------------------------
-// nsISupports methods
-
-NS_IMPL_ISUPPORTS1(nsXTFService, nsIXTFService)
-
-//----------------------------------------------------------------------
-// nsIXTFService methods
-
-nsresult
-nsXTFService::CreateElement(nsIContent** aResult,
-                            already_AddRefed<nsINodeInfo> aNodeInfo)
-{
-  nsCOMPtr<nsIXTFElementFactory> factory;
-
-  // Check if we have an xtf factory for the given namespaceid in our cache:
-  if (!mFactoryHash.Get(aNodeInfo.get()->NamespaceID(), getter_AddRefs(factory))) {
-    // No. See if there is one registered with the component manager:
-    nsAutoCString xtf_contract_id(NS_XTF_ELEMENT_FACTORY_CONTRACTID_PREFIX);
-    nsAutoString uri;
-    aNodeInfo.get()->GetNamespaceURI(uri);
-    AppendUTF16toUTF8(uri, xtf_contract_id);
-#ifdef DEBUG_xtf_verbose
-    printf("Testing for XTF factory at %s\n", xtf_contract_id.get());
-#endif
-    factory = do_GetService(xtf_contract_id.get());
-    if (factory) {
-#ifdef DEBUG
-      printf("We've got an XTF factory: %s \n", xtf_contract_id.get());
-#endif
-      // Put into hash:
-      mFactoryHash.Put(aNodeInfo.get()->NamespaceID(), factory);
-    }
-  }
-  if (!factory) return NS_ERROR_FAILURE;
-
-  // We have an xtf factory. Now try to create an element for the given tag name:
-  nsCOMPtr<nsIXTFElement> elem;
-  nsAutoString tagName;
-  aNodeInfo.get()->GetName(tagName);
-  factory->CreateElement(tagName, getter_AddRefs(elem));
-  if (!elem) return NS_ERROR_FAILURE;
-  
-  // We've got an xtf element. Create a wrapper for it:
-  return NS_NewXTFElementWrapper(elem, aNodeInfo, aResult);
-}
-
deleted file mode 100644
--- a/content/xtf/src/nsXTFWeakTearoff.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsCOMPtr.h"
-#include "nsXPTCUtils.h"
-#include "nsIInterfaceInfo.h"
-#include "nsIInterfaceInfoManager.h"
-#include "nsServiceManagerUtils.h"
-#include "nsAutoPtr.h"
-#include "mozilla/Attributes.h"
-#ifdef DEBUG
-#include <stdio.h>
-#endif
-
-////////////////////////////////////////////////////////////////////////
-// nsXTFWeakTearoff class
-
-class nsXTFWeakTearoff MOZ_FINAL : protected nsAutoXPTCStub
-{
-protected:
-  ~nsXTFWeakTearoff();
-  
-public:
-  nsXTFWeakTearoff(const nsIID& iid,
-                   nsISupports* obj,
-                   nsresult *rv);
-
-  // nsISupports interface
-  NS_DECL_ISUPPORTS
-  
-  NS_IMETHOD CallMethod(uint16_t methodIndex,
-                        const XPTMethodDescriptor* info,
-                        nsXPTCMiniVariant* params);
-
-private:
-  nsISupports *mObj;
-  nsIID mIID;
-};
-
-//----------------------------------------------------------------------
-// implementation:
-
-nsXTFWeakTearoff::nsXTFWeakTearoff(const nsIID& iid,
-                                   nsISupports* obj,
-                                   nsresult *rv)
-  : mObj(obj), mIID(iid)
-{
-  MOZ_COUNT_CTOR(nsXTFWeakTearoff);
-
-  *rv = InitStub(iid);
-}
-
-nsXTFWeakTearoff::~nsXTFWeakTearoff()
-{
-  MOZ_COUNT_DTOR(nsXTFWeakTearoff);
-}
-
-nsresult
-NS_NewXTFWeakTearoff(const nsIID& iid,
-                     nsISupports* obj,
-                     nsISupports** aResult){
-  NS_PRECONDITION(aResult != nullptr, "null ptr");
-  if (!aResult)
-    return NS_ERROR_NULL_POINTER;
-
-  nsresult rv;
-
-  nsRefPtr<nsXTFWeakTearoff> result =
-    new nsXTFWeakTearoff(iid, obj, &rv);
-  if (!result)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  if (NS_FAILED(rv))
-    return rv;
-
-  return result->QueryInterface(iid, (void**) aResult);
-}
-
-//----------------------------------------------------------------------
-// nsISupports implementation
-
-NS_IMPL_ADDREF(nsXTFWeakTearoff)
-NS_IMPL_RELEASE(nsXTFWeakTearoff)
-
-NS_IMETHODIMP
-nsXTFWeakTearoff::QueryInterface(REFNSIID aIID, void** aInstancePtr)
-{
-  NS_PRECONDITION(aInstancePtr, "null out param");
-
-  if (aIID.Equals(mIID) || aIID.Equals(NS_GET_IID(nsISupports))) {
-    *aInstancePtr = mXPTCStub;
-    NS_ADDREF_THIS();
-    return NS_OK;
-  }
-  // we can't map QI onto the obj, because the xpcom wrapper otherwise
-  // QI-accumulates all interfaces defined on mObj
-  //  else return mObj->QueryInterface(aIID, aInstancePtr); 
-  *aInstancePtr = nullptr;
-  return NS_ERROR_NO_INTERFACE;
-}
-
-NS_IMETHODIMP
-nsXTFWeakTearoff::CallMethod(uint16_t methodIndex,
-                             const XPTMethodDescriptor* info,
-                             nsXPTCMiniVariant* params)
-{
-  NS_ASSERTION(methodIndex >= 3,
-               "huh? indirect nsISupports method call unexpected");
-
-  // prepare args:
-  int paramCount = info->num_args;
-  nsXPTCVariant* fullPars;
-  if (!paramCount) {
-    fullPars = nullptr;
-  }
-  else {
-    fullPars = new nsXPTCVariant[paramCount];
-    if (!fullPars)
-      return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  for (int i=0; i<paramCount; ++i) {
-    const nsXPTParamInfo& paramInfo = info->params[i];
-    uint8_t flags = paramInfo.IsOut() ? nsXPTCVariant::PTR_IS_DATA : 0;
-    fullPars[i].Init(params[i], paramInfo.GetType(), flags);
-  }
-  
-  // make the call:
-  nsresult rv = NS_InvokeByIndex(mObj, methodIndex, paramCount, fullPars);
-  if (fullPars)
-    delete []fullPars;
-  return rv;
-}
deleted file mode 100644
--- a/content/xtf/src/nsXTFWeakTearoff.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef __NS_XTFWEAKTEAROFF_H__
-#define __NS_XTFWEAKTEAROFF_H__
-
-nsresult
-NS_NewXTFWeakTearoff(const nsIID& iid,
-                     nsISupports* obj,
-                     nsISupports** result);
-
-
-#endif // __NS_XTFWEAKTEAROFF_H__
deleted file mode 100644
--- a/content/xtf/test/Makefile.in
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# 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/.
-
-#
-# Makefile for installing and running xpcshell-based tests. You can use
-# this file as template when creating tests for a new module. Don't
-# forget to change the lines marked below. See
-# http://developer.mozilla.org/en/docs/Writing_xpcshell-based_unit_tests
-# for detailed instructions.
-#
-
-# Note: DEPTH should be set to the relative path to mozilla/
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-relativesrcdir = @relativesrcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-# Note: set the test module's name to test_<yourmodule>
-MODULE		= test_xtf
-
-XPCSHELL_TESTS  = unit
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/content/xtf/test/unit/test_xtf.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* 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/. */
-
-function run_test() {
-  const C_i = Components.interfaces;
-  const nsIXTFElementFactory = C_i.nsIXTFElementFactory;
-  const nsIXTFPrivate        = C_i.nsIXTFPrivate;
-  const nsIDOMParser         = C_i.nsIDOMParser;
-  const nsIDOMEventTarget    = C_i.nsIDOMEventTarget;
-  do_load_manifest("xtfComponent.manifest");
-  const xtfClass = "@mozilla.org/xtf/element-factory;1?namespace=";
-
-  do_check_true(xtfClass + "xtf-tests;foo" in Components.classes);
-  var fooFactory = Components.classes[xtfClass + "xtf-tests;foo"]
-                             .getService(nsIXTFElementFactory);
-  do_check_true(Boolean(fooFactory));
-
-  var xmlSource = "<bar xmlns='xtf-tests;foo'/>";
-  const parser     = Components.classes["@mozilla.org/xmlextras/domparser;1"]
-                               .createInstance(nsIDOMParser);
-  var xmlDoc = parser.parseFromString(xmlSource, "application/xml");
-  do_check_true(xmlDoc.documentElement instanceof nsIXTFPrivate);
-  do_check_true(xmlDoc.documentElement instanceof nsIDOMEventTarget);
-
-  do_check_true(xmlDoc.documentElement.inner.wrappedJSObject.testpassed);
-
-  // Bug 378247
-  xmlDoc.documentElement.addEventListener("DOMNodeInserted",
-    function foo() {
-      dump('This is a DOMNodeInserted test.\n');
-    },
-    true);
-  xmlDoc.documentElement.appendChild(xmlDoc.createTextNode("bar"));
-  do_check_true(xmlDoc.documentElement.inner.wrappedJSObject.testpassed);
-
-  xmlSource = "<handle_default xmlns='xtf-tests;foo'/>";
-  xmlDoc = parser.parseFromString(xmlSource, "application/xml");
-  do_check_true(xmlDoc.documentElement instanceof nsIXTFPrivate);
-  do_check_true(xmlDoc.documentElement instanceof nsIDOMEventTarget);
-
-  // Bug 378247
-  xmlDoc.documentElement.addEventListener("DOMNodeInserted",
-    function foo() {
-      dump('This is a DOMNodeInserted test.\n');
-    },
-    true);
-  xmlDoc.documentElement.appendChild(xmlDoc.createTextNode("bar"));
-  do_check_true(xmlDoc.documentElement.inner.wrappedJSObject.testpassed);
-}
deleted file mode 100644
--- a/content/xtf/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[DEFAULT]
-head = 
-tail = 
-
-[test_xtf.js]
deleted file mode 100644
--- a/content/xtf/test/unit/xtfComponent.js
+++ /dev/null
@@ -1,155 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-// Utility function.
-function NOT_IMPLEMENTED() {
-  throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-}
-
-const C_i = Components.interfaces;
-
-const nsIXTFElementFactory        = C_i.nsIXTFElementFactory;
-const nsIXTFElement               = C_i.nsIXTFElement;
-const nsIXTFPrivate               = C_i.nsIXTFPrivate;
-const nsIXTFAttributeHandler      = C_i.nsIXTFAttributeHandler;
-const mozIJSSubScriptLoader       = C_i.mozIJSSubScriptLoader;
-const nsIProgrammingLanguage      = C_i.nsIProgrammingLanguage;
-const nsIClassInfo                = C_i.nsIClassInfo;
-const nsIComponentRegistrar       = C_i.nsIComponentRegistrar;
-const nsIFactory                  = C_i.nsIFactory;
-const nsIModule                   = C_i.nsIModule;
-const nsISupports                 = C_i.nsISupports;
-
-/**
- * Wrap a JavaScript object for passing to components code.
- */
-function ObjectWrapper(object) {
-  this.wrappedJSObject = object;
-}
-
-/* <foo:element xmlns:foo="xtf-tests;foo"> */
-const FooInner = {
-  bar: {
-    testpassed: true
-  },
-
-  handle_default: {
-    testpassed: false
-  }
-}
-
-function FooElement(aLocalName) {
-  this._wrapper = null;
-
-  // nsIXTFPrivate
-  this.inner = new ObjectWrapper(FooInner[aLocalName]);
-}
-FooElement.prototype =
-{
-  // nsIXTFElement
-  onCreated: function onCreated(aWrapper) {
-    this._wrapper = aWrapper;
-    aWrapper.notificationMask = 0;
-  },
-
-  // nsIXTFElement
-  onDestroyed: function onDestroyed() {
-  },
-
-  // nsIXTFElement
-  isAttributeHandler: false,
-
-  // nsIXTFElement
-  getScriptingInterfaces: function getScriptingInterfaces(aCount) {
-    var interfaces = [];
-    aCount.value = interfaces.length;
-    return interfaces;
-  },
-
-  // nsIXTFElement
-  willChangeDocument: NOT_IMPLEMENTED,
-  documentChanged: NOT_IMPLEMENTED,
-  willChangeParent: NOT_IMPLEMENTED,
-  parentChanged: NOT_IMPLEMENTED,
-  willInsertChild: NOT_IMPLEMENTED,
-  childInserted: NOT_IMPLEMENTED,
-  willAppendChild: NOT_IMPLEMENTED,
-  childAppended: NOT_IMPLEMENTED,
-  willRemoveChild: NOT_IMPLEMENTED,
-  childRemoved: NOT_IMPLEMENTED,
-  willSetAttribute: NOT_IMPLEMENTED,
-  attributeSet: NOT_IMPLEMENTED,
-  willRemoveAttribute: NOT_IMPLEMENTED,
-  attributeRemoved: NOT_IMPLEMENTED,
-
-  beginAddingChildren: NOT_IMPLEMENTED,
-  doneAddingChildren: NOT_IMPLEMENTED,
-
-  handleDefault: NOT_IMPLEMENTED,
-  cloneState: NOT_IMPLEMENTED,
-
-  get accesskeyNode() {
-    return null;
-  },
-  performAccesskey: NOT_IMPLEMENTED,
-
-  // nsISupports
-  QueryInterface: function QueryInterface(aIID) {
-    if (aIID.equals(nsIXTFPrivate) ||
-        aIID.equals(nsIXTFElement) ||
-        aIID.equals(nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-    return null;
-  }
-};
-
-function FooElementFactory() {}
-FooElementFactory.prototype =
-{
-  classID: Components.ID("{f367b65d-6b7f-4a7f-9a4b-8bde0ff4ef10}"),
-
-  // nsIXTFElementFactory
-  createElement: function createElement(aLocalName) {
-    var rv = null;
-    switch (aLocalName) {
-      case "bar":
-        rv = new FooElement(aLocalName);
-        rv.handleDefault = function handleDefault(aEvent) {
-          this.inner.wrappedJSObject.testpassed = false;
-        }
-        break;
-
-      case "handle_default":
-        var rv = new FooElement(aLocalName);
-        rv.onCreated = function onCreated(aWrapper) {
-          this._wrapper = aWrapper;
-          aWrapper.notificationMask = nsIXTFElement.NOTIFY_HANDLE_DEFAULT;
-        }
-        rv.handleDefault = function handleDefault(aEvent) {
-          this.inner.wrappedJSObject.testpassed = true;
-        }
-        break;
-    }
-
-    return rv ? rv.QueryInterface(nsIXTFElement) : null;
-  },
-
-  // nsISupports
-  QueryInterface: function QueryInterface(aIID) {
-    if (aIID.equals(nsIXTFElementFactory) ||
-        aIID.equals(nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-    return null;
-  }
-};
-
-/* </foo:element> */
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FooElementFactory]);
deleted file mode 100644
--- a/content/xtf/test/unit/xtfComponent.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {f367b65d-6b7f-4a7f-9a4b-8bde0ff4ef10} xtfComponent.js
-contract @mozilla.org/xtf/element-factory;1?namespace=xtf-tests;foo {f367b65d-6b7f-4a7f-9a4b-8bde0ff4ef10}
--- a/content/xul/document/src/nsXULDocument.cpp
+++ b/content/xul/document/src/nsXULDocument.cpp
@@ -2845,22 +2845,16 @@ nsXULDocument::ResumeWalk()
                             NS_ASSERTION(ssle, "<html:style> doesn't implement "
                                                "nsIStyleSheetLinkingElement?");
                             bool willNotify;
                             bool isAlternate;
                             ssle->UpdateStyleSheet(nullptr, &willNotify,
                                                    &isAlternate);
                         }
                     }
-
-#ifdef MOZ_XTF
-                    if (element->GetNameSpaceID() > kNameSpaceID_LastBuiltin) {
-                        element->DoneAddingChildren(false);
-                    }
-#endif
                 }
                 // Now pop the context stack back up to the parent
                 // element and continue the prototype walk.
                 mContextStack.Pop();
                 continue;
             }
 
             // Grab the next child, and advance the current context stack
@@ -2921,22 +2915,16 @@ nsXULDocument::ResumeWalk()
                 }
                 else {
                     if (mState == eState_Master) {
                         // If there are no children, and we're in the
                         // master document, do post-order document hookup
                         // immediately.
                         AddElementToDocumentPost(child);
                     }
-#ifdef MOZ_XTF
-                    if (child &&
-                        child->GetNameSpaceID() > kNameSpaceID_LastBuiltin) {
-                        child->DoneAddingChildren(false);
-                    }
-#endif
                 }
             }
             break;
 
             case nsXULPrototypeNode::eType_Script: {
                 // A script reference. Execute the script immediately;
                 // this may have side effects in the content model.
                 nsXULPrototypeScript* scriptproto =
@@ -3631,22 +3619,16 @@ nsXULDocument::CreateElementFromPrototyp
         nsCOMPtr<nsINodeInfo> xtfNi = newNodeInfo;
         rv = NS_NewElement(getter_AddRefs(content), newNodeInfo.forget(),
                            NOT_FROM_PARSER);
         if (NS_FAILED(rv))
             return rv;
 
         result = content->AsElement();
 
-#ifdef MOZ_XTF
-        if (result && xtfNi->NamespaceID() > kNameSpaceID_LastBuiltin) {
-            result->BeginAddingChildren();
-        }
-#endif
-
         rv = AddAttributes(aPrototype, result);
         if (NS_FAILED(rv)) return rv;
     }
 
     result.swap(*aResult);
 
     return NS_OK;
 }
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -232,22 +232,16 @@ SHARED_LIBRARY_LIBS += \
 		$(NULL)
 endif
 
 LOCAL_INCLUDES  += \
       -I$(srcdir)/../inspector/src \
       $(NULL)
 SHARED_LIBRARY_LIBS += ../inspector/src/$(LIB_PREFIX)inspector_s.$(LIB_SUFFIX)
 
-ifdef MOZ_XTF
-SHARED_LIBRARY_LIBS += \
-		$(DEPTH)/content/xtf/src/$(LIB_PREFIX)gkcontentxtf_s.$(LIB_SUFFIX) \
-		$(NULL)
-endif
-
 SHARED_LIBRARY_LIBS += \
 		../svg/$(LIB_PREFIX)gksvgbase_s.$(LIB_SUFFIX) \
 		$(DEPTH)/content/svg/document/src/$(LIB_PREFIX)gkconsvgdoc_s.$(LIB_SUFFIX) \
 		$(DEPTH)/content/svg/content/src/$(LIB_PREFIX)gkcontentsvg_s.$(LIB_SUFFIX) \
 		$(DEPTH)/content/smil/$(LIB_PREFIX)gkconsmil_s.$(LIB_SUFFIX) \
 		$(NULL)
 
 ifdef ENABLE_EDITOR_API_LOG
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -219,21 +219,16 @@ nsresult
 NS_NewXULContentBuilder(nsISupports* aOuter, REFNSIID aIID, void** aResult);
 
 nsresult
 NS_NewXULTreeBuilder(nsISupports* aOuter, REFNSIID aIID, void** aResult);
 #endif
 
 static void Shutdown();
 
-#ifdef MOZ_XTF
-#include "nsIXTFService.h"
-#include "nsIXMLContentBuilder.h"
-#endif
-
 #include "nsGeolocation.h"
 #include "nsDeviceSensors.h"
 #include "nsCSPService.h"
 #include "nsISmsService.h"
 #include "nsISmsDatabaseService.h"
 #include "mozilla/dom/sms/SmsServicesFactory.h"
 #include "nsIPowerManagerService.h"
 #include "nsIAlarmHalService.h"
@@ -542,20 +537,16 @@ MAKE_CTOR(CreatePlainTextSerializer,    
 MAKE_CTOR(CreateContentPolicy,            nsIContentPolicy,            NS_NewContentPolicy)
 #ifdef MOZ_XUL
 MAKE_CTOR(CreateXULSortService,           nsIXULSortService,           NS_NewXULSortService)
 // NS_NewXULContentBuilder
 // NS_NewXULTreeBuilder
 MAKE_CTOR(CreateXULDocument,              nsIXULDocument,              NS_NewXULDocument)
 // NS_NewXULControllers
 #endif
-#ifdef MOZ_XTF
-MAKE_CTOR(CreateXTFService,               nsIXTFService,               NS_NewXTFService)
-MAKE_CTOR(CreateXMLContentBuilder,        nsIXMLContentBuilder,        NS_NewXMLContentBuilder)
-#endif
 MAKE_CTOR(CreateContentDLF,               nsIDocumentLoaderFactory,    NS_NewContentDocumentLoaderFactory)
 MAKE_CTOR(CreateEventListenerService,     nsIEventListenerService,     NS_NewEventListenerService)
 MAKE_CTOR(CreateGlobalMessageManager,     nsIMessageBroadcaster,       NS_NewGlobalMessageManager)
 MAKE_CTOR(CreateParentMessageManager,     nsIMessageBroadcaster,       NS_NewParentProcessMessageManager)
 MAKE_CTOR(CreateChildMessageManager,      nsISyncMessageSender,        NS_NewChildProcessMessageManager)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDataDocumentContentPolicy)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoDataProtocolContentPolicy)
 MAKE_CTOR(CreatePluginDocument,           nsIDocument,                 NS_NewPluginDocument)
@@ -740,20 +731,16 @@ NS_DEFINE_NAMED_CID(NS_DATADOCUMENTCONTE
 NS_DEFINE_NAMED_CID(NS_NODATAPROTOCOLCONTENTPOLICY_CID);
 NS_DEFINE_NAMED_CID(NS_XULCONTROLLERS_CID);
 #ifdef MOZ_XUL
 NS_DEFINE_NAMED_CID(NS_XULSORTSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_XULTEMPLATEBUILDER_CID);
 NS_DEFINE_NAMED_CID(NS_XULTREEBUILDER_CID);
 NS_DEFINE_NAMED_CID(NS_XULDOCUMENT_CID);
 #endif
-#ifdef MOZ_XTF
-NS_DEFINE_NAMED_CID(NS_XTFSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_XMLCONTENTBUILDER_CID);
-#endif
 NS_DEFINE_NAMED_CID(NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID);
 NS_DEFINE_NAMED_CID(NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
 NS_DEFINE_NAMED_CID(NS_JSPROTOCOLHANDLER_CID);
 NS_DEFINE_NAMED_CID(NS_JSURI_CID);
 NS_DEFINE_NAMED_CID(NS_WINDOWCOMMANDTABLE_CID);
 NS_DEFINE_NAMED_CID(NS_WINDOWCONTROLLER_CID);
 NS_DEFINE_NAMED_CID(NS_VIEW_MANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_PLUGINDOCLOADERFACTORY_CID);
@@ -1025,20 +1012,16 @@ static const mozilla::Module::CIDEntry k
   { &kNS_NODATAPROTOCOLCONTENTPOLICY_CID, false, NULL, nsNoDataProtocolContentPolicyConstructor },
   { &kNS_XULCONTROLLERS_CID, false, NULL, NS_NewXULControllers },
 #ifdef MOZ_XUL
   { &kNS_XULSORTSERVICE_CID, false, NULL, CreateXULSortService },
   { &kNS_XULTEMPLATEBUILDER_CID, false, NULL, NS_NewXULContentBuilder },
   { &kNS_XULTREEBUILDER_CID, false, NULL, NS_NewXULTreeBuilder },
   { &kNS_XULDOCUMENT_CID, false, NULL, CreateXULDocument },
 #endif
-#ifdef MOZ_XTF
-  { &kNS_XTFSERVICE_CID, false, NULL, CreateXTFService },
-  { &kNS_XMLCONTENTBUILDER_CID, false, NULL, CreateXMLContentBuilder },
-#endif
   { &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID, false, NULL, CreateContentDLF },
   { &kNS_DOM_SCRIPT_OBJECT_FACTORY_CID, false, NULL, nsDOMScriptObjectFactoryConstructor },
   { &kNS_JSPROTOCOLHANDLER_CID, false, NULL, nsJSProtocolHandler::Create },
   { &kNS_JSURI_CID, false, NULL, nsJSURIConstructor },
   { &kNS_WINDOWCOMMANDTABLE_CID, false, NULL, CreateWindowCommandTableConstructor },
   { &kNS_WINDOWCONTROLLER_CID, false, NULL, CreateWindowControllerWithSingletonCommandTable },
   { &kNS_VIEW_MANAGER_CID, false, NULL, nsViewManagerConstructor },
   { &kNS_PLUGINDOCLOADERFACTORY_CID, false, NULL, CreateContentDLF },
@@ -1180,20 +1163,16 @@ static const mozilla::Module::ContractID
   { NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID, &kNS_NODATAPROTOCOLCONTENTPOLICY_CID },
   { "@mozilla.org/xul/xul-controllers;1", &kNS_XULCONTROLLERS_CID },
 #ifdef MOZ_XUL
   { "@mozilla.org/xul/xul-sort-service;1", &kNS_XULSORTSERVICE_CID },
   { "@mozilla.org/xul/xul-template-builder;1", &kNS_XULTEMPLATEBUILDER_CID },
   { "@mozilla.org/xul/xul-tree-builder;1", &kNS_XULTREEBUILDER_CID },
   { "@mozilla.org/xul/xul-document;1", &kNS_XULDOCUMENT_CID },
 #endif
-#ifdef MOZ_XTF
-  { NS_XTFSERVICE_CONTRACTID, &kNS_XTFSERVICE_CID },
-  { NS_XMLCONTENTBUILDER_CONTRACTID, &kNS_XMLCONTENTBUILDER_CID },
-#endif
   { CONTENT_DLF_CONTRACTID, &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID },
   { NS_JSPROTOCOLHANDLER_CONTRACTID, &kNS_JSPROTOCOLHANDLER_CID },
   { NS_WINDOWCONTROLLER_CONTRACTID, &kNS_WINDOWCONTROLLER_CID },
   { "@mozilla.org/view-manager;1", &kNS_VIEW_MANAGER_CID },
   { PLUGIN_DLF_CONTRACTID, &kNS_PLUGINDOCLOADERFACTORY_CID },
   { NS_STYLESHEETSERVICE_CONTRACTID, &kNS_STYLESHEETSERVICE_CID },
   { TRANSFORMIIX_XSLT_PROCESSOR_CONTRACTID, &kTRANSFORMIIX_XSLT_PROCESSOR_CID },
   { NS_XPATH_EVALUATOR_CONTRACTID, &kTRANSFORMIIX_XPATH_EVALUATOR_CID },
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -91,17 +91,16 @@
 @BINPATH@/components/commandlines.xpt
 @BINPATH@/components/composer.xpt
 @BINPATH@/components/content_base.xpt
 @BINPATH@/components/content_events.xpt
 @BINPATH@/components/content_canvas.xpt
 @BINPATH@/components/content_htmldoc.xpt
 @BINPATH@/components/content_html.xpt
 @BINPATH@/components/content_xslt.xpt
-@BINPATH@/components/content_xtf.xpt
 @BINPATH@/components/cookie.xpt
 @BINPATH@/components/directory.xpt
 @BINPATH@/components/docshell.xpt
 @BINPATH@/components/dom.xpt
 @BINPATH@/components/dom_apps.xpt
 @BINPATH@/components/dom_base.xpt
 @BINPATH@/components/dom_battery.xpt
 @BINPATH@/components/dom_camera.xpt
--- a/mobile/xul/installer/package-manifest.in
+++ b/mobile/xul/installer/package-manifest.in
@@ -146,17 +146,16 @@
 @BINPATH@/components/commandlines.xpt
 @BINPATH@/components/composer.xpt
 @BINPATH@/components/content_base.xpt
 @BINPATH@/components/content_events.xpt
 @BINPATH@/components/content_canvas.xpt
 @BINPATH@/components/content_htmldoc.xpt
 @BINPATH@/components/content_html.xpt
 @BINPATH@/components/content_xslt.xpt
-@BINPATH@/components/content_xtf.xpt
 @BINPATH@/components/cookie.xpt
 @BINPATH@/components/directory.xpt
 @BINPATH@/components/docshell.xpt
 @BINPATH@/components/dom.xpt
 @BINPATH@/components/dom_base.xpt
 #ifdef MOZ_B2G_RIL
 @BINPATH@/components/dom_telephony.xpt
 @BINPATH@/components/dom_wifi.xpt
--- a/testing/xpcshell/xpcshell.ini
+++ b/testing/xpcshell/xpcshell.ini
@@ -16,17 +16,16 @@
 [include:dom/network/tests/unit/xpcshell.ini]
 [include:dom/network/tests/unit_ipc/xpcshell.ini]
 [include:dom/network/tests/unit_stats/xpcshell.ini]
 [include:dom/permission/tests/unit/xpcshell.ini]
 [include:dom/src/json/test/unit/xpcshell.ini]
 [include:dom/system/gonk/tests/xpcshell.ini]
 [include:dom/tests/unit/xpcshell.ini]
 [include:dom/indexedDB/test/unit/xpcshell.ini]
-[include:content/xtf/test/unit/xpcshell.ini]
 [include:docshell/test/unit/xpcshell.ini]
 [include:docshell/test/unit_ipc/xpcshell.ini]
 [include:embedding/tests/unit/xpcshell.ini]
 [include:toolkit/components/commandlines/test/unit/xpcshell.ini]
 [include:toolkit/components/contentprefs/tests/unit/xpcshell.ini]
 [include:toolkit/devtools/debugger/tests/unit/xpcshell.ini]
 [include:toolkit/devtools/sourcemap/tests/unit/xpcshell.ini]
 [include:toolkit/components/passwordmgr/test/unit/xpcshell.ini]
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -1073,21 +1073,16 @@ if [ "$ENABLE_TESTS" ]; then
     fi
   fi
   if [ "$MOZ_URL_CLASSIFIER" ]; then
     add_makefiles "
       toolkit/components/url-classifier/tests/Makefile
       toolkit/components/url-classifier/tests/mochitest/Makefile
     "
   fi
-  if [ "$MOZ_XTF" ]; then
-    add_makefiles "
-      content/xtf/test/Makefile
-    "
-  fi
   if [ "$MOZ_XUL" ]; then
     add_makefiles "
       content/xul/templates/tests/chrome/Makefile
       toolkit/components/autocomplete/tests/Makefile
     "
   fi
   if [ "$MOZ_ZIPWRITER" ]; then
     add_makefiles "