Merge inbound to m-c
authorWes Kocher <wkocher@mozilla.com>
Wed, 14 May 2014 15:10:49 -0700
changeset 183182 e4843f4f08a77c337ec6cf4e0a6bf44e0e3699d8
parent 183179 8c41134879dd9c201337e9b155a74c31ff212091 (current diff)
parent 183181 055fe4ccf91975f74f13fc3866658a6fd713f7ae (diff)
child 183183 6d32bbffc7e41322023db9e67c8e759debaa39b0
child 183199 e74c91d8a96953fb3be43e945ce4cc1568e381fd
child 183227 13197875cc2fb08966c6665f237a015bbecf45a9
child 183319 01c062964d208e9e431bc3b984d4c16d669c4a1b
push idunknown
push userunknown
push dateunknown
milestone32.0a1
Merge inbound to m-c
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1556,20 +1556,22 @@ GetAnimatedGeometryRootForFrame(nsIFrame
       // Viewport frames in a display port need to be animated geometry roots
       // for background-attachment:fixed elements.
       break;
     }
     nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrame(f);
     if (!parent)
       break;
     nsIAtom* parentType = parent->GetType();
+#ifdef ANDROID
     // Treat the slider thumb as being as an active scrolled root
-    // so that it can move without repainting.
+    // on mobile so that it can move without repainting.
     if (parentType == nsGkAtoms::sliderFrame)
       break;
+#endif
     // Sticky frames are active if their nearest scrollable frame
     // is also active, just keep a record of sticky frames that we
     // encounter for now.
     if (f->StyleDisplay()->mPosition == NS_STYLE_POSITION_STICKY &&
         !stickyFrame) {
       stickyFrame = f;
     }
     if (parentType == nsGkAtoms::scrollFrame) {
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -840,17 +840,17 @@ fails-if(winWidget) fails-if(cocoaWidget
 == 400421-1.html 400421-1-ref.html
 == 400813-1.html 400813-1-ref.html
 == 400826-1.html 400826-1-ref.html
 skip-if(B2G&&browserIsRemote) == 401946-1.xul about:blank # bug 974780
 == 402338-1.html 402338-1-ref.html
 == 402567-1.html 402567-1-ref.html
 == 402567-2.html 402567-2-ref.html
 == 402567-3.html 402567-3-ref.html
-skip-if(B2G) fuzzy-if(gtk2Widget,2,40) == 402567-4.html 402567-4-ref.html
+skip-if(B2G) == 402567-4.html 402567-4-ref.html
 == 402629-1.html 402629-1-ref.html
 == 402629-2.html 402629-2-ref.html
 == 402629-3.html 402629-3-ref.html
 skip-if(B2G) == 402807-1.html 402807-1-ref.html
 == 402940-1.html 402940-1-ref.html
 == 402940-1b.html 402940-1-ref.html
 != 402940-2.html 402940-2-notref.html
 != 402940-3.html 402940-3-notref.html
--- a/layout/reftests/image-element/reftest.list
+++ b/layout/reftests/image-element/reftest.list
@@ -12,17 +12,17 @@ skip-if(B2G) fails-if(azureSkia) fails-i
 == element-paint-recursion.html element-paint-recursion-ref.html
 skip-if(B2G) HTTP(..) == element-paint-continuation.html element-paint-continuation-ref.html
 == element-paint-transform-01.html element-paint-transform-01-ref.html
 random-if(d2d) == element-paint-transform-02.html element-paint-transform-02-ref.html # bug 587133
 == element-paint-background-size-01.html element-paint-background-size-01-ref.html
 == element-paint-background-size-02.html element-paint-background-size-02-ref.html
 == element-paint-transform-repeated.html element-paint-transform-repeated-ref.html
 fuzzy-if(d2d,255,24) == element-paint-transform-03.html element-paint-transform-03-ref.html
-fuzzy-if(gtk2Widget,1,32) == element-paint-native-widget.html element-paint-native-widget-ref.html
+== element-paint-native-widget.html element-paint-native-widget-ref.html
 == element-paint-subimage-sampling-restriction.html about:blank
 == element-paint-clippath.html element-paint-clippath-ref.html
 == element-paint-sharpness-01a.html element-paint-sharpness-01b.html
 == element-paint-sharpness-01b.html element-paint-sharpness-01c.html
 == element-paint-sharpness-01c.html element-paint-sharpness-01d.html
 == element-paint-sharpness-02a.html element-paint-sharpness-02b.html
 == element-paint-sharpness-02b.html element-paint-sharpness-02c.html
 == element-paint-paintserversize-rounding-01.html element-paint-paintserversize-rounding-01-ref.html
--- a/layout/reftests/text-overflow/reftest.list
+++ b/layout/reftests/text-overflow/reftest.list
@@ -1,14 +1,14 @@
 skip-if(B2G) == ellipsis-font-fallback.html ellipsis-font-fallback-ref.html
 == line-clipping.html line-clipping-ref.html
 skip-if(B2G) HTTP(..) == marker-basic.html marker-basic-ref.html
 skip-if(B2G) HTTP(..) == marker-string.html marker-string-ref.html
 skip-if(Android||B2G) HTTP(..) == bidi-simple.html bidi-simple-ref.html # Fails on Android due to anti-aliasing
-skip-if(!gtk2Widget) fuzzy-if(gtk2Widget,1,104) HTTP(..) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing
+skip-if(!gtk2Widget) HTTP(..) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing
 skip-if(B2G) fuzzy-if(Android&&AndroidVersion<15,9,2545) fuzzy-if(Android&&AndroidVersion>=15,24,4000) HTTP(..) == scroll-rounding.html scroll-rounding-ref.html # bug 760264
 fuzzy-if(OSX==10.8,1,1) HTTP(..) == anonymous-block.html anonymous-block-ref.html
 skip-if(B2G) HTTP(..) == false-marker-overlap.html false-marker-overlap-ref.html
 HTTP(..) == visibility-hidden.html visibility-hidden-ref.html
 skip-if(B2G) HTTP(..) == block-padding.html block-padding-ref.html
 HTTP(..) == quirks-decorations.html quirks-decorations-ref.html
 HTTP(..) == quirks-line-height.html quirks-line-height-ref.html
 HTTP(..) == standards-decorations.html standards-decorations-ref.html
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -659,20 +659,21 @@ nsSliderFrame::CurrentPositionChanged()
                                          nsGkAtoms::reverse, eCaseMatters);
   nscoord pos = reverse ? (maxPos - curPos) : (curPos - minPos);
 
   if (IsHorizontal())
      newThumbRect.x = clientRect.x + NSToCoordRound(pos * mRatio);
   else
      newThumbRect.y = clientRect.y + NSToCoordRound(pos * mRatio);
 
+#ifdef MOZ_WIDGET_GONK
   // avoid putting the scroll thumb at subpixel positions which cause needless invalidations
   nscoord appUnitsPerPixel = PresContext()->AppUnitsPerDevPixel();
   newThumbRect = newThumbRect.ToNearestPixels(appUnitsPerPixel).ToAppUnits(appUnitsPerPixel);
-
+#endif
   // set the rect
   thumbFrame->SetRect(newThumbRect);
 
   // Request a repaint of the scrollbar
   SchedulePaint();
 
   mCurPos = curPos;
 
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -2476,22 +2476,28 @@ GetDPI(NSWindow* aWindow)
   NSScreen* screen = [aWindow screen];
   if (!screen)
     return 96.0f;
 
   CGDirectDisplayID displayID =
     [[[screen deviceDescription] objectForKey:@"NSScreenNumber"] intValue];
   CGFloat heightMM = ::CGDisplayScreenSize(displayID).height;
   size_t heightPx = ::CGDisplayPixelsHigh(displayID);
-  if (heightMM < 1 || heightPx < 1) {
+  CGFloat scaleFactor = [aWindow userSpaceScaleFactor];
+  if (scaleFactor < 0.01 || heightMM < 1 || heightPx < 1) {
     // Something extremely bogus is going on
     return 96.0f;
   }
 
-  float dpi = heightPx / (heightMM / MM_PER_INCH_FLOAT);
+  // Currently we don't do our own scaling to take account
+  // of userSpaceScaleFactor, so every "pixel" we draw is actually
+  // userSpaceScaleFactor screen pixels. So divide the screen height
+  // by userSpaceScaleFactor to get the number of "device pixels"
+  // available.
+  float dpi = (heightPx / scaleFactor) / (heightMM / MM_PER_INCH_FLOAT);
 
   // Account for HiDPI mode where Cocoa's "points" do not correspond to real
   // device pixels
   CGFloat backingScale = GetBackingScaleFactor(aWindow);
 
   return dpi * backingScale;
 }
 
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -3227,28 +3227,16 @@ nsNativeThemeCocoa::WidgetStateChanged(n
         aAttribute == nsGkAtoms::selected ||
         aAttribute == nsGkAtoms::menuactive ||
         aAttribute == nsGkAtoms::sortDirection ||
         aAttribute == nsGkAtoms::focused ||
         aAttribute == nsGkAtoms::_default ||
         aAttribute == nsGkAtoms::open ||
         aAttribute == nsGkAtoms::hover)
       *aShouldRepaint = true;
-
-    if ((aWidgetType == NS_THEME_SCROLLBAR ||
-         aWidgetType == NS_THEME_SCROLLBAR_SMALL) &&
-        !nsLookAndFeel::UseOverlayScrollbars() &&
-        (aAttribute == nsGkAtoms::curpos ||
-         aAttribute == nsGkAtoms::minpos ||
-         aAttribute == nsGkAtoms::maxpos ||
-         aAttribute == nsGkAtoms::pageincrement)) {
-      // Non-overlay scrollbars paint the thumb as part of the scrollbar,
-      // so we need to invalidate the scrollbar when the thumb moves.
-      *aShouldRepaint = true;
-    }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNativeThemeCocoa::ThemeChanged()
 {