context->ResolveStyleContextFor(content, nsnull, getter_AddRefs(styleContext));
nsRefPtr<nsStyleContext> styleContext = context->ResolveStyleContextFor(content, nsnull);
nsImageDocument::CheckOverflowing(){  nsCOMPtr<nsIPresShell> shell;  GetShellAt(0, getter_AddRefs(shell));  if (!shell) {    return NS_OK;  }  nsCOMPtr<nsIPresContext> context;  shell->GetPresContext(getter_AddRefs(context));  nsRect visibleArea;  context->GetVisibleArea(visibleArea);  nsCOMPtr<nsIStyleContext> styleContext;  nsCOMPtr<nsIContent> content = do_QueryInterface(mBodyContent);  context->ResolveStyleContextFor(content, nsnull, getter_AddRefs(styleContext));  const nsStyleMargin* marginData =    (const nsStyleMargin*)styleContext->GetStyleData(eStyleStruct_Margin);  nsMargin margin;  marginData->GetMargin(margin);  visibleArea.Deflate(margin);  nsStyleBorderPadding bPad;  styleContext->GetBorderPaddingFor(bPad);  bPad.GetBorderPadding(margin);  visibleArea.Deflate(margin);  float t2p;  context->GetTwipsToPixels(&t2p);  mVisibleWidth = NSTwipsToIntPixels(visibleArea.width, t2p);  mVisibleHeight = NSTwipsToIntPixels(visibleArea.height, t2p);  mImageIsOverflowing = mImageWidth > mVisibleWidth || mImageHeight > mVisibleHeight;  if (mImageIsOverflowing) {    ShrinkToFit();  }  else if (mImageIsResized) {    RestoreImage();  }  return NS_OK;}