}  if (mDocument) {    mDocument->FlushPendingNotifications();
nsHTMLImageElement::GetWidthHeight(PRInt32* aWidth, PRInt32* aHeight){  if (aHeight) {    *aHeight = 0;  }  if (aWidth) {    *aWidth = 0;  }  nsIImageFrame* imageFrame;  GetImageFrame(&imageFrame);  nsIFrame* frame = nsnull;  if (imageFrame) {    CallQueryInterface(imageFrame, &frame);    NS_WARN_IF_FALSE(frame,"Should not happen - image frame is not frame");  }  if (frame) {    nsSize size;    frame->GetSize(size);    nsMargin margin;    frame->CalcBorderPadding(margin);    size.height -= margin.top + margin.bottom;    size.width -= margin.left + margin.right;    nsCOMPtr<nsIPresContext> context;    GetPresContext(this, getter_AddRefs(context));    if (context) {      float t2p;      context->GetTwipsToPixels(&t2p);      if (aWidth) {        *aWidth = NSTwipsToIntPixels(size.width, t2p);      }      if (aHeight) {        *aHeight = NSTwipsToIntPixels(size.height, t2p);      }    }  } else {    nsHTMLValue value;    if (aWidth) {      nsresult rv = GetHTMLAttribute(nsHTMLAtoms::width, value);      if (rv == NS_CONTENT_ATTR_HAS_VALUE) {        *aWidth = value.GetPixelValue();      }    }    if (aHeight) {      nsresult rv = GetHTMLAttribute(nsHTMLAtoms::height, value);      if (rv == NS_CONTENT_ATTR_HAS_VALUE) {        *aHeight = value.GetPixelValue();      }    }  }  return NS_OK;}