Fix nsXULScrollFrame parameter names that are named incorrectly and fix inconsistencies between .h and .cpp. (Bug 636307) r=ehsan
authorL. David Baron <dbaron@dbaron.org>
Thu, 03 Mar 2011 13:18:42 -0800
changeset 63569 07aaf30a60f9e9a578f825226aa014c6f001e7d8
parent 63568 b17d9492f99fe31e43e354c22079cf30d8e117b5
child 63570 ab94c1fd24cda2e7e65db9b3b552eb96c9494c0f
push idunknown
push userunknown
push dateunknown
reviewersehsan
bugs636307
milestone2.0b13pre
Fix nsXULScrollFrame parameter names that are named incorrectly and fix inconsistencies between .h and .cpp. (Bug 636307) r=ehsan
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGfxScrollFrame.h
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2513,73 +2513,73 @@ nsGfxScrollFrameInner::AsyncScrollPortEv
   if (mInner) {
     mInner->mOuter->PresContext()->GetPresShell()->
       FlushPendingNotifications(Flush_InterruptibleLayout);
   }
   return mInner ? mInner->FireScrollPortEvent() : NS_OK;
 }
 
 PRBool
-nsXULScrollFrame::AddHorizontalScrollbar(nsBoxLayoutState& aState, PRBool aOnTop)
+nsXULScrollFrame::AddHorizontalScrollbar(nsBoxLayoutState& aState, PRBool aOnBottom)
 {
   if (!mInner.mHScrollbarBox)
     return PR_TRUE;
 
-  return AddRemoveScrollbar(aState, aOnTop, PR_TRUE, PR_TRUE);
+  return AddRemoveScrollbar(aState, aOnBottom, PR_TRUE, PR_TRUE);
 }
 
 PRBool
 nsXULScrollFrame::AddVerticalScrollbar(nsBoxLayoutState& aState, PRBool aOnRight)
 {
   if (!mInner.mVScrollbarBox)
     return PR_TRUE;
 
   return AddRemoveScrollbar(aState, aOnRight, PR_FALSE, PR_TRUE);
 }
 
 void
-nsXULScrollFrame::RemoveHorizontalScrollbar(nsBoxLayoutState& aState, PRBool aOnTop)
+nsXULScrollFrame::RemoveHorizontalScrollbar(nsBoxLayoutState& aState, PRBool aOnBottom)
 {
   // removing a scrollbar should always fit
 #ifdef DEBUG
   PRBool result =
 #endif
-  AddRemoveScrollbar(aState, aOnTop, PR_TRUE, PR_FALSE);
+  AddRemoveScrollbar(aState, aOnBottom, PR_TRUE, PR_FALSE);
   NS_ASSERTION(result, "Removing horizontal scrollbar failed to fit??");
 }
 
 void
 nsXULScrollFrame::RemoveVerticalScrollbar(nsBoxLayoutState& aState, PRBool aOnRight)
 {
   // removing a scrollbar should always fit
 #ifdef DEBUG
   PRBool result =
 #endif
   AddRemoveScrollbar(aState, aOnRight, PR_FALSE, PR_FALSE);
   NS_ASSERTION(result, "Removing vertical scrollbar failed to fit??");
 }
 
 PRBool
 nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
-                                     PRBool aOnTop, PRBool aHorizontal, PRBool aAdd)
+                                     PRBool aOnRightOrBottom, PRBool aHorizontal, PRBool aAdd)
 {
   if (aHorizontal) {
      if (mInner.mNeverHasHorizontalScrollbar || !mInner.mHScrollbarBox)
        return PR_FALSE;
 
      nsSize hSize = mInner.mHScrollbarBox->GetPrefSize(aState);
      nsBox::AddMargin(mInner.mHScrollbarBox, hSize);
 
      mInner.SetScrollbarVisibility(mInner.mHScrollbarBox, aAdd);
 
      PRBool hasHorizontalScrollbar;
      PRBool fit = AddRemoveScrollbar(hasHorizontalScrollbar,
                                      mInner.mScrollPort.y,
                                      mInner.mScrollPort.height,
-                                     hSize.height, aOnTop, aAdd);
+                                     hSize.height, aOnRightOrBottom, aAdd);
      mInner.mHasHorizontalScrollbar = hasHorizontalScrollbar;    // because mHasHorizontalScrollbar is a PRPackedBool
      if (!fit)
         mInner.SetScrollbarVisibility(mInner.mHScrollbarBox, !aAdd);
 
      return fit;
   } else {
      if (mInner.mNeverHasVerticalScrollbar || !mInner.mVScrollbarBox)
        return PR_FALSE;
@@ -2588,41 +2588,41 @@ nsXULScrollFrame::AddRemoveScrollbar(nsB
      nsBox::AddMargin(mInner.mVScrollbarBox, vSize);
 
      mInner.SetScrollbarVisibility(mInner.mVScrollbarBox, aAdd);
 
      PRBool hasVerticalScrollbar;
      PRBool fit = AddRemoveScrollbar(hasVerticalScrollbar,
                                      mInner.mScrollPort.x,
                                      mInner.mScrollPort.width,
-                                     vSize.width, aOnTop, aAdd);
+                                     vSize.width, aOnRightOrBottom, aAdd);
      mInner.mHasVerticalScrollbar = hasVerticalScrollbar;    // because mHasVerticalScrollbar is a PRPackedBool
      if (!fit)
         mInner.SetScrollbarVisibility(mInner.mVScrollbarBox, !aAdd);
 
      return fit;
   }
 }
 
 PRBool
 nsXULScrollFrame::AddRemoveScrollbar(PRBool& aHasScrollbar, nscoord& aXY,
                                      nscoord& aSize, nscoord aSbSize,
-                                     PRBool aRightOrBottom, PRBool aAdd)
+                                     PRBool aOnRightOrBottom, PRBool aAdd)
 { 
    nscoord size = aSize;
    nscoord xy = aXY;
 
    if (size != NS_INTRINSICSIZE) {
      if (aAdd) {
         size -= aSbSize;
-        if (!aRightOrBottom && size >= 0)
+        if (!aOnRightOrBottom && size >= 0)
           xy += aSbSize;
      } else {
         size += aSbSize;
-        if (!aRightOrBottom)
+        if (!aOnRightOrBottom)
           xy -= aSbSize;
      }
    }
 
    // not enough room? Yes? Return true.
    if (size >= 0) {
        aHasScrollbar = aAdd;
        aSize = size;
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -640,17 +640,17 @@ public:
   static PRBool AddRemoveScrollbar(PRBool& aHasScrollbar, 
                                    nscoord& aXY, 
                                    nscoord& aSize, 
                                    nscoord aSbSize, 
                                    PRBool aOnRightOrBottom, 
                                    PRBool aAdd);
   
   PRBool AddRemoveScrollbar(nsBoxLayoutState& aState, 
-                            PRBool aOnTop, 
+                            PRBool aOnRightOrBottom, 
                             PRBool aHorizontal, 
                             PRBool aAdd);
   
   PRBool AddHorizontalScrollbar (nsBoxLayoutState& aState, PRBool aOnBottom);
   PRBool AddVerticalScrollbar   (nsBoxLayoutState& aState, PRBool aOnRight);
   void RemoveHorizontalScrollbar(nsBoxLayoutState& aState, PRBool aOnBottom);
   void RemoveVerticalScrollbar  (nsBoxLayoutState& aState, PRBool aOnRight);