Bug 1262151 - Back out bug 1259593 for causing worse checkerboarding in some cases. r=backout
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 05 Apr 2016 10:28:28 -0400
changeset 347772 bd68133cf77165a6e7fd8be2c914a47a293b3a17
parent 347771 ce2b18491b16095d62de958317efdb5999cc5499
child 347773 98a2f0b4690a92095f16295bbfa976572bd2a25c
push id14654
push userbmo:rail@mozilla.com
push dateTue, 05 Apr 2016 19:30:33 +0000
reviewersbackout
bugs1262151, 1259593
milestone48.0a1
Bug 1262151 - Back out bug 1259593 for causing worse checkerboarding in some cases. r=backout
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3483,29 +3483,17 @@ ScrollFrameHelper::DecideScrollableLayer
               // did not take the document's resolution into account, so we must.
               if (rootPresContext->IsRootContentDocument() &&
                   rootFrame == rootPresShell->GetRootScrollFrame()) {
                 rootCompBounds = rootCompBounds.RemoveResolution(rootPresShell->GetResolution());
               }
 
               nsLayoutUtils::TransformRect(rootFrame, mOuter, rootCompBounds);
 
-              // Clamp the displayport base to the size of the transformed root
-              // composition bounds, by trimming an equal amount off opposite
-              // sides of the base rect.
-              if (rootCompBounds.width < displayportBase.width) {
-                nscoord diff = displayportBase.width - rootCompBounds.width;
-                displayportBase.x += diff / 2;
-                displayportBase.width -= diff;
-              }
-              if (rootCompBounds.height < displayportBase.height) {
-                nscoord diff = displayportBase.height - rootCompBounds.height;
-                displayportBase.y += diff / 2;
-                displayportBase.height -= diff;
-              }
+              displayportBase = displayportBase.Intersect(rootCompBounds);
             }
           }
         }
 
         displayportBase -= mScrollPort.TopLeft();
       }
 
       nsLayoutUtils::SetDisplayPortBase(mOuter->GetContent(), displayportBase);