Bug 1160250 - Fix up the rect being used for the composition size calculation. r=tn
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 07 May 2015 14:44:03 -0400
changeset 242821 03152183293a551a00543001e38fe7481febd686
parent 242820 0c9790f3db34ef8c4d18183ed19f4d84d6b22cb8
child 242822 c780203cf304b4649a15a42b1bd6e70e7cdf2197
push id59523
push userkgupta@mozilla.com
push dateThu, 07 May 2015 18:44:18 +0000
treeherdermozilla-inbound@bec29299cb7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1160250
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1160250 - Fix up the rect being used for the composition size calculation. r=tn
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -7678,29 +7678,30 @@ DeflateScrollbarAreaFromCompositionBound
 
 /* static */ nsSize
 nsLayoutUtils::CalculateCompositionSizeForFrame(nsIFrame* aFrame, bool aSubtractScrollbars)
 {
   // If we have a scrollable frame, restrict the composition bounds to its
   // scroll port. The scroll port excludes the frame borders and the scroll
   // bars, which we don't want to be part of the composition bounds.
   nsIScrollableFrame* scrollableFrame = aFrame->GetScrollTargetFrame();
-  nsSize size = scrollableFrame ? scrollableFrame->GetScrollPortRect().Size() : aFrame->GetSize();
+  nsRect rect = scrollableFrame ? scrollableFrame->GetScrollPortRect() : aFrame->GetRect();
+  nsSize size = rect.Size();
 
   nsPresContext* presContext = aFrame->PresContext();
   nsIPresShell* presShell = presContext->PresShell();
 
   bool isRootContentDocRootScrollFrame = presContext->IsRootContentDocument()
                                       && aFrame == presShell->GetRootScrollFrame();
   if (isRootContentDocRootScrollFrame) {
     ParentLayerRect compBounds;
     LayoutDeviceToLayerScale2D cumulativeResolution(
         presShell->GetCumulativeResolution()
       * nsLayoutUtils::GetTransformToAncestorScale(aFrame));
-    if (UpdateCompositionBoundsForRCDRSF(compBounds, presContext, aFrame->GetRect(),
+    if (UpdateCompositionBoundsForRCDRSF(compBounds, presContext, rect,
         false, cumulativeResolution)) {
       int32_t auPerDevPixel = presContext->AppUnitsPerDevPixel();
       size = nsSize(compBounds.width * auPerDevPixel, compBounds.height * auPerDevPixel);
     }
   }
 
   if (aSubtractScrollbars && DeflateScrollbarAreaFromCompositionBoundsFor(aFrame)) {
     MOZ_ASSERT(scrollableFrame);