Bug 793196. Speed up hasAttribute string munging of the attr name. r=sicking

This commit is contained in:
Boris Zbarsky 2012-09-22 22:04:54 -04:00
parent 88b8d85e57
commit c1e1158cfc

View File

@ -1160,8 +1160,11 @@ nsGenericElement::HasAttribute(const nsAString& aName, bool* aReturn)
{
NS_ENSURE_ARG_POINTER(aReturn);
const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
*aReturn = (name != nullptr);
const nsAttrValue* val =
mAttrsAndChildren.GetAttr(aName,
IsHTML() && IsInHTMLDocument() ?
eIgnoreCase : eCaseMatters);
*aReturn = (val != nullptr);
return NS_OK;
}