зеркало из https://github.com/mozilla/pjs.git
reduce string usage by using atom version of method; r/sr=dbaron, bug=213101
This commit is contained in:
Родитель
9395a76111
Коммит
6e740ccad6
|
@ -1463,16 +1463,16 @@ nsHTMLCopyEncoder::GetPromotedPoint(Endpoint aWhere, nsIDOMNode *aNode, PRInt32
|
|||
{
|
||||
if (bResetPromotion)
|
||||
{
|
||||
nsAutoString tag;
|
||||
nsCOMPtr<nsIAtom> atom;
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(parent);
|
||||
if (content)
|
||||
{
|
||||
PRBool isBlock = PR_FALSE;
|
||||
PRInt32 id;
|
||||
nsCOMPtr<nsIAtom> atom;
|
||||
content->GetTag(getter_AddRefs(atom));
|
||||
atom->ToString(tag);
|
||||
parserService->HTMLStringTagToId(tag, &id);
|
||||
|
||||
PRInt32 id;
|
||||
parserService->HTMLAtomTagToId(atom, &id);
|
||||
|
||||
PRBool isBlock = PR_FALSE;
|
||||
parserService->IsBlock(id, isBlock);
|
||||
if (isBlock)
|
||||
{
|
||||
|
@ -1552,16 +1552,16 @@ nsHTMLCopyEncoder::GetPromotedPoint(Endpoint aWhere, nsIDOMNode *aNode, PRInt32
|
|||
{
|
||||
if (bResetPromotion)
|
||||
{
|
||||
nsAutoString tag;
|
||||
nsCOMPtr<nsIAtom> atom;
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(parent);
|
||||
if (content)
|
||||
{
|
||||
PRBool isBlock = PR_FALSE;
|
||||
PRInt32 id;
|
||||
nsCOMPtr<nsIAtom> atom;
|
||||
content->GetTag(getter_AddRefs(atom));
|
||||
atom->ToString(tag);
|
||||
parserService->HTMLStringTagToId(tag, &id);
|
||||
|
||||
PRInt32 id;
|
||||
parserService->HTMLAtomTagToId(atom, &id);
|
||||
|
||||
PRBool isBlock = PR_FALSE;
|
||||
parserService->IsBlock(id, isBlock);
|
||||
if (isBlock)
|
||||
{
|
||||
|
|
|
@ -1863,19 +1863,12 @@ nsPlainTextSerializer::GetIdForContent(nsIContent* aContent,
|
|||
mContent->GetTag(getter_AddRefs(tagname));
|
||||
if (!tagname) return NS_ERROR_FAILURE;
|
||||
|
||||
nsAutoString namestr;
|
||||
tagname->ToString(namestr);
|
||||
|
||||
nsIParserService* parserService =
|
||||
nsContentUtils::GetParserServiceWeakRef();
|
||||
if (!parserService)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsresult rv;
|
||||
rv = parserService->HTMLStringTagToId(namestr, aID);
|
||||
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
|
||||
|
||||
return NS_OK;
|
||||
return parserService->HTMLAtomTagToId(tagname, aID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче