Bug 904561: Followup for RTL support. r=smichaud a=bajaj
authorStephen Pohl <spohl.mozilla.bugs@gmail.com>
Thu, 22 Aug 2013 14:08:45 -0400
changeset 148415 2ac632b74eb670dcfaa97ddc1ddd5eb55bbca828
parent 148414 2cb5b5325abef63049262d841cb613a3699232b2
child 148416 f935e4a1c6dde16cc487c46666d271c362048bac
push id2792
push userspohl@mozilla.com
push dateThu, 22 Aug 2013 18:07:05 +0000
treeherdermozilla-beta@2ac632b74eb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud, bajaj
bugs904561
milestone24.0
Bug 904561: Followup for RTL support. r=smichaud a=bajaj
widget/cocoa/nsNativeThemeCocoa.mm
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -2378,17 +2378,22 @@ nsNativeThemeCocoa::DrawWidgetBackground
           CheckBooleanAttr(GetParentScrollbarFrame(aFrame), nsGkAtoms::hover)) {
         BOOL isHorizontal = (aWidgetType == NS_THEME_SCROLLBAR_TRACK_HORIZONTAL);
         if (!nsCocoaFeatures::OnMountainLionOrLater()) {
           // On OSX 10.7, scrollbars don't grow when hovered. The adjustments
           // below were obtained by trial and error.
           if (isHorizontal) {
             macRect.origin.y += 2.0;
           } else {
-            macRect.origin.x += 3.0;
+            if (aFrame->StyleVisibility()->mDirection !=
+                  NS_STYLE_DIRECTION_RTL) {
+              macRect.origin.x += 3.0;
+            } else {
+              macRect.origin.x -= 1.0;
+            }
           }
         }
         const BOOL isOnTopOfDarkBackground = IsDarkBackground(aFrame);
         CUIDraw([NSWindow coreUIRenderer], macRect, cgContext,
                 (CFDictionaryRef)[NSDictionary dictionaryWithObjectsAndKeys:
                   @"kCUIWidgetOverlayScrollBar", @"widget",
                   @"regular", @"size",
                   (isHorizontal ? @"kCUIOrientHorizontal" : @"kCUIOrientVertical"), @"kCUIOrientationKey",