Loading layout/generic/nsGfxScrollFrame.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -2386,12 +2386,6 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const return result; } static nscoord AlignToDevPixelRoundingToZero(nscoord aVal, PRInt32 aAppUnitsPerDevPixel) { return (aVal/aAppUnitsPerDevPixel)*aAppUnitsPerDevPixel; } nsRect nsGfxScrollFrameInner::GetScrollRange() const { Loading Loading @@ -2927,11 +2921,14 @@ void nsGfxScrollFrameInner::CurPosAttributeChanged(nsIContent* aContent) &allowedRange.x, &allowedRange.width); dest.y = GetCoordAttribute(mVScrollbarBox, nsGkAtoms::curpos, current.y, &allowedRange.y, &allowedRange.height); current += scrolledRect.TopLeft(); dest += scrolledRect.TopLeft(); allowedRange += scrolledRect.TopLeft(); // If we have an async scroll pending don't stomp on that by calling ScrollTo. if (mAsyncScroll && allowedRange.Contains(GetScrollPosition())) { // Don't try to scroll if we're already at an acceptable place. // Don't call Contains here since Contains returns false when the point is // on the bottom or right edge of the rectangle. if (allowedRange.ClampPoint(current) == current) { return; } Loading Loading @@ -3494,6 +3491,12 @@ nsGfxScrollFrameInner::ReflowFinished() // do anything. nsPoint currentScrollPos = GetScrollPosition(); ScrollToImpl(currentScrollPos, nsRect(currentScrollPos, nsSize(0, 0))); if (!mAsyncScroll) { // We need to have mDestination track the current scroll position, // in case it falls outside the new reflow area. mDestination is used // by ScrollBy as its starting position. mDestination = GetScrollPosition(); } if (NS_SUBTREE_DIRTY(mOuter) || !mUpdateScrollbarAttributes) return false; Loading layout/generic/nsGfxScrollFrame.h +1 −4 Original line number Diff line number Diff line Loading @@ -819,12 +819,9 @@ protected: /* * For RTL frames, restore the original scrolled position of the right * edge, then subtract the current width to find the physical position. * This can break the invariant that the scroll position is a multiple of * device pixels, so round off the result to the nearest device pixel. */ if (!mInner.IsLTR()) { aRect.x = PresContext()->RoundAppUnitsToNearestDevPixels( mInner.mScrollPort.XMost() - aScrollPosition.x - aRect.width); aRect.x = mInner.mScrollPort.XMost() - aScrollPosition.x - aRect.width; } mInner.mScrolledFrame->SetBounds(aState, aRect, aRemoveOverflowAreas); } Loading Loading
layout/generic/nsGfxScrollFrame.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -2386,12 +2386,6 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const return result; } static nscoord AlignToDevPixelRoundingToZero(nscoord aVal, PRInt32 aAppUnitsPerDevPixel) { return (aVal/aAppUnitsPerDevPixel)*aAppUnitsPerDevPixel; } nsRect nsGfxScrollFrameInner::GetScrollRange() const { Loading Loading @@ -2927,11 +2921,14 @@ void nsGfxScrollFrameInner::CurPosAttributeChanged(nsIContent* aContent) &allowedRange.x, &allowedRange.width); dest.y = GetCoordAttribute(mVScrollbarBox, nsGkAtoms::curpos, current.y, &allowedRange.y, &allowedRange.height); current += scrolledRect.TopLeft(); dest += scrolledRect.TopLeft(); allowedRange += scrolledRect.TopLeft(); // If we have an async scroll pending don't stomp on that by calling ScrollTo. if (mAsyncScroll && allowedRange.Contains(GetScrollPosition())) { // Don't try to scroll if we're already at an acceptable place. // Don't call Contains here since Contains returns false when the point is // on the bottom or right edge of the rectangle. if (allowedRange.ClampPoint(current) == current) { return; } Loading Loading @@ -3494,6 +3491,12 @@ nsGfxScrollFrameInner::ReflowFinished() // do anything. nsPoint currentScrollPos = GetScrollPosition(); ScrollToImpl(currentScrollPos, nsRect(currentScrollPos, nsSize(0, 0))); if (!mAsyncScroll) { // We need to have mDestination track the current scroll position, // in case it falls outside the new reflow area. mDestination is used // by ScrollBy as its starting position. mDestination = GetScrollPosition(); } if (NS_SUBTREE_DIRTY(mOuter) || !mUpdateScrollbarAttributes) return false; Loading
layout/generic/nsGfxScrollFrame.h +1 −4 Original line number Diff line number Diff line Loading @@ -819,12 +819,9 @@ protected: /* * For RTL frames, restore the original scrolled position of the right * edge, then subtract the current width to find the physical position. * This can break the invariant that the scroll position is a multiple of * device pixels, so round off the result to the nearest device pixel. */ if (!mInner.IsLTR()) { aRect.x = PresContext()->RoundAppUnitsToNearestDevPixels( mInner.mScrollPort.XMost() - aScrollPosition.x - aRect.width); aRect.x = mInner.mScrollPort.XMost() - aScrollPosition.x - aRect.width; } mInner.mScrolledFrame->SetBounds(aState, aRect, aRemoveOverflowAreas); } Loading