Testing backout of bryner's changes (bug 22820) to see if it fixes pageload regression.

This commit is contained in:
dbaron%fas.harvard.edu 2002-10-22 10:22:19 +00:00
Родитель 9684550ca6
Коммит e7af6753ae
1 изменённых файлов: 12 добавлений и 23 удалений

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

@ -141,7 +141,7 @@ public:
protected:
nsresult SetSrcInner(nsIURI* aBaseURL, const nsAString& aSrc);
void GetImageFrame(nsIImageFrame** aImageFrame);
nsresult GetImageFrame(nsIImageFrame** aImageFrame);
nsresult GetXY(PRInt32* aX, PRInt32* aY);
nsresult GetWidthHeight(PRInt32* aWidth, PRInt32* aHeight);
@ -262,19 +262,19 @@ NS_IMPL_STRING_ATTR(nsHTMLImageElement, LongDesc, longdesc)
NS_IMPL_STRING_ATTR(nsHTMLImageElement, UseMap, usemap)
NS_IMPL_PIXEL_ATTR(nsHTMLImageElement, Vspace, vspace)
void
nsresult
nsHTMLImageElement::GetImageFrame(nsIImageFrame** aImageFrame)
{
if (!aImageFrame) {
return;
}
NS_ENSURE_ARG_POINTER(aImageFrame);
*aImageFrame = nsnull;
nsIFrame* frame = GetPrimaryFrame(PR_TRUE);
if (frame) {
CallQueryInterface(frame, aImageFrame);
}
return NS_OK;
}
NS_IMETHODIMP
@ -547,17 +547,6 @@ nsHTMLImageElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
(aAttribute == nsHTMLAtoms::align)) {
aHint = NS_STYLE_HINT_FRAMECHANGE;
}
else if (aAttribute == nsHTMLAtoms::src) {
// If 'src' changed and we don't have a real image frame,
// we need to cause a reframe.
nsIImageFrame* imageFrame;
// cast away |const| because the underlying interfaces don't use it.
nsHTMLImageElement* self = NS_CONST_CAST(nsHTMLImageElement*, this);
self->GetImageFrame(&imageFrame);
if (!imageFrame) {
aHint = NS_STYLE_HINT_FRAMECHANGE;
}
}
else if (!GetCommonMappedAttributesImpact(aAttribute, aHint)) {
if (!GetImageMappedAttributesImpact(aAttribute, aHint)) {
if (!GetImageBorderAttributeImpact(aAttribute, aHint)) {
@ -908,14 +897,14 @@ nsHTMLImageElement::GetNaturalHeight(PRInt32* aNaturalHeight)
*aNaturalHeight = 0;
nsIImageFrame* imageFrame = nsnull;
GetImageFrame(&imageFrame);
nsresult rv = GetImageFrame(&imageFrame);
if (!imageFrame)
if (NS_FAILED(rv) || !imageFrame)
return NS_OK; // don't throw JS exceptions in this case
PRUint32 width, height;
nsresult rv = imageFrame->GetNaturalImageSize(&width, &height);
rv = imageFrame->GetNaturalImageSize(&width, &height);
if (NS_FAILED(rv))
return NS_OK;
@ -933,14 +922,14 @@ nsHTMLImageElement::GetNaturalWidth(PRInt32* aNaturalWidth)
*aNaturalWidth = 0;
nsIImageFrame* imageFrame;
GetImageFrame(&imageFrame);
nsresult rv = GetImageFrame(&imageFrame);
if (!imageFrame)
if (NS_FAILED(rv) || !imageFrame)
return NS_OK; // don't throw JS exceptions in this case
PRUint32 width, height;
nsresult rv = imageFrame->GetNaturalImageSize(&width, &height);
rv = imageFrame->GetNaturalImageSize(&width, &height);
if (NS_FAILED(rv))
return NS_OK;