summaryrefslogtreecommitdiff
path: root/parser/htmlparser/nsParserService.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 06:24:43 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 06:24:43 -0400
commit61e46a6d58a58e249f1982d903780bf5bccb8f6b (patch)
treefd3de5eca4f0bdce70df9f0a9a51549dae4942d9 /parser/htmlparser/nsParserService.cpp
parent8114d58fee29120ab4a7af7bd9b5c77252ab1d86 (diff)
downloaduxp-61e46a6d58a58e249f1982d903780bf5bccb8f6b.tar.gz
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
Diffstat (limited to 'parser/htmlparser/nsParserService.cpp')
-rw-r--r--parser/htmlparser/nsParserService.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/parser/htmlparser/nsParserService.cpp b/parser/htmlparser/nsParserService.cpp
index d89badd01d..ab5c20c70e 100644
--- a/parser/htmlparser/nsParserService.cpp
+++ b/parser/htmlparser/nsParserService.cpp
@@ -25,19 +25,19 @@ NS_IMPL_ISUPPORTS(nsParserService, nsIParserService)
int32_t
nsParserService::HTMLAtomTagToId(nsIAtom* aAtom) const
{
- return nsHTMLTags::LookupTag(nsDependentAtomString(aAtom));
+ return nsHTMLTags::StringTagToId(nsDependentAtomString(aAtom));
}
int32_t
nsParserService::HTMLCaseSensitiveAtomTagToId(nsIAtom* aAtom) const
{
- return nsHTMLTags::CaseSensitiveLookupTag(aAtom);
+ return nsHTMLTags::CaseSensitiveAtomTagToId(aAtom);
}
int32_t
nsParserService::HTMLStringTagToId(const nsAString& aTag) const
{
- return nsHTMLTags::LookupTag(aTag);
+ return nsHTMLTags::StringTagToId(aTag);
}
const char16_t*
@@ -84,16 +84,7 @@ nsParserService::IsContainer(int32_t aId, bool& aIsContainer) const
NS_IMETHODIMP
nsParserService::IsBlock(int32_t aId, bool& aIsBlock) const
{
- if((aId>eHTMLTag_unknown) && (aId<eHTMLTag_userdefined)) {
- aIsBlock=((gHTMLElements[aId].IsMemberOf(kBlock)) ||
- (gHTMLElements[aId].IsMemberOf(kBlockEntity)) ||
- (gHTMLElements[aId].IsMemberOf(kHeading)) ||
- (gHTMLElements[aId].IsMemberOf(kPreformatted))||
- (gHTMLElements[aId].IsMemberOf(kList)));
- }
- else {
- aIsBlock = false;
- }
+ aIsBlock = nsHTMLElement::IsBlock((eHTMLTags)aId);
return NS_OK;
}