зеркало из https://github.com/mozilla/gecko-dev.git
Bug 328881. Set the frame offset of scrolled frames correctly. This shouldn't affect anything immediately --- the offset is not used currently --- but it helps prepare for view removal and I'd like to catch regressions now. r+sr=dbaron
This commit is contained in:
Родитель
c6b545fb8c
Коммит
64c6e67319
|
@ -663,13 +663,14 @@ nsHTMLScrollFrame::PlaceScrollArea(const ScrollReflowState& aState)
|
||||||
vm->ResizeView(scrollView, nsRect(nsPoint(0, 0), aState.mScrollPortRect.Size()),
|
vm->ResizeView(scrollView, nsRect(nsPoint(0, 0), aState.mScrollPortRect.Size()),
|
||||||
PR_TRUE);
|
PR_TRUE);
|
||||||
|
|
||||||
// set the origin of childRect to (0,0) even though we might have borders or
|
// Set the x,y of the scrolled frame to the correct value: the displacement
|
||||||
// a left-hand-side scrollbar. We've accounted for that by positioning the
|
// from its origin to the origin of this frame
|
||||||
// anonymous mScrollableView.
|
|
||||||
nsSize childSize = mInner.mScrolledFrame->GetSize();
|
nsSize childSize = mInner.mScrolledFrame->GetSize();
|
||||||
nsRect childRect = nsRect(0, 0,
|
nsPoint childOffset =
|
||||||
PR_MAX(childSize.width, aState.mScrollPortRect.width),
|
mInner.mScrolledFrame->GetView()->GetOffsetTo(GetView());
|
||||||
PR_MAX(childSize.height, aState.mScrollPortRect.height));
|
nsRect childRect = nsRect(childOffset,
|
||||||
|
nsSize(PR_MAX(childSize.width, aState.mScrollPortRect.width),
|
||||||
|
PR_MAX(childSize.height, aState.mScrollPortRect.height)));
|
||||||
mInner.mScrolledFrame->SetRect(childRect);
|
mInner.mScrolledFrame->SetRect(childRect);
|
||||||
|
|
||||||
nsRect overflowRect = mInner.mScrolledFrame->GetOverflowRect();
|
nsRect overflowRect = mInner.mScrolledFrame->GetOverflowRect();
|
||||||
|
@ -1744,6 +1745,10 @@ nsGfxScrollFrameInner::ScrollPositionDidChange(nsIScrollableView* aScrollable, n
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!mViewInitiatedScroll, "Cannot reenter ScrollPositionDidChange");
|
NS_ASSERTION(!mViewInitiatedScroll, "Cannot reenter ScrollPositionDidChange");
|
||||||
|
|
||||||
|
// Update frame position to match view offsets
|
||||||
|
nsPoint childOffset = mScrolledFrame->GetView()->GetOffsetTo(mOuter->GetView());
|
||||||
|
mScrolledFrame->SetPosition(childOffset);
|
||||||
|
|
||||||
mViewInitiatedScroll = PR_TRUE;
|
mViewInitiatedScroll = PR_TRUE;
|
||||||
InternalScrollPositionDidChange(aX, aY);
|
InternalScrollPositionDidChange(aX, aY);
|
||||||
mViewInitiatedScroll = PR_FALSE;
|
mViewInitiatedScroll = PR_FALSE;
|
||||||
|
@ -2113,10 +2118,9 @@ nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState, const nsRect& aRect
|
||||||
vm->ResizeView(scrollView, nsRect(nsPoint(0, 0), aRect.Size()), PR_TRUE);
|
vm->ResizeView(scrollView, nsRect(nsPoint(0, 0), aRect.Size()), PR_TRUE);
|
||||||
|
|
||||||
PRUint32 oldflags = aState.LayoutFlags();
|
PRUint32 oldflags = aState.LayoutFlags();
|
||||||
// set the origin of childRect to (0,0) even though we might have
|
nsPoint childOffset =
|
||||||
// borders or a left-hand-side scrollbar. We've accounted for that
|
mInner.mScrolledFrame->GetView()->GetOffsetTo(GetView());
|
||||||
// by positioning the anonymous mScrollableView.
|
nsRect childRect = nsRect(childOffset, aRect.Size());
|
||||||
nsRect childRect = nsRect(nsPoint(0, 0), aRect.Size());
|
|
||||||
|
|
||||||
PRInt32 flags = NS_FRAME_NO_MOVE_VIEW;
|
PRInt32 flags = NS_FRAME_NO_MOVE_VIEW;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче