Bug 984279 - Composition bounds are relative to the reference frame, so make that be true when we use view bounds to calculate them. r=mats, r=botond, a=lsblakk
authorTimothy Nikkel <tnikkel@gmail.com>
Mon, 17 Mar 2014 18:02:11 -0500
changeset 192266 2602ee663acf3cbc2b5d884b389993faf2a8baf4
parent 192265 4959184a7078398d0a1245322400cf4064569f7d
child 192267 59bb9d5d5c604d51b1d15112e297edf4e8048977
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats, botond, lsblakk
bugs984279
milestone30.0a2
Bug 984279 - Composition bounds are relative to the reference frame, so make that be true when we use view bounds to calculate them. r=mats, r=botond, a=lsblakk
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -768,17 +768,18 @@ static void RecordFrameMetrics(nsIFrame*
       if (nsView* view = rootFrame->GetView()) {
         nsIWidget* widget = view->GetWidget();
         if (widget) {
           nsIntRect bounds;
           widget->GetBounds(bounds);
           metrics.mCompositionBounds = ParentLayerIntRect::FromUnknownRect(mozilla::gfx::IntRect(
               bounds.x, bounds.y, bounds.width, bounds.height));
         } else {
-          metrics.mCompositionBounds = RoundedToInt(LayoutDeviceRect::FromAppUnits(view->GetBounds(), auPerDevPixel)
+          nsRect viewBounds = view->GetBounds() + rootFrame->GetOffsetToCrossDoc(aReferenceFrame);
+          metrics.mCompositionBounds = RoundedToInt(LayoutDeviceRect::FromAppUnits(viewBounds, auPerDevPixel)
                                      * metrics.GetParentResolution());
         }
       }
     }
   }
 
   // Adjust composition bounds for the size of scroll bars.
   if (scrollableFrame && !LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars)) {