Bug 1255006 - Ensure the displayport rect takes priority over a suppressed-margins displayport. r=kats
authorRoman Lopez <xfftlfanx@gmail.com>
Mon, 21 Mar 2016 21:56:44 -0400
changeset 289734 9866d07334e1f819bc9e75b50e2810479389c612
parent 289733 6ffdefc8cba71642dd72887974a8a501e08d404b
child 289735 8823b620ef0f9b5a549844861e332b6943df5f62
push id30108
push usercbook@mozilla.com
push dateTue, 22 Mar 2016 11:14:31 +0000
treeherdermozilla-central@ea6298e1b4f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1255006
milestone48.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 1255006 - Ensure the displayport rect takes priority over a suppressed-margins displayport. r=kats
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1037,21 +1037,21 @@ GetDisplayPortImpl(nsIContent* aContent,
       rectData = nullptr;
     }
   }
 
   NS_ASSERTION((rectData == nullptr) != (marginsData == nullptr),
                "Only one of rectData or marginsData should be set!");
 
   nsRect result;
-  if (APZCCallbackHelper::IsDisplayportSuppressed()) {
+  if (rectData) {
+    result = GetDisplayPortFromRectData(aContent, rectData, aMultiplier);
+  } else if (APZCCallbackHelper::IsDisplayportSuppressed()) {
     DisplayPortMarginsPropertyData noMargins(ScreenMargin(), 1);
     result = GetDisplayPortFromMarginsData(aContent, &noMargins, aMultiplier);
-  } else if (rectData) {
-    result = GetDisplayPortFromRectData(aContent, rectData, aMultiplier);
   } else {
     result = GetDisplayPortFromMarginsData(aContent, marginsData, aMultiplier);
   }
 
   if (!gfxPrefs::LayersTilesEnabled()) {
     // Either we should have gotten a valid rect directly from the displayport
     // base, or we should have computed a valid rect from the margins.
     NS_ASSERTION(result.width <= GetMaxDisplayPortSize(aContent),