Bug 1277814 - For a zero-margin displayport, do not expand the displayport beyond the scroll port even during low-res painting. r=tnikkel draft
authorBotond Ballo <botond@mozilla.com>
Wed, 08 Jun 2016 18:16:54 -0400
changeset 376919 d2f7c22e3148aae47a48cde83ee359fb77479390
parent 375892 569276f2edd39600de534183e12b7f8762b917c8
child 376920 547466a2e77daef714c3e598a51753d1a9c0f166
push id20714
push userbballo@mozilla.com
push dateThu, 09 Jun 2016 00:31:15 +0000
reviewerstnikkel
bugs1277814
milestone49.0a1
Bug 1277814 - For a zero-margin displayport, do not expand the displayport beyond the scroll port even during low-res painting. r=tnikkel MozReview-Commit-ID: 4ZN8aWkBEwA
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1117,18 +1117,22 @@ GetDisplayPortFromMarginsData(nsIContent
   float w = alignment.width * ceil(screenRect.width / alignment.width + 1);
   float h = alignment.height * ceil(screenRect.height / alignment.height + 1);
   screenRect = ScreenRect(x, y, w, h);
   screenRect -= scrollPosScreen;
 
   // Convert the aligned rect back into app units.
   nsRect result = LayoutDeviceRect::ToAppUnits(screenRect / res, auPerDevPixel);
 
-  // Expand it for the low-res buffer if needed
-  result = ApplyRectMultiplier(result, aMultiplier);
+  // If we have non-zero margins, expand the displayport for the low-res buffer
+  // if that's what we're drawing. If we have zero margins, we want the
+  // displayport to reflect the scrollport.
+  if (aMarginsData->mMargins != ScreenMargin()) {
+    result = ApplyRectMultiplier(result, aMultiplier);
+  }
 
   // Make sure the displayport remains within the scrollable rect.
   result = result.MoveInsideAndClamp(expandedScrollableRect - scrollPos);
 
   return result;
 }
 
 static bool