Issue #1375 - Stop largely using the parser service

This is based on Bug 1395828

* Add nsHTMLElement::IsBlock()
* Rename nsHTMLTags methods
* Remove AssertParserServiceIsCorrect()
* Remove most uses of nsIParserService/nsParserService
This commit is contained in:
Matt A. Tobin 2020-04-17 06:24:43 -04:00 committed by Roy Tam
commit 9928baf912
18 changed files with 77 additions and 193 deletions

View file

@ -11,7 +11,7 @@
#include "mozilla/dom/HTMLElementBinding.h"
#include "mozilla/dom/WebComponentsBinding.h"
#include "mozilla/dom/DocGroup.h"
#include "nsIParserService.h"
#include "nsHTMLTags.h"
#include "jsapi.h"
namespace mozilla {
@ -588,14 +588,8 @@ CustomElementRegistry::Define(const nsAString& aName,
return;
}
nsIParserService* ps = nsContentUtils::GetParserService();
if (!ps) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
// bgsound and multicol are unknown html element.
int32_t tag = ps->HTMLCaseSensitiveAtomTagToId(extendsAtom);
int32_t tag = nsHTMLTags::CaseSensitiveAtomTagToId(extendsAtom);
if (tag == eHTMLTag_userdefined ||
tag == eHTMLTag_bgsound ||
tag == eHTMLTag_multicol) {