Image title is now set after load is completed so the dimensions will be valid.r=pnunn b=27365

This commit is contained in:
attinasi%netscape.com 2000-02-12 18:09:40 +00:00
Родитель fc8c04ec37
Коммит 032216c8c8
2 изменённых файлов: 8 добавлений и 12 удалений

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

@ -230,9 +230,6 @@ nsImageDocument::StartImageLoad(nsIURI* aURL, nsIStreamListener*& aListener)
// Finally, start the layout going
StartLayout();
// now update the title
UpdateTitle();
return NS_OK;
}
@ -328,8 +325,9 @@ nsImageDocument::EndLayout(nsISupports *ctxt,
nsresult status,
const PRUnichar *errorMsg)
{
// We are being told to stop the layout (in the middle of image loading)
// - nothing to do here...
// Layout has completed: now update the title
UpdateTitle();
return NS_OK;
}
@ -347,7 +345,7 @@ nsresult nsImageDocument::UpdateTitle( void )
if (mImageRequest) {
PRUint32 width, height;
mImageRequest->GetNaturalDimensions(&width, &height);
// if we got a valid size (often we do not) then display it
// if we got a valid size (sometimes we do not) then display it
if (width != 0 && height != 0){
titleStr.Append( " " );
titleStr.Append((PRInt32)width);

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

@ -230,9 +230,6 @@ nsImageDocument::StartImageLoad(nsIURI* aURL, nsIStreamListener*& aListener)
// Finally, start the layout going
StartLayout();
// now update the title
UpdateTitle();
return NS_OK;
}
@ -328,8 +325,9 @@ nsImageDocument::EndLayout(nsISupports *ctxt,
nsresult status,
const PRUnichar *errorMsg)
{
// We are being told to stop the layout (in the middle of image loading)
// - nothing to do here...
// Layout has completed: now update the title
UpdateTitle();
return NS_OK;
}
@ -347,7 +345,7 @@ nsresult nsImageDocument::UpdateTitle( void )
if (mImageRequest) {
PRUint32 width, height;
mImageRequest->GetNaturalDimensions(&width, &height);
// if we got a valid size (often we do not) then display it
// if we got a valid size (sometimes we do not) then display it
if (width != 0 && height != 0){
titleStr.Append( " " );
titleStr.Append((PRInt32)width);