Bug 1447707 - Remove the XPIDL SAX interface to the XML parser. r=peterv
authorHenri Sivonen <hsivonen@hsivonen.fi>
Wed, 19 Dec 2018 16:49:31 +0000
changeset 509993 cc4350821ea2def4ed60e47e0eaad5e82403fb4d
parent 509992 bf1e3f284efb0f13ef3909750f100a3a027c112a
child 510014 1f7a8905fa7cf88143161cb9c65ca69cb1daec65
child 510015 d9ae6a8272b04b0f2ae5a76242436acae163cf55
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1447707
milestone66.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
Bug 1447707 - Remove the XPIDL SAX interface to the XML parser. r=peterv Differential Revision: https://phabricator.services.mozilla.com/D14724
parser/htmlparser/nsParserModule.cpp
parser/xml/moz.build
parser/xml/nsISAXAttributes.idl
parser/xml/nsISAXContentHandler.idl
parser/xml/nsISAXErrorHandler.idl
parser/xml/nsISAXXMLReader.idl
parser/xml/nsSAXAttributes.cpp
parser/xml/nsSAXAttributes.h
parser/xml/nsSAXXMLReader.cpp
parser/xml/nsSAXXMLReader.h
parser/xml/test/unit/test_parser.js
parser/xml/test/unit/xpcshell.ini
--- a/parser/htmlparser/nsParserModule.cpp
+++ b/parser/htmlparser/nsParserModule.cpp
@@ -2,49 +2,42 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ModuleUtils.h"
 #include "nsParser.h"
 #include "nsParserCIID.h"
 #include "nsHTMLTags.h"
-#include "nsSAXXMLReader.h"
 
 //----------------------------------------------------------------------
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsSAXXMLReader)
 
 NS_DEFINE_NAMED_CID(NS_PARSER_CID);
-NS_DEFINE_NAMED_CID(NS_SAXXMLREADER_CID);
 
 static const mozilla::Module::CIDEntry kParserCIDs[] = {
     {&kNS_PARSER_CID, false, nullptr, nsParserConstructor},
-    {&kNS_SAXXMLREADER_CID, false, nullptr, nsSAXXMLReaderConstructor},
     {nullptr}};
 
-static const mozilla::Module::ContractIDEntry kParserContracts[] = {
-    {NS_SAXXMLREADER_CONTRACTID, &kNS_SAXXMLREADER_CID}, {nullptr}};
-
 static nsresult Initialize() {
   nsresult rv = nsHTMLTags::AddRefTable();
   NS_ENSURE_SUCCESS(rv, rv);
 
 #ifdef DEBUG
   CheckElementTable();
   nsHTMLTags::TestTagTable();
 #endif
 
   return rv;
 }
 
 static void Shutdown() { nsHTMLTags::ReleaseTable(); }
 
 static mozilla::Module kParserModule = {mozilla::Module::kVersion,
                                         kParserCIDs,
-                                        kParserContracts,
+                                        nullptr,
                                         nullptr,
                                         nullptr,
                                         Initialize,
                                         Shutdown};
 
 NSMODULE_DEFN(nsParserModule) = &kParserModule;
--- a/parser/xml/moz.build
+++ b/parser/xml/moz.build
@@ -1,31 +1,10 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 with Files('**'):
-    BUG_COMPONENT = ('Core', 'XML')
+    BUG_COMPONENT = ('Core', 'HTML: Parser')
 
 TEST_DIRS += ['test']
-
-XPIDL_SOURCES += [
-    'nsISAXAttributes.idl',
-    'nsISAXContentHandler.idl',
-    'nsISAXErrorHandler.idl',
-    'nsISAXXMLReader.idl',
-]
-
-XPIDL_MODULE = 'saxparser'
-
-EXPORTS += [
-    'nsSAXAttributes.h',
-    'nsSAXXMLReader.h',
-]
-
-UNIFIED_SOURCES += [
-    'nsSAXAttributes.cpp',
-    'nsSAXXMLReader.cpp',
-]
-
-FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/parser/xml/nsISAXAttributes.idl
+++ /dev/null
@@ -1,150 +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 "nsISupports.idl"
-
-/**
- * Interface for a list of XML attributes.
- *
- * This interface allows access to a list of attributes in
- * three different ways:
- *
- * 1.) by attribute index;
- * 2.) by Namespace-qualified name; or
- * 3.) by XML qualified name.
- *
- * The list will not contain attributes that were declared #IMPLIED
- * but not specified in the start tag.  It will also not contain
- * attributes used as Namespace declarations (xmlns*) unless the
- * http://xml.org/sax/features/namespace-prefixes feature
- * is set to true (it is false by default).
- *
- * The order of attributes in the list is unspecified.
- */
-[scriptable, uuid(e347005e-6cd0-11da-be43-001422106990)]
-interface nsISAXAttributes : nsISupports
-{
-  /**
-   * Look up the index of an attribute by Namespace name.
-   * @param uri The Namespace URI, or the empty string
-   *            if the name has no Namespace URI.
-   * @param localName The attribute's local name.
-   * @return The index of the attribute, or -1
-   *         if it does not appear in the list.
-   */
-  long getIndexFromName(in AString uri, in AString localName);
-
-  /**
-   * Look up the index of an attribute by XML qualified name.
-   * @param qName The qualified name.
-   * @return The index of the attribute, or -1
-   *         if it does not appear in the list.
-   */
-  long getIndexFromQName(in AString qName);
-
-  /**
-   * Return the number of attributes in the list. Once you know the
-   * number of attributes, you can iterate through the list.
-   *
-   * @return The number of attributes in the list.
-   */
-  readonly attribute long length;
-
-  /**
-   * Look up an attribute's local name by index.
-   * @param index The attribute index (zero-based).
-   * @return The local name, or null if the index is out of range.
-   */
-  AString getLocalName(in unsigned long index);
-
-  /**
-   * Look up an attribute's XML qualified name by index.
-   * @param index The attribute index (zero-based).
-   * @return The XML qualified name, or the empty string if none is
-   *         available, or null if the index is out of range.
-   */
-  AString getQName(in unsigned long index);
-
-  /**
-   * Look up an attribute's type by index. The attribute type is one
-   * of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN",
-   * "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION" (always in upper
-   * case). If the parser has not read a declaration for the
-   * attribute, or if the parser does not report attribute types, then
-   * it must return the value "CDATA" as stated in the XML 1.0
-   * Recommendation (clause 3.3.3, "Attribute-Value
-   * Normalization"). For an enumerated attribute that is not a
-   * notation, the parser will report the type as "NMTOKEN".
-   *
-   * @param index The attribute index (zero-based).
-   * @return The attribute's type as a string, or null if the index is
-   *         out of range.
-   */
-  AString getType(in unsigned long index);
-
-  /**
-   * Look up an attribute's type by Namespace name.
-   * @param uri The Namespace URI, or the empty string
-   *             if the name has no Namespace URI.
-   * @param localName The attribute's local name.
-   * @return The attribute type as a string, or null if the attribute
-   *         is not in the list.
-   */
-  AString getTypeFromName(in AString uri, in AString localName);
-
-  /**
-   * Look up an attribute's type by XML qualified name.
-   * @param qName The qualified name.
-   * @return The attribute type as a string, or null if the attribute
-   *         is not in the list.
-   */
-  AString getTypeFromQName(in AString qName);
-
-  /**
-   * Look up an attribute's Namespace URI by index.
-   * @param index The attribute index (zero-based).
-   * @return The Namespace URI, or the empty string if none is available,
-   *         or null if the index is out of range.
-   */
-  AString getURI(in unsigned long index);
-
-  /**
-   * Look up an attribute's value by index.  If the attribute value is
-   * a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens will
-   * be concatenated into a single string with each token separated by
-   * a single space.
-   *
-   * @param index The attribute index (zero-based).
-   * @return The attribute's value as a string, or null if the index is
-   *         out of range.
-   */
-  AString getValue(in unsigned long index);
-
-  /**
-   * Look up an attribute's value by Namespace name.  If the attribute
-   * value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the
-   * tokens will be concatenated into a single string with each token
-   * separated by a single space.
-   *
-   * @param uri The Namespace URI, or the empty string
-   *             if the name has no Namespace URI.
-   * @param localName The attribute's local name.
-   * @return The attribute's value as a string, or null if the attribute is
-   *         not in the list.
-   */
-  AString getValueFromName(in AString uri, in AString localName);
-
-  /**
-   * Look up an attribute's value by XML qualified (prefixed) name.
-   * If the attribute value is a list of tokens (IDREFS, ENTITIES, or
-   * NMTOKENS), the tokens will be concatenated into a single string
-   * with each token separated by a single space.
-   *
-   * @param qName The qualified (prefixed) name.
-   * @return The attribute's value as a string, or null if the attribute is
-   *         not in the list.
-   */
-  AString getValueFromQName(in AString qName);
-};
deleted file mode 100644
--- a/parser/xml/nsISAXContentHandler.idl
+++ /dev/null
@@ -1,164 +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 "nsISupports.idl"
-
-interface nsISAXAttributes;
-
-/**
- * Receive notification of the logical content of a document.
- *
- * This is the main interface that most SAX applications implement: if
- * the application needs to be informed of basic parsing events, it
- * implements this interface and registers an instance with the SAX
- * parser.  The parser uses the instance to report basic
- * document-related events like the start and end of elements and
- * character data.
- *
- * The order of events in this interface is very important, and
- * mirrors the order of information in the document itself.  For
- * example, all of an element's content (character data, processing
- * instructions, and/or subelements) will appear, in order, between
- * the startElement event and the corresponding endElement event.
- */
-[scriptable, uuid(2a99c757-dfee-4806-bff3-f721440412e0)]
-interface nsISAXContentHandler : nsISupports
-{
-  /**
-   * Receive notification of the beginning of a document.
-   *
-   * The SAX parser will invoke this method only once, before any
-   * other event callbacks.
-   */
-  void startDocument();
-
-  /**
-   * Receive notification of the end of a document.
-   *
-   * There is an apparent contradiction between the documentation for
-   * this method and the documentation for ErrorHandler.fatalError().
-   * Until this ambiguity is resolved in a future major release,
-   * clients should make no assumptions about whether endDocument()
-   * will or will not be invoked when the parser has reported a
-   * fatalError() or thrown an exception.
-   *
-   * The SAX parser will invoke this method only once, and it will be
-   * the last method invoked during the parse.  The parser shall not
-   * invoke this method until it has either abandoned parsing (because
-   * of an unrecoverable error) or reached the end of input.
-   */
-  void endDocument();
-  
-  /**
-   * Receive notification of the beginning of an element.
-   *
-   * The Parser will invoke this method at the beginning of every
-   * element in the XML document; there will be a corresponding
-   * endElement event for every startElement event (even when the
-   * element is empty). All of the element's content will be reported,
-   * in order, before the corresponding endElement event.
-   *
-   * This event allows up to three name components for each element:
-   *
-   * 1.) the Namespace URI;
-   * 2.) the local name; and
-   * 3.) the qualified (prefixed) name.
-   *
-   * Any or all of these may be provided, depending on the values of
-   * the http://xml.org/sax/features/namespaces and the
-   * http://xml.org/sax/features/namespace-prefixes properties:
-   *
-   * The Namespace URI and local name are required when the namespaces
-   * property is true (the default), and are optional when the
-   * namespaces property is false (if one is specified, both must be);
-   *
-   * The qualified name is required when the namespace-prefixes
-   * property is true, and is optional when the namespace-prefixes
-   * property is false (the default).
-   *
-   * Note that the attribute list provided will contain only
-   * attributes with explicit values (specified or defaulted):
-   * #IMPLIED attributes will be omitted.  The attribute list will
-   * contain attributes used for Namespace declarations (xmlns*
-   * attributes) only if the
-   * http://xml.org/sax/features/namespace-prefixes property is true
-   * (it is false by default, and support for a true value is
-   * optional).
-   *
-   * @param uri the Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed
-   * @param localName the local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed
-   * @param qName the qualified name (with prefix), or the
-   *        empty string if qualified names are not available
-   * @param atts the attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        SAXAttributes object.  The value of this object after
-   *        startElement returns is undefined
-   */
-  void startElement(in AString uri, in AString localName,
-                    in AString qName, in nsISAXAttributes attributes);
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * The SAX parser will invoke this method at the end of every
-   * element in the XML document; there will be a corresponding
-   * startElement event for every endElement event (even when the
-   * element is empty).
-   *
-   * For information on the names, see startElement.
-   *
-   * @param uri the Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed
-   * @param localName the local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed
-   * @param qName the qualified XML name (with prefix), or the
-   *        empty string if qualified names are not available
-   */
-  void endElement(in AString uri, in AString localName, in AString qName);
-
-  /**
-   * Receive notification of character data.
-   *
-   * The Parser will call this method to report each chunk of
-   * character data.  SAX parsers may return all contiguous character
-   * data in a single chunk, or they may split it into several chunks;
-   * however, all of the characters in any single event must come from
-   * the same external entity so that the Locator provides useful
-   * information.
-   *
-   * Note that some parsers would report whitespace in element
-   * content using the ignorableWhitespace method rather than this one
-   * (validating parsers must do so). But this interface no longer has an
-   * ignorableWhitespace method, so in that case such whitespace is not
-   * reported at all.
-   *
-   * @param value the characters from the XML document
-   */
-  void characters(in AString value);
-
-  /**
-   * Receive notification of a processing instruction.
-   *
-   * The Parser will invoke this method once for each processing
-   * instruction found: note that processing instructions may occur
-   * before or after the main document element.
-   *
-   * A SAX parser must never report an XML declaration (XML 1.0,
-   * section 2.8) or a text declaration (XML 1.0, section 4.3.1) using
-   * this method.
-   *
-   * @param target the processing instruction target
-   * @param data the processing instruction data, or null if
-   *        none was supplied.  The data does not include any
-   *        whitespace separating it from the target
-   */
-  void processingInstruction(in AString target, in AString data);
-};
deleted file mode 100644
--- a/parser/xml/nsISAXErrorHandler.idl
+++ /dev/null
@@ -1,90 +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 "nsISupports.idl"
-
-/**
- * Basic interface for SAX error handlers.
- *
- * If a SAX application needs to implement customized error
- * handling, it must implement this interface and then register an
- * instance with the XML reader.  The parser will then report all
- * errors and warnings through this interface.
- *
- * WARNING: If an application does not register an ErrorHandler,
- * XML parsing errors will go unreported. In order to detect validity
- * errors, an ErrorHandler that does something with error() calls must
- * be registered.
- *
- */
-[scriptable, uuid(e02b6693-6cca-11da-be43-001422106990)]
-interface nsISAXErrorHandler: nsISupports {
-
-  /**
-   * Receive notification of a recoverable error.
-   *
-   * This corresponds to the definition of "error" in section 1.2
-   * of the W3C XML 1.0 Recommendation. For example, a validating
-   * parser would use this callback to report the violation of a
-   * validity constraint. The default behaviour is to take no
-   * action.
-   *
-   * The SAX parser must continue to provide normal parsing events
-   * after invoking this method: it should still be possible for the
-   * application to process the document through to the end. If the
-   * application cannot do so, then the parser should report a fatal
-   * error even if the XML recommendation does not require it to do
-   * so.
-   *
-   * Filters may use this method to report other, non-XML errors as
-   * well.
-   *
-   * @param error The error message.
-   */
-  void error(in AString error);
-
-  /**
-   * Receive notification of a non-recoverable error.
-   *
-   * There is an apparent contradiction between the documentation
-   * for this method and the documentation for
-   * ContentHandler.endDocument(). Until this ambiguity is resolved in
-   * a future major release, clients should make no assumptions about
-   * whether endDocument() will or will not be invoked when the parser
-   * has reported a fatalError() or thrown an exception.
-   *
-   * This corresponds to the definition of "fatal error" in section
-   * 1.2 of the W3C XML 1.0 Recommendation. For example, a parser
-   * would use this callback to report the violation of a
-   * well-formedness constraint.
-   *
-   * The application must assume that the document is unusable
-   * after the parser has invoked this method, and should continue (if
-   * at all) only for the sake of collecting additional error
-   * messages: in fact, SAX parsers are free to stop reporting any
-   * other events once this method has been invoked.
-   *
-   * @param error The error message.
-   */
-  void fatalError(in AString error);
-
-  /**
-   * Receive notification of a warning.
-   *
-   * SAX parsers will use this method to report conditions that are
-   * not errors or fatal errors as defined by the XML
-   * recommendation. The default behaviour is to take no action.
-   *
-   * The SAX parser must continue to provide normal parsing events
-   * after invoking this method: it should still be possible for the
-   * application to process the document through to the end.
-   *
-   * Filters may use this method to report other, non-XML warnings
-   * as well.
-   *
-   * @param error The warning message.
-   */
-  void ignorableWarning(in AString error);
-};
deleted file mode 100644
--- a/parser/xml/nsISAXXMLReader.idl
+++ /dev/null
@@ -1,76 +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 "nsIStreamListener.idl"
-
-interface nsIInputStream;
-interface nsIRequestObserver;
-interface nsIURI;
-
-interface nsISAXContentHandler;
-interface nsISAXDTDHandler;
-interface nsISAXErrorHandler;
-interface nsISAXLexicalHandler;
-interface nsIMozSAXXMLDeclarationHandler;
-
-/**
- * Interface for reading an XML document using callbacks.
- *
- * NOTE: This file (and related ones) used to implement a full-featured SAX XML
- * parser. But we have few uses of this interface and the ones we have only use
- * a fraction of the full SAX functionality. So in bug 1416038 we removed a lot
- * of it. See the changes associated with that bug if you need to reintroduce
- * any of that functionality.
- *
- * nsISAXXMLReader is the interface that an XML parser's SAX2
- * driver must implement.  This interface allows an application to set
- * and query features and properties in the parser, to register event
- * handlers for document processing, and to initiate a document
- * parse.
- */
-[scriptable, uuid(5b1de802-9091-454f-9972-5753c0d0c70e)]
-interface nsISAXXMLReader : nsIStreamListener {
-
-  /**
-   * The base URI.
-   */
-  attribute nsIURI baseURI;
-
-  /**
-   * If the application does not register a content handler, all
-   * content events reported by the SAX parser will be silently
-   * ignored.
-   *
-   * Applications may register a new or different handler in the
-   * middle of a parse, and the SAX parser must begin using the new
-   * handler immediately.
-   */
-  attribute nsISAXContentHandler contentHandler;
-
-  /**
-   * If the application does not register an error handler, all
-   * error events reported by the SAX parser will be silently ignored;
-   * however, normal processing may not continue.  It is highly
-   * recommended that all SAX applications implement an error handler
-   * to avoid unexpected bugs.
-   *
-   * Applications may register a new or different handler in the
-   * middle of a parse, and the SAX parser must begin using the new
-   * handler immediately.
-   */
-  attribute nsISAXErrorHandler errorHandler;
-  
-  /**
-   * Begin an asynchronous parse. This method initializes the parser,
-   * and must be called before any nsIStreamListener methods. It is
-   * then the caller's duty to call nsIStreamListener methods to drive
-   * the parser. Once this method is called, the caller must not call
-   * one of the other parse methods.
-   *
-   * @param observer The nsIRequestObserver to notify upon start or stop.
-   *                 Can be NULL.
-   */
-  void parseAsync(in nsIRequestObserver observer);
-};
deleted file mode 100644
--- a/parser/xml/nsSAXAttributes.cpp
+++ /dev/null
@@ -1,189 +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 "nsSAXAttributes.h"
-
-NS_IMPL_ISUPPORTS(nsSAXAttributes, nsISAXAttributes)
-
-NS_IMETHODIMP
-nsSAXAttributes::GetIndexFromName(const nsAString &aURI,
-                                  const nsAString &aLocalName,
-                                  int32_t *aResult) {
-  int32_t len = mAttrs.Length();
-  int32_t i;
-  for (i = 0; i < len; ++i) {
-    const SAXAttr &att = mAttrs[i];
-    if (att.localName.Equals(aLocalName) && att.uri.Equals(aURI)) {
-      *aResult = i;
-      return NS_OK;
-    }
-  }
-  *aResult = -1;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetIndexFromQName(const nsAString &aQName, int32_t *aResult) {
-  int32_t len = mAttrs.Length();
-  int32_t i;
-  for (i = 0; i < len; ++i) {
-    const SAXAttr &att = mAttrs[i];
-    if (att.qName.Equals(aQName)) {
-      *aResult = i;
-      return NS_OK;
-    }
-  }
-  *aResult = -1;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetLength(int32_t *aResult) {
-  *aResult = mAttrs.Length();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetLocalName(uint32_t aIndex, nsAString &aResult) {
-  uint32_t len = mAttrs.Length();
-  if (aIndex >= len) {
-    aResult.SetIsVoid(true);
-  } else {
-    const SAXAttr &att = mAttrs[aIndex];
-    aResult = att.localName;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetQName(uint32_t aIndex, nsAString &aResult) {
-  uint32_t len = mAttrs.Length();
-  if (aIndex >= len) {
-    aResult.SetIsVoid(true);
-  } else {
-    const SAXAttr &att = mAttrs[aIndex];
-    aResult = att.qName;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetType(uint32_t aIndex, nsAString &aResult) {
-  uint32_t len = mAttrs.Length();
-  if (aIndex >= len) {
-    aResult.SetIsVoid(true);
-  } else {
-    const SAXAttr &att = mAttrs[aIndex];
-    aResult = att.type;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetTypeFromName(const nsAString &aURI,
-                                 const nsAString &aLocalName,
-                                 nsAString &aResult) {
-  int32_t index = -1;
-  GetIndexFromName(aURI, aLocalName, &index);
-  if (index >= 0) {
-    aResult = mAttrs[index].type;
-  } else {
-    aResult.SetIsVoid(true);
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetTypeFromQName(const nsAString &aQName, nsAString &aResult) {
-  int32_t index = -1;
-  GetIndexFromQName(aQName, &index);
-  if (index >= 0) {
-    aResult = mAttrs[index].type;
-  } else {
-    aResult.SetIsVoid(true);
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetURI(uint32_t aIndex, nsAString &aResult) {
-  uint32_t len = mAttrs.Length();
-  if (aIndex >= len) {
-    aResult.SetIsVoid(true);
-  } else {
-    const SAXAttr &att = mAttrs[aIndex];
-    aResult = att.uri;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetValue(uint32_t aIndex, nsAString &aResult) {
-  uint32_t len = mAttrs.Length();
-  if (aIndex >= len) {
-    aResult.SetIsVoid(true);
-  } else {
-    const SAXAttr &att = mAttrs[aIndex];
-    aResult = att.value;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetValueFromName(const nsAString &aURI,
-                                  const nsAString &aLocalName,
-                                  nsAString &aResult) {
-  int32_t index = -1;
-  GetIndexFromName(aURI, aLocalName, &index);
-  if (index >= 0) {
-    aResult = mAttrs[index].value;
-  } else {
-    aResult.SetIsVoid(true);
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXAttributes::GetValueFromQName(const nsAString &aQName,
-                                   nsAString &aResult) {
-  int32_t index = -1;
-  GetIndexFromQName(aQName, &index);
-  if (index >= 0) {
-    aResult = mAttrs[index].value;
-  } else {
-    aResult.SetIsVoid(true);
-  }
-
-  return NS_OK;
-}
-
-nsresult nsSAXAttributes::AddAttribute(const nsAString &aURI,
-                                       const nsAString &aLocalName,
-                                       const nsAString &aQName,
-                                       const nsAString &aType,
-                                       const nsAString &aValue) {
-  SAXAttr *att = mAttrs.AppendElement();
-  if (!att) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  att->uri = aURI;
-  att->localName = aLocalName;
-  att->qName = aQName;
-  att->type = aType;
-  att->value = aValue;
-
-  return NS_OK;
-}
deleted file mode 100644
--- a/parser/xml/nsSAXAttributes.h
+++ /dev/null
@@ -1,37 +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 nsSAXAttributes_h__
-#define nsSAXAttributes_h__
-
-#include "nsISupports.h"
-#include "nsISAXAttributes.h"
-#include "nsTArray.h"
-#include "nsString.h"
-#include "mozilla/Attributes.h"
-
-struct SAXAttr {
-  nsString uri;
-  nsString localName;
-  nsString qName;
-  nsString type;
-  nsString value;
-};
-
-class nsSAXAttributes final : public nsISAXAttributes {
- public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSISAXATTRIBUTES
-
-  nsresult AddAttribute(const nsAString &aURI, const nsAString &aLocalName,
-                        const nsAString &aQName, const nsAString &aType,
-                        const nsAString &aValue);
-
- private:
-  ~nsSAXAttributes() {}
-  nsTArray<SAXAttr> mAttrs;
-};
-
-#endif  // nsSAXAttributes_h__
deleted file mode 100644
--- a/parser/xml/nsSAXXMLReader.cpp
+++ /dev/null
@@ -1,346 +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 "nsSAXXMLReader.h"
-
-#include "mozilla/Encoding.h"
-#include "mozilla/NullPrincipal.h"
-#include "nsIInputStream.h"
-#include "nsNetCID.h"
-#include "nsNetUtil.h"
-#include "nsIParser.h"
-#include "nsParserCIID.h"
-#include "nsStreamUtils.h"
-#include "nsStringStream.h"
-#include "nsIScriptError.h"
-#include "nsSAXAttributes.h"
-#include "nsCharsetSource.h"
-
-using mozilla::Encoding;
-using mozilla::NotNull;
-
-#define XMLNS_URI "http://www.w3.org/2000/xmlns/"
-
-static NS_DEFINE_CID(kParserCID, NS_PARSER_CID);
-
-NS_IMPL_CYCLE_COLLECTION(nsSAXXMLReader, mContentHandler, mErrorHandler,
-                         mBaseURI, mListener, mParserObserver)
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSAXXMLReader)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSAXXMLReader)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSAXXMLReader)
-  NS_INTERFACE_MAP_ENTRY(nsISAXXMLReader)
-  NS_INTERFACE_MAP_ENTRY(nsIExpatSink)
-  NS_INTERFACE_MAP_ENTRY(nsIContentSink)
-  NS_INTERFACE_MAP_ENTRY(nsIRequestObserver)
-  NS_INTERFACE_MAP_ENTRY(nsIStreamListener)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISAXXMLReader)
-NS_INTERFACE_MAP_END
-
-nsSAXXMLReader::nsSAXXMLReader() : mIsAsyncParse(false) {}
-
-// nsIContentSink
-
-NS_IMETHODIMP
-nsSAXXMLReader::WillBuildModel(nsDTDMode) {
-  if (mContentHandler) return mContentHandler->StartDocument();
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::DidBuildModel(bool aTerminated) {
-  if (mContentHandler) return mContentHandler->EndDocument();
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::SetParser(nsParserBase *aParser) { return NS_OK; }
-
-// nsIExpatSink
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleStartElement(const char16_t *aName,
-                                   const char16_t **aAtts, uint32_t aAttsCount,
-                                   uint32_t aLineNumber,
-                                   uint32_t aColumnNumber) {
-  if (!mContentHandler) return NS_OK;
-
-  RefPtr<nsSAXAttributes> atts = new nsSAXAttributes();
-  if (!atts) return NS_ERROR_OUT_OF_MEMORY;
-  nsAutoString uri, localName, qName;
-  for (; *aAtts; aAtts += 2) {
-    SplitExpatName(aAtts[0], uri, localName, qName);
-    // XXX don't have attr type information
-    NS_NAMED_LITERAL_STRING(cdataType, "CDATA");
-    // could support xmlns reporting, it's a standard SAX feature
-    if (!uri.EqualsLiteral(XMLNS_URI)) {
-      NS_ASSERTION(aAtts[1], "null passed to handler");
-      atts->AddAttribute(uri, localName, qName, cdataType,
-                         nsDependentString(aAtts[1]));
-    }
-  }
-
-  // Deal with the element name
-  SplitExpatName(aName, uri, localName, qName);
-  return mContentHandler->StartElement(uri, localName, qName, atts);
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleEndElement(const char16_t *aName) {
-  if (mContentHandler) {
-    nsAutoString uri, localName, qName;
-    SplitExpatName(aName, uri, localName, qName);
-    return mContentHandler->EndElement(uri, localName, qName);
-  }
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleComment(const char16_t *aName) {
-  NS_ASSERTION(aName, "null passed to handler");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleCDataSection(const char16_t *aData, uint32_t aLength) {
-  if (mContentHandler) {
-    nsresult rv =
-        mContentHandler->Characters(Substring(aData, aData + aLength));
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleDoctypeDecl(const nsAString &aSubset,
-                                  const nsAString &aName,
-                                  const nsAString &aSystemId,
-                                  const nsAString &aPublicId,
-                                  nsISupports *aCatalogData) {
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleCharacterData(const char16_t *aData, uint32_t aLength) {
-  if (mContentHandler)
-    return mContentHandler->Characters(Substring(aData, aData + aLength));
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleProcessingInstruction(const char16_t *aTarget,
-                                            const char16_t *aData) {
-  NS_ASSERTION(aTarget && aData, "null passed to handler");
-  if (mContentHandler) {
-    return mContentHandler->ProcessingInstruction(nsDependentString(aTarget),
-                                                  nsDependentString(aData));
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::HandleXMLDeclaration(const char16_t *aVersion,
-                                     const char16_t *aEncoding,
-                                     int32_t aStandalone) {
-  NS_ASSERTION(aVersion, "null passed to handler");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::ReportError(const char16_t *aErrorText,
-                            const char16_t *aSourceText, nsIScriptError *aError,
-                            bool *_retval) {
-  MOZ_ASSERT(aError && aSourceText && aErrorText, "Check arguments!!!");
-  // Normally, the expat driver should report the error.
-  *_retval = true;
-
-  if (mErrorHandler) {
-    nsresult rv = mErrorHandler->FatalError(nsDependentString(aErrorText));
-    if (NS_SUCCEEDED(rv)) {
-      // The error handler has handled the script error.  Don't log to console.
-      *_retval = false;
-    }
-  }
-
-  return NS_OK;
-}
-
-// nsISAXXMLReader
-
-NS_IMETHODIMP
-nsSAXXMLReader::GetBaseURI(nsIURI **aBaseURI) {
-  NS_IF_ADDREF(*aBaseURI = mBaseURI);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::SetBaseURI(nsIURI *aBaseURI) {
-  mBaseURI = aBaseURI;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::GetContentHandler(nsISAXContentHandler **aContentHandler) {
-  NS_IF_ADDREF(*aContentHandler = mContentHandler);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::SetContentHandler(nsISAXContentHandler *aContentHandler) {
-  mContentHandler = aContentHandler;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::GetErrorHandler(nsISAXErrorHandler **aErrorHandler) {
-  NS_IF_ADDREF(*aErrorHandler = mErrorHandler);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::SetErrorHandler(nsISAXErrorHandler *aErrorHandler) {
-  mErrorHandler = aErrorHandler;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::ParseAsync(nsIRequestObserver *aObserver) {
-  mParserObserver = aObserver;
-  mIsAsyncParse = true;
-  return NS_OK;
-}
-
-// nsIRequestObserver
-
-NS_IMETHODIMP
-nsSAXXMLReader::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) {
-  NS_ENSURE_TRUE(mIsAsyncParse, NS_ERROR_FAILURE);
-  nsresult rv;
-  rv = EnsureBaseURI();
-  NS_ENSURE_SUCCESS(rv, rv);
-  nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
-  rv = InitParser(mParserObserver, channel);
-  NS_ENSURE_SUCCESS(rv, rv);
-  // we don't need or want this anymore
-  mParserObserver = nullptr;
-  return mListener->OnStartRequest(aRequest, aContext);
-}
-
-NS_IMETHODIMP
-nsSAXXMLReader::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext,
-                              nsresult status) {
-  NS_ENSURE_TRUE(mIsAsyncParse, NS_ERROR_FAILURE);
-  NS_ENSURE_STATE(mListener);
-  nsresult rv = mListener->OnStopRequest(aRequest, aContext, status);
-  mListener = nullptr;
-  mIsAsyncParse = false;
-  return rv;
-}
-
-// nsIStreamListener
-
-NS_IMETHODIMP
-nsSAXXMLReader::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
-                                nsIInputStream *aInputStream, uint64_t offset,
-                                uint32_t count) {
-  NS_ENSURE_TRUE(mIsAsyncParse, NS_ERROR_FAILURE);
-  NS_ENSURE_STATE(mListener);
-  return mListener->OnDataAvailable(aRequest, aContext, aInputStream, offset,
-                                    count);
-}
-
-nsresult nsSAXXMLReader::InitParser(nsIRequestObserver *aObserver,
-                                    nsIChannel *aChannel) {
-  nsresult rv;
-
-  // setup the parser
-  nsCOMPtr<nsIParser> parser = do_CreateInstance(kParserCID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  parser->SetContentSink(this);
-
-  int32_t charsetSource = kCharsetFromDocTypeDefault;
-  auto encoding = UTF_8_ENCODING;
-  TryChannelCharset(aChannel, charsetSource, encoding);
-  parser->SetDocumentCharset(encoding, charsetSource);
-
-  rv = parser->Parse(mBaseURI, aObserver);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  mListener = do_QueryInterface(parser, &rv);
-
-  return rv;
-}
-
-// from nsDocument.cpp
-bool nsSAXXMLReader::TryChannelCharset(nsIChannel *aChannel,
-                                       int32_t &aCharsetSource,
-                                       NotNull<const Encoding *> &aEncoding) {
-  if (aCharsetSource >= kCharsetFromChannel) return true;
-
-  if (aChannel) {
-    nsAutoCString charsetVal;
-    nsresult rv = aChannel->GetContentCharset(charsetVal);
-    if (NS_SUCCEEDED(rv)) {
-      const Encoding *preferred = Encoding::ForLabel(charsetVal);
-      if (!preferred) return false;
-
-      aEncoding = WrapNotNull(preferred);
-      aCharsetSource = kCharsetFromChannel;
-      return true;
-    }
-  }
-
-  return false;
-}
-
-nsresult nsSAXXMLReader::EnsureBaseURI() {
-  if (mBaseURI) return NS_OK;
-
-  return NS_NewURI(getter_AddRefs(mBaseURI), "about:blank");
-}
-
-nsresult nsSAXXMLReader::SplitExpatName(const char16_t *aExpatName,
-                                        nsString &aURI, nsString &aLocalName,
-                                        nsString &aQName) {
-  /**
-   * Adapted from RDFContentSinkImpl
-   *
-   * Expat can send the following:
-   *    localName
-   *    namespaceURI<separator>localName
-   *    namespaceURI<separator>localName<separator>prefix
-   *
-   * and we use 0xFFFF for the <separator>.
-   *
-   */
-
-  NS_ASSERTION(aExpatName, "null passed to handler");
-  nsDependentString expatStr(aExpatName);
-  int32_t break1, break2 = kNotFound;
-  break1 = expatStr.FindChar(char16_t(0xFFFF));
-
-  if (break1 == kNotFound) {
-    aLocalName = expatStr;  // no namespace
-    aURI.Truncate();
-    aQName = expatStr;
-  } else {
-    aURI = StringHead(expatStr, break1);
-    break2 = expatStr.FindChar(char16_t(0xFFFF), break1 + 1);
-    if (break2 == kNotFound) {  // namespace, but no prefix
-      aLocalName = Substring(expatStr, break1 + 1);
-      aQName = aLocalName;
-    } else {  // namespace with prefix
-      aLocalName = Substring(expatStr, break1 + 1, break2 - break1 - 1);
-      aQName =
-          Substring(expatStr, break2 + 1) + NS_LITERAL_STRING(":") + aLocalName;
-    }
-  }
-
-  return NS_OK;
-}
deleted file mode 100644
--- a/parser/xml/nsSAXXMLReader.h
+++ /dev/null
@@ -1,77 +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 nsSAXXMLReader_h__
-#define nsSAXXMLReader_h__
-
-#include "nsCOMPtr.h"
-#include "nsIContentSink.h"
-#include "nsIExpatSink.h"
-#include "nsIParser.h"
-#include "nsIURI.h"
-#include "nsISAXXMLReader.h"
-#include "nsISAXContentHandler.h"
-#include "nsISAXErrorHandler.h"
-#include "nsCycleCollectionParticipant.h"
-#include "mozilla/Attributes.h"
-#include "mozilla/NotNull.h"
-
-#define NS_SAXXMLREADER_CONTRACTID "@mozilla.org/saxparser/xmlreader;1"
-#define NS_SAXXMLREADER_CID                          \
-  {                                                  \
-    0xab1da296, 0x6125, 0x40ba, {                    \
-      0x96, 0xd0, 0x47, 0xa8, 0x28, 0x2a, 0xe3, 0xdb \
-    }                                                \
-  }
-
-class nsSAXXMLReader final : public nsISAXXMLReader,
-                             public nsIExpatSink,
-                             public nsIContentSink {
- public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsSAXXMLReader, nsISAXXMLReader)
-  NS_DECL_NSIEXPATSINK
-  NS_DECL_NSISAXXMLREADER
-  NS_DECL_NSIREQUESTOBSERVER
-  NS_DECL_NSISTREAMLISTENER
-
-  nsSAXXMLReader();
-
-  // nsIContentSink
-  NS_IMETHOD WillParse() override { return NS_OK; }
-
-  NS_IMETHOD WillBuildModel(nsDTDMode aDTDMode) override;
-  NS_IMETHOD DidBuildModel(bool aTerminated) override;
-  NS_IMETHOD SetParser(nsParserBase *aParser) override;
-
-  NS_IMETHOD WillInterrupt() override { return NS_OK; }
-
-  NS_IMETHOD WillResume() override { return NS_OK; }
-
-  virtual void FlushPendingNotifications(mozilla::FlushType aType) override {}
-
-  virtual void SetDocumentCharset(
-      NotNull<const Encoding *> aEncoding) override {}
-
-  virtual nsISupports *GetTarget() override { return nullptr; }
-
- private:
-  ~nsSAXXMLReader() {}
-
-  nsCOMPtr<nsISAXContentHandler> mContentHandler;
-  nsCOMPtr<nsISAXErrorHandler> mErrorHandler;
-  nsCOMPtr<nsIURI> mBaseURI;
-  nsCOMPtr<nsIStreamListener> mListener;
-  nsCOMPtr<nsIRequestObserver> mParserObserver;
-  bool mIsAsyncParse;
-  static bool TryChannelCharset(nsIChannel *aChannel, int32_t &aCharsetSource,
-                                NotNull<const Encoding *> &aEncoding);
-  nsresult EnsureBaseURI();
-  nsresult InitParser(nsIRequestObserver *aListener, nsIChannel *aChannel);
-  nsresult SplitExpatName(const char16_t *aExpatName, nsString &aURI,
-                          nsString &aLocalName, nsString &aQName);
-};
-
-#endif  // nsSAXXMLReader_h__
deleted file mode 100644
--- a/parser/xml/test/unit/test_parser.js
+++ /dev/null
@@ -1,140 +0,0 @@
-ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
-
-function updateDocumentSourceMaps(src) {
-  const nsISAXXMLReader = Ci.nsISAXXMLReader;
-  const saxReader = Cc["@mozilla.org/saxparser/xmlreader;1"]
-                      .createInstance(nsISAXXMLReader);
-  try {
-    saxReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
-    saxReader.setFeature("http://xml.org/sax/features/namespace", true);
-  } catch (e) {
-    // do nothing, we'll accept it as it is.
-  }
-  var parseErrorLog = [];
-
-  /* XXX ajvincent Because throwing an exception doesn't stop parsing, we need
-   * to record errors and handle them after the parsing is finished.
-   */
-  function do_parse_check(aCondition, aMsg) {
-    if (!aCondition)
-      parseErrorLog[parseErrorLog.length] = aMsg;
-  }
-
-  var contentHandler = {
-    startDocument: function startDocument() {
-    },
-
-    endDocument: function endDocument() {
-    },
-
-    handleAttributes: function handleAttributes(aAttributes) {
-      for (var i = 0; i < aAttributes.length; i++) {
-        var attrLocalName = aAttributes.getLocalName(i);
-        var attrNodeName = aAttributes.getQName(i);
-        do_parse_check(attrLocalName, "Missing attribute local name");
-        do_parse_check(attrNodeName, "Missing attribute node name");
-      }
-    },
-
-    startElement: function startElement(aNamespaceURI, aLocalName, aNodeName, aAttributes) {
-      do_parse_check(aLocalName, "Missing element local name (startElement)");
-      do_parse_check(aNodeName, "Missing element node name (startElement)");
-      do_parse_check(aAttributes, "Missing element attributes");
-      this.handleAttributes(aAttributes);
-    },
-
-    endElement: function endElement(aNamespaceURI, aLocalName, aNodeName) {
-      do_parse_check(aLocalName, "Missing element local name (endElement)");
-      do_parse_check(aNodeName, "Missing element node name (endElement)");
-    },
-
-    characters: function characters(aData) {
-    },
-
-    processingInstruction: function processingInstruction(aTarget, aData) {
-      do_parse_check(aTarget, "Missing processing instruction target");
-    },
-  };
-
-  var errorHandler = {
-    error: function error(aError) {
-      do_parse_check(!aError, "XML error");
-    },
-
-    fatalError: function fatalError(aError) {
-      do_parse_check(!aError, "XML fatal error");
-    },
-
-    ignorableWarning: function ignorableWarning(aError) {
-      do_parse_check(!aError, "XML ignorable warning");
-    },
-  };
-
-  saxReader.contentHandler = contentHandler;
-  saxReader.errorHandler   = errorHandler;
-
-  let type = "application/xml";
-  let uri = NetUtil.newURI("http://example.org/");
-
-  let sStream = Cc["@mozilla.org/io/string-input-stream;1"]
-               .createInstance(Ci.nsIStringInputStream);
-  sStream.setData(src, src.length);
-  var bStream = Cc["@mozilla.org/network/buffered-input-stream;1"]
-                .createInstance(Ci.nsIBufferedInputStream);
-  bStream.init(sStream, 4096);
-
-  let channel = Cc["@mozilla.org/network/input-stream-channel;1"].
-    createInstance(Ci.nsIInputStreamChannel);
-  channel.setURI(uri);
-  channel.contentStream = bStream;
-  channel.QueryInterface(Ci.nsIChannel);
-  channel.contentType = type;
-
-  saxReader.parseAsync(null, uri);
-  saxReader.onStartRequest(channel, uri);
-
-  let pos = 0;
-  let count = bStream.available();
-  while (count > 0) {
-    saxReader.onDataAvailable(channel, null, bStream, pos, count);
-    pos += count;
-    count = bStream.available();
-  }
-  saxReader.onStopRequest(channel, null, Cr.NS_OK);
-
-  // Just in case it leaks.
-  saxReader.contentHandler = null;
-  saxReader.errorHandler   = null;
-
-  return parseErrorLog;
-}
-
-function do_check_true_with_dump(aCondition, aParseLog) {
-  if (!aCondition) {
-    dump(aParseLog.join("\n"));
-  }
-  Assert.ok(aCondition);
-}
-
-function run_test() {
-  var src;
-  src = "<!DOCTYPE foo>\n<!-- all your foo are belong to bar -->";
-  src += "<foo id='foo'>\n<?foo wooly bully?>\nfoo";
-  src += "<![CDATA[foo fighters]]></foo>\n";
-
-  var parseErrorLog = updateDocumentSourceMaps(src);
-
-  if (parseErrorLog.length > 0) {
-    dump(parseErrorLog.join("\n"));
-  }
-  do_check_true_with_dump(parseErrorLog.length == 0, parseErrorLog);
-
-  // End tag isn't well-formed.
-  src = "<!DOCTYPE foo>\n<!-- all your foo are belong to bar -->";
-  src += "<foo id='foo'>\n<?foo wooly bully?>\nfoo";
-  src += "<![CDATA[foo fighters]]></foo\n";
-
-  parseErrorLog = updateDocumentSourceMaps(src);
-
-  do_check_true_with_dump(parseErrorLog.length == 1 && parseErrorLog[0] == "XML fatal error", parseErrorLog);
-}
--- a/parser/xml/test/unit/xpcshell.ini
+++ b/parser/xml/test/unit/xpcshell.ini
@@ -1,6 +1,5 @@
 [DEFAULT]
 head =
 support-files = results.js
 
-[test_parser.js]
 [test_sanitizer.js]