Bug 678820 - nsAttrAndChildArray shouldn't ask for a new slot in the mapped attributes object when it is not needed. f=bz r=sicking

This commit is contained in:
Mounir Lamouri 2011-08-24 19:27:52 +02:00
Родитель 8f2bbbce9e
Коммит e02ab94c09
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -575,7 +575,13 @@ nsAttrAndChildArray::SetAndTakeMappedAttr(nsIAtom* aLocalName,
nsHTMLStyleSheet* aSheet)
{
nsRefPtr<nsMappedAttributes> mapped;
nsresult rv = GetModifiableMapped(aContent, aSheet, PR_TRUE,
PRBool willAdd = PR_TRUE;
if (mImpl && mImpl->mMappedAttrs) {
willAdd = mImpl->mMappedAttrs->GetAttr(aLocalName) == nsnull;
}
nsresult rv = GetModifiableMapped(aContent, aSheet, willAdd,
getter_AddRefs(mapped));
NS_ENSURE_SUCCESS(rv, rv);