Bug 725095 - Address Layout review comments. r=mats
authorAli Juma <ajuma@mozilla.com>
Tue, 13 Mar 2012 12:57:31 -0400
changeset 89348 86b8fd1b875b58d507cf345eb0c2e2a0c7706a80
parent 89347 8fe7ba586573e32884bbaa5da82e39b85c9be4b5
child 89349 0742dd20781ed02fbd3a0342c02ac737e4b76a3b
push id22242
push userkgupta@mozilla.com
push dateWed, 14 Mar 2012 15:19:09 +0000
treeherdermozilla-central@936ef50fa498 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs725095
milestone13.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 725095 - Address Layout review comments. r=mats
layout/base/FrameLayerBuilder.cpp
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -866,17 +866,17 @@ ContainerState::CreateOrRecycleThebesLay
   gfxPoint scaledOffset(
       NSAppUnitsToDoublePixels(offset.x, appUnitsPerDevPixel)*mParameters.mXScale,
       NSAppUnitsToDoublePixels(offset.y, appUnitsPerDevPixel)*mParameters.mYScale);
   nsIntPoint pixOffset(NSToIntRoundUp(scaledOffset.x), NSToIntRoundUp(scaledOffset.y));
   gfxMatrix matrix;
   matrix.Translate(gfxPoint(pixOffset.x, pixOffset.y));
   layer->SetTransform(gfx3DMatrix::From2D(matrix));
 
-   // FIXME: Temporary workaround for bug 681192 and bug 724786. Uncomment this code before review!
+  // FIXME: Temporary workaround for bug 681192 and bug 724786.
 #ifndef MOZ_JAVA_COMPOSITOR
   // Calculate exact position of the top-left of the active scrolled root.
   // This might not be 0,0 due to the snapping in ScaleToNearestPixels.
   gfxPoint activeScrolledRootTopLeft = scaledOffset - matrix.GetTranslation();
   // If it has changed, then we need to invalidate the entire layer since the
   // pixels in the layer buffer have the content at a (subpixel) offset
   // from what we need.
   if (activeScrolledRootTopLeft != data->mActiveScrolledRootPosition) {
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2167,23 +2167,22 @@ nsGfxScrollFrameInner::BuildDisplayList(
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Since making new layers is expensive, only use nsDisplayScrollLayer
   // if the area is scrollable and there's a displayport (or we're the content
   // process).
   nsRect scrollRange = GetScrollRange();
   ScrollbarStyles styles = GetScrollbarStylesFromFrame();
   mShouldBuildLayer =
-     ((XRE_GetProcessType() == GeckoProcessType_Content || usingDisplayport) &&
      (styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN ||
       styles.mVertical != NS_STYLE_OVERFLOW_HIDDEN) &&
-     (scrollRange.width > 0 ||
-      scrollRange.height > 0 || usingDisplayport) &&
-     (usingDisplayport || !mIsRoot ||
-      !mOuter->PresContext()->IsRootContentDocument()));
+     (usingDisplayport ||
+      (XRE_GetProcessType() == GeckoProcessType_Content &&
+       (scrollRange.width > 0 || scrollRange.height > 0) &&
+       (!mIsRoot || !mOuter->PresContext()->IsRootContentDocument())));
 
   if (ShouldBuildLayer()) {
     // ScrollLayerWrapper must always be created because it initializes the
     // scroll layer count. The display lists depend on this.
     ScrollLayerWrapper wrapper(mOuter, mScrolledFrame);
 
     if (usingDisplayport) {
       // Once a displayport is set, assume that scrolling needs to be fast