зеркало из https://github.com/mozilla/gecko-dev.git
Bug 681192. Part 12: more fixes to remove unnecessary rounding to pixels. r=matspal
--HG-- extra : rebase_source : 39f2c0ef3220b3f0d4f6bc2564a86daa2112dc3b
This commit is contained in:
Родитель
e30cdb3c85
Коммит
2433703320
|
@ -2386,12 +2386,6 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
|
|||
return result;
|
||||
}
|
||||
|
||||
static nscoord
|
||||
AlignToDevPixelRoundingToZero(nscoord aVal, PRInt32 aAppUnitsPerDevPixel)
|
||||
{
|
||||
return (aVal/aAppUnitsPerDevPixel)*aAppUnitsPerDevPixel;
|
||||
}
|
||||
|
||||
nsRect
|
||||
nsGfxScrollFrameInner::GetScrollRange() const
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче