зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1394256 - Remove nsIParserService::HTMLIdTo{Atom,String}Tag(). r=mrbkap.
They're unused. This also means nsHTMLTags::Get{Atom,StringValue}() can be removed. --HG-- extra : rebase_source : f6538fe409c1a3bb22e5bc901c2ead37dd4f7eb0
This commit is contained in:
Родитель
dd614f8fee
Коммит
a6e214098c
|
@ -212,8 +212,6 @@ nsHTMLTags::TestTagTable()
|
|||
tag = sTagUnicodeTable[i];
|
||||
id = LookupTag(nsDependentString(tag));
|
||||
NS_ASSERTION(id != eHTMLTag_userdefined, "can't find tag id");
|
||||
const char16_t* check = GetStringValue(id);
|
||||
NS_ASSERTION(0 == nsCRT::strcmp(check, tag), "can't map id back to tag");
|
||||
|
||||
nsAutoString uname(tag);
|
||||
ToUpperCase(uname);
|
||||
|
@ -223,7 +221,6 @@ nsHTMLTags::TestTagTable()
|
|||
|
||||
atom = NS_Atomize(tag);
|
||||
NS_ASSERTION(id == CaseSensitiveLookupTag(atom), "wrong id");
|
||||
NS_ASSERTION(atom == GetAtom(id), "can't map id back to atom");
|
||||
}
|
||||
|
||||
// Make sure we don't find things that aren't there
|
||||
|
@ -239,20 +236,6 @@ nsHTMLTags::TestTagTable()
|
|||
id = CaseSensitiveLookupTag(atom);
|
||||
NS_ASSERTION(id == eHTMLTag_userdefined, "found zzzzz");
|
||||
|
||||
tag = GetStringValue((nsHTMLTag) 0);
|
||||
NS_ASSERTION(!tag, "found enum 0");
|
||||
tag = GetStringValue((nsHTMLTag) -1);
|
||||
NS_ASSERTION(!tag, "found enum -1");
|
||||
tag = GetStringValue((nsHTMLTag) (NS_HTML_TAG_MAX + 1));
|
||||
NS_ASSERTION(!tag, "found past max enum");
|
||||
|
||||
atom = GetAtom((nsHTMLTag) 0);
|
||||
NS_ASSERTION(!atom, "found enum 0");
|
||||
atom = GetAtom((nsHTMLTag) -1);
|
||||
NS_ASSERTION(!atom, "found enum -1");
|
||||
atom = GetAtom((nsHTMLTag) (NS_HTML_TAG_MAX + 1));
|
||||
NS_ASSERTION(!atom, "found past max enum");
|
||||
|
||||
ReleaseTable();
|
||||
}
|
||||
|
||||
|
|
|
@ -66,18 +66,6 @@ public:
|
|||
return tag ? (nsHTMLTag)NS_PTR_TO_INT32(tag) : eHTMLTag_userdefined;
|
||||
}
|
||||
|
||||
// Functions for converting an id to a string or atom
|
||||
static const char16_t *GetStringValue(nsHTMLTag aEnum)
|
||||
{
|
||||
return aEnum <= eHTMLTag_unknown || aEnum > NS_HTML_TAG_MAX ?
|
||||
nullptr : sTagUnicodeTable[aEnum - 1];
|
||||
}
|
||||
static nsIAtom *GetAtom(nsHTMLTag aEnum)
|
||||
{
|
||||
return aEnum <= eHTMLTag_unknown || aEnum > NS_HTML_TAG_MAX ?
|
||||
nullptr : sTagAtomTable[aEnum - 1];
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void TestTagTable();
|
||||
#endif
|
||||
|
|
|
@ -57,32 +57,6 @@ class nsIParserService : public nsISupports {
|
|||
*/
|
||||
virtual int32_t HTMLStringTagToId(const nsAString& aTag) const = 0;
|
||||
|
||||
/**
|
||||
* Gets the tag corresponding to the nsHTMLTag enum value in aId. The
|
||||
* returned tag will be in lowercase.
|
||||
*
|
||||
* @param aId The nsHTMLTag enum value to get the tag for.
|
||||
*
|
||||
* @return const char16_t* The tag corresponding to the nsHTMLTag enum
|
||||
* value, or nullptr if the enum value doesn't
|
||||
* correspond to a tag (eHTMLTag_unknown,
|
||||
* eHTMLTag_userdefined, eHTMLTag_text, ...).
|
||||
*/
|
||||
virtual const char16_t *HTMLIdToStringTag(int32_t aId) const = 0;
|
||||
|
||||
/**
|
||||
* Gets the tag corresponding to the nsHTMLTag enum value in aId. The
|
||||
* returned tag will be in lowercase.
|
||||
*
|
||||
* @param aId The nsHTMLTag enum value to get the tag for.
|
||||
*
|
||||
* @return nsIAtom* The tag corresponding to the nsHTMLTag enum value, or
|
||||
* nullptr if the enum value doesn't correspond to a tag
|
||||
* (eHTMLTag_unknown, eHTMLTag_userdefined, eHTMLTag_text,
|
||||
* ...).
|
||||
*/
|
||||
virtual nsIAtom *HTMLIdToAtomTag(int32_t aId) const = 0;
|
||||
|
||||
NS_IMETHOD IsContainer(int32_t aId, bool& aIsContainer) const = 0;
|
||||
NS_IMETHOD IsBlock(int32_t aId, bool& aIsBlock) const = 0;
|
||||
};
|
||||
|
|
|
@ -39,18 +39,6 @@ nsParserService::HTMLStringTagToId(const nsAString& aTag) const
|
|||
return nsHTMLTags::LookupTag(aTag);
|
||||
}
|
||||
|
||||
const char16_t*
|
||||
nsParserService::HTMLIdToStringTag(int32_t aId) const
|
||||
{
|
||||
return nsHTMLTags::GetStringValue((nsHTMLTag)aId);
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
nsParserService::HTMLIdToAtomTag(int32_t aId) const
|
||||
{
|
||||
return nsHTMLTags::GetAtom((nsHTMLTag)aId);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsParserService::IsContainer(int32_t aId, bool& aIsContainer) const
|
||||
{
|
||||
|
|
|
@ -43,10 +43,6 @@ public:
|
|||
|
||||
int32_t HTMLStringTagToId(const nsAString& aTag) const override;
|
||||
|
||||
const char16_t *HTMLIdToStringTag(int32_t aId) const override;
|
||||
|
||||
nsIAtom *HTMLIdToAtomTag(int32_t aId) const override;
|
||||
|
||||
NS_IMETHOD IsContainer(int32_t aId, bool& aIsContainer) const override;
|
||||
NS_IMETHOD IsBlock(int32_t aId, bool& aIsBlock) const override;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче