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,27 +841,25 @@ 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++;
fprintf(stderr, "XUL: Faulting for GetAttributes: %d/%d\n",
gFaults.GetAttributes, gFaults.Total);
}
if (mPrototype) {
gFaults.GetAttributes++; gFaults.Total++;
fprintf(stderr, "XUL: Faulting for GetAttributes: %d/%d\n",
gFaults.GetAttributes, gFaults.Total);
}
#endif
rv = MakeHeavyweight();
nsresult rv = MakeHeavyweight();
if (NS_FAILED(rv)) return rv;
if (! Attributes()) {
nsXULAttributes *attrs;
rv = nsXULAttributes::Create(NS_STATIC_CAST(nsIStyledContent*, this), &attrs);
if (NS_FAILED(rv)) return rv;
if (! Attributes()) {
nsXULAttributes *attrs;
rv = nsXULAttributes::Create(NS_STATIC_CAST(nsIStyledContent*, this), &attrs);
if (NS_FAILED(rv)) return rv;
mSlots->SetAttributes(attrs);
}
mSlots->SetAttributes(attrs);
}
*aAttributes = Attributes();