diff --git a/content/html/document/src/ImageDocument.cpp b/content/html/document/src/ImageDocument.cpp index 6b4a804f8e5a..23a5f01483b4 100644 --- a/content/html/document/src/ImageDocument.cpp +++ b/content/html/document/src/ImageDocument.cpp @@ -691,7 +691,7 @@ ImageDocument::CheckOverflowing(bool changeState) { /* Create a scope so that the style context gets destroyed before we might * call RebuildStyleData. Also, holding onto pointers to the - * presentatation through style resolution is potentially dangerous. + * presentation through style resolution is potentially dangerous. */ { nsIPresShell *shell = GetShell(); @@ -702,23 +702,6 @@ ImageDocument::CheckOverflowing(bool changeState) nsPresContext *context = shell->GetPresContext(); nsRect visibleArea = context->GetVisibleArea(); - Element* body = GetBodyElement(); - if (!body) { - NS_WARNING("no body on image document!"); - return NS_ERROR_FAILURE; - } - - nsRefPtr styleContext = - context->StyleSet()->ResolveStyleFor(body, nsnull); - - nsMargin m; - if (styleContext->GetStyleMargin()->GetMargin(m)) - visibleArea.Deflate(m); - m = styleContext->GetStyleBorder()->GetActualBorder(); - visibleArea.Deflate(m); - if (styleContext->GetStylePadding()->GetPadding(m)) - visibleArea.Deflate(m); - mVisibleWidth = nsPresContext::AppUnitsToIntCSSPixels(visibleArea.width); mVisibleHeight = nsPresContext::AppUnitsToIntCSSPixels(visibleArea.height); }