Bug 617152. Part 9: Use desired bounds in nsDisplayList::GetBounds, not actual bounds, when computing plugin geometry. r=tnikkel
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 20 Dec 2010 14:37:43 +1300
changeset 59492 6a5105de6bbd93006b125e097d32c7ec69cac33f
parent 59491 e9f317c9ab529474c5ae041c9a3fadda75cd5833
child 59493 b4a5b419d513bfc9c4eaee444fc9efb45551ab36
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewerstnikkel
bugs617152
milestone2.0b9pre
Bug 617152. Part 9: Use desired bounds in nsDisplayList::GetBounds, not actual bounds, when computing plugin geometry. r=tnikkel
layout/generic/nsObjectFrame.cpp
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -1246,16 +1246,22 @@ nsObjectFrame::PaintPrintPlugin(nsIFrame
   static_cast<nsObjectFrame*>(aFrame)->PrintPlugin(*aCtx, aDirtyRect);
 }
 
 nsRect
 nsDisplayPlugin::GetBounds(nsDisplayListBuilder* aBuilder)
 {
   nsRect r = mFrame->GetContentRect() - mFrame->GetPosition() +
     ToReferenceFrame();
+  if (aBuilder->IsForPluginGeometry()) {
+    // Return the geometry we want, not the geometry we have (which is based
+    // on the surface the plugin last gave us)
+    return r;
+  }
+
   nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame);
   if (mozilla::LAYER_ACTIVE == f->GetLayerState(aBuilder, nsnull)) {
     ImageContainer* c = f->GetImageContainer();
     if (c) {
       gfxIntSize size = c->GetCurrentSize();
       PRInt32 appUnitsPerDevPixel = f->PresContext()->AppUnitsPerDevPixel();
       nsSize sizeAppUnits(size.width*appUnitsPerDevPixel, size.height*appUnitsPerDevPixel);
       r += nsPoint((r.width - sizeAppUnits.width) / 2,