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 id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEnn
bugs556363
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
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