Bug 1093949 - Reverse scroll position for RTL content. r=mats

This commit is contained in:
Jonathan Kew 2014-11-06 09:06:22 +00:00
parent 9309478c4f
commit 193b552c7e
2 changed files with 4 additions and 1 deletions

View File

@ -1132,7 +1132,7 @@ ScrollFrameHelper::ThumbMoved(nsScrollbarFrame* aScrollbar,
nsPoint current = GetScrollPosition();
nsPoint dest = current;
if (isHorizontal) {
dest.x = aNewPos;
dest.x = IsLTR() ? aNewPos : aNewPos - GetScrollRange().width;
} else {
dest.y = aNewPos;
}

View File

@ -41,6 +41,9 @@ public:
virtual void RepeatButtonScroll(nsScrollbarFrame* aScrollbar) = 0;
/**
* aOldPos and aNewPos are scroll positions.
* The scroll positions start with zero at the left edge; implementors that want
* zero at the right edge for RTL content will need to adjust accordingly.
* (See ScrollFrameHelper::ThumbMoved in nsGfxScrollFrame.cpp.)
* @note This method might destroy the frame, pres shell, and other objects.
*/
virtual void ThumbMoved(nsScrollbarFrame* aScrollbar,