Make the scroll bar and resizer always be on the left of right-to-left widgets. Bug 556363, r=Enn
authorSimon Montagu <smontagu@smontagu.org>
Thu, 08 Apr 2010 09:11:14 -0700
changeset 40595 b2726997982c48d5283e023ad8e4e71a5812f80b
parent 40594 c4733ab603efcba8afff349ed80d81b8afc344fc
child 40596 e24d24f3ceedc88c24fc753537bd3b2980eb3157
push idunknown
push userunknown
push dateunknown
reviewersEnn
bugs556363
milestone1.9.3a5pre
Make the scroll bar and resizer always be on the left of right-to-left widgets. Bug 556363, r=Enn
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2689,16 +2689,22 @@ nsGfxScrollFrameInner::IsLTR() const
 
   return frame->GetStyleVisibility()->mDirection != NS_STYLE_DIRECTION_RTL;
 }
 
 PRBool
 nsGfxScrollFrameInner::IsScrollbarOnRight() const
 {
   nsPresContext *presContext = mOuter->PresContext();
+
+  // The position of the scrollbar in top-level windows depends on the pref
+  // layout.scrollbar.side. For non-top-level elements, it depends only on the
+  // directionaliy of the element (equivalent to a value of "1" for the pref).
+  if (!mIsRoot)
+    return IsLTR();
   switch (presContext->GetCachedIntPref(kPresContext_ScrollbarSide)) {
     default:
     case 0: // UI directionality
       return presContext->GetCachedIntPref(kPresContext_BidiDirection)
              == IBMBIDI_TEXTDIRECTION_LTR;
     case 1: // Document / content directionality
       return IsLTR();
     case 2: // Always right