Bug 1395828 (part 4) - Remove nsIParserService/nsParserService. r=mrbkap.

It a stateless wrapper around static methods in nsHTMLTags and nsHTMLElement,
and hence an unnecessary layer of indirection that just adds complexity and
slowness. This patch removes it, cutting almost 300 lines of code.

This requires making nsElementTable.h an exported header, to expose the
nsHTMLElement methods.
This commit is contained in:
Nicholas Nethercote
2017-09-05 20:19:06 +10:00
parent 92b4999d58
commit 038eda3f17
21 changed files with 51 additions and 341 deletions

View File

@@ -14,7 +14,6 @@
#include "nsHTMLTokenizer.h"
//#include "nsTextTokenizer.h"
#include "nsElementTable.h"
#include "nsParserService.h"
#include "nsSAXAttributes.h"
#include "nsSAXLocator.h"
#include "nsSAXXMLReader.h"
@@ -31,7 +30,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsExpatDriver)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser)
NS_GENERIC_FACTORY_CONSTRUCTOR(CNavDTD)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSAXAttributes)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSAXXMLReader)
@@ -41,7 +39,6 @@ NS_DEFINE_NAMED_CID(NS_EXPAT_DRIVER_CID);
#endif
NS_DEFINE_NAMED_CID(NS_PARSER_CID);
NS_DEFINE_NAMED_CID(NS_CNAVDTD_CID);
NS_DEFINE_NAMED_CID(NS_PARSERSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_SAXATTRIBUTES_CID);
NS_DEFINE_NAMED_CID(NS_SAXXMLREADER_CID);
@@ -51,14 +48,12 @@ static const mozilla::Module::CIDEntry kParserCIDs[] = {
#endif
{ &kNS_PARSER_CID, false, nullptr, nsParserConstructor },
{ &kNS_CNAVDTD_CID, false, nullptr, CNavDTDConstructor },
{ &kNS_PARSERSERVICE_CID, false, nullptr, nsParserServiceConstructor },
{ &kNS_SAXATTRIBUTES_CID, false, nullptr, nsSAXAttributesConstructor },
{ &kNS_SAXXMLREADER_CID, false, nullptr, nsSAXXMLReaderConstructor },
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kParserContracts[] = {
{ NS_PARSERSERVICE_CONTRACTID, &kNS_PARSERSERVICE_CID },
{ NS_SAXATTRIBUTES_CONTRACTID, &kNS_SAXATTRIBUTES_CID },
{ NS_SAXXMLREADER_CONTRACTID, &kNS_SAXXMLREADER_CID },
{ nullptr }