Fix GetAttributes() in XUL to work right. Bug 169825, r=sicking, sr=peterv

This commit is contained in:
bzbarsky%mit.edu 2003-09-25 03:51:12 +00:00
Родитель eb2d62de83
Коммит 24ea48e040
1 изменённых файлов: 14 добавлений и 16 удалений

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

@ -841,9 +841,8 @@ nsXULElement::GetNextSibling(nsIDOMNode** aNextSibling)
NS_IMETHODIMP
nsXULElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
{
nsresult rv;
if (! Attributes()) {
// We fault everything, until we can fix nsXULAttributes
// We fault everything (since the caller will be able to set and
// remove attributes at will, and may try to enumerate them).
#ifdef DEBUG_ATTRIBUTE_STATS
if (mPrototype) {
gFaults.GetAttributes++; gFaults.Total++;
@ -852,7 +851,7 @@ nsXULElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
}
#endif
rv = MakeHeavyweight();
nsresult rv = MakeHeavyweight();
if (NS_FAILED(rv)) return rv;
if (! Attributes()) {
@ -862,7 +861,6 @@ nsXULElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
mSlots->SetAttributes(attrs);
}
}
*aAttributes = Attributes();
NS_ADDREF(*aAttributes);