зеркало из https://github.com/mozilla/gecko-dev.git
Bug 103304: Make nsGenericHTMLElement::GetNodeName more efficient. r=bzbarsky@mit.edu, sr=jst
This commit is contained in:
Родитель
1812431a27
Коммит
0f86050de3
|
@ -85,6 +85,7 @@
|
|||
#include "nsIHTMLContentContainer.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
|
@ -671,23 +672,12 @@ nsGenericHTMLElement::GetTagName(nsAWritableString& aTagName)
|
|||
nsresult
|
||||
nsGenericHTMLElement::GetNodeName(nsAWritableString& aNodeName)
|
||||
{
|
||||
mNodeInfo->GetPrefix(aNodeName);
|
||||
if (aNodeName.Length()) {
|
||||
aNodeName.Append(PRUnichar(':'));
|
||||
}
|
||||
nsresult rv = mNodeInfo->GetQualifiedName(aNodeName);
|
||||
|
||||
nsAutoString tmp;
|
||||
mNodeInfo->GetName(tmp);
|
||||
if (mNodeInfo->NamespaceEquals(kNameSpaceID_None))
|
||||
ToUpperCase(aNodeName);
|
||||
|
||||
if (mNodeInfo->NamespaceEquals(kNameSpaceID_None)) {
|
||||
// Only fold to uppercase if the HTML element has no namespace, i.e.,
|
||||
// it was created as part of an HTML document.
|
||||
tmp.ToUpperCase();
|
||||
}
|
||||
|
||||
aNodeName.Append(tmp);
|
||||
|
||||
return NS_OK;
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
Загрузка…
Ссылка в новой задаче