diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index fbe870b4951..1fa422d34d0 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -646,7 +646,6 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect) // date and update our ImageContainer with the new surface. nsRefPtr container; mInstance->GetImageContainer(getter_AddRefs(container)); - gfxIntSize oldSize(0, 0); #ifndef XP_MACOSX // Windowed plugins should not be calling NPN_InvalidateRect, but @@ -664,16 +663,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect) presContext->DevPixelsToAppUnits(invalidRect->top), presContext->DevPixelsToAppUnits(invalidRect->right - invalidRect->left), presContext->DevPixelsToAppUnits(invalidRect->bottom - invalidRect->top)); - if (container) { - gfxIntSize newSize = container->GetCurrentSize(); - if (newSize != oldSize) { - // The image size has changed - invalidate the old area too, bug 635405. - nsRect oldRect = nsRect(0, 0, - presContext->DevPixelsToAppUnits(oldSize.width), - presContext->DevPixelsToAppUnits(oldSize.height)); - rect.UnionRect(rect, oldRect); - } - } + rect.MoveBy(mObjectFrame->GetContentRectRelativeToSelf().TopLeft()); mObjectFrame->InvalidateLayer(rect, nsDisplayItem::TYPE_PLUGIN); return NS_OK;