Bug 654698 - Overlap the border on select elements correctly in RTL; r=jimm
authorKai Liu <kliu@code.kliu.org>
Sun, 15 May 2011 12:25:54 +0200
changeset 69546 a466b57361d08afaca52c65ef113cca96d2a6fa0
parent 69545 9bfceb76e15e1be5fa3d77ae13bd8b1028b99e57
child 69547 f937f55b4a7f8e80b997403ab49a8885408b23da
push id20009
push userMs2ger@gmail.com
push dateSun, 15 May 2011 13:28:32 +0000
treeherdermozilla-central@62b546e80604 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs654698
milestone6.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 654698 - Overlap the border on select elements correctly in RTL; r=jimm
widget/src/windows/nsNativeThemeWin.cpp
--- a/widget/src/windows/nsNativeThemeWin.cpp
+++ b/widget/src/windows/nsNativeThemeWin.cpp
@@ -1250,16 +1250,21 @@ nsNativeThemeWin::DrawWidgetBackground(n
   {
     tr.y -= 1.0;
     tr.width += 1.0;
     tr.height += 2.0;
 
     dr.y -= 1.0;
     dr.width += 1.0;
     dr.height += 2.0;
+
+    if (IsFrameRTL(aFrame)) {
+      tr.x -= 1.0;
+      dr.x -= 1.0;
+    }
   }
 
   nsRefPtr<gfxContext> ctx = aContext->ThebesContext();
 
   gfxWindowsNativeDrawing nativeDrawing(ctx, dr, GetWidgetNativeDrawingFlags(aWidgetType));
 
 RENDER_AGAIN:
 
@@ -1434,17 +1439,18 @@ RENDER_AGAIN:
       sepRect.right -= gutterSize.cx;
     else
       sepRect.left += gutterSize.cx;
 
     nsUXThemeData::drawThemeBG(theme, hdc, MENU_POPUPSEPARATOR, /* state */ 0, &sepRect, &clipRect);
   }
   // The following widgets need to be RTL-aware
   else if (aWidgetType == NS_THEME_MENUARROW ||
-           aWidgetType == NS_THEME_RESIZER)
+           aWidgetType == NS_THEME_RESIZER ||
+           aWidgetType == NS_THEME_DROPDOWN_BUTTON)
   {
     DrawThemeBGRTLAware(theme, hdc, part, state,
                         &widgetRect, &clipRect, IsFrameRTL(aFrame));
   }
   // If part is negative, the element wishes us to not render a themed
   // background, instead opting to be drawn specially below.
   else if (part >= 0) {
     nsUXThemeData::drawThemeBG(theme, hdc, part, state, &widgetRect, &clipRect);