Make scrollbars be reflow roots so that moving the scrollbar in an element with 'overflow' that leads to scrollability doesn't cause a reflow from the top of a document. b=156522 r=waterson sr=kin

This commit is contained in:
dbaron%fas.harvard.edu 2002-07-10 02:17:54 +00:00
Родитель 39e297a855
Коммит 9376629e94
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -91,9 +91,24 @@ nsScrollbarFrame::Init(nsIPresContext* aPresContext,
nsCOMPtr<nsIViewManager> vm;
view->GetViewManager(*getter_AddRefs(vm));
vm->SetViewContentTransparency(view, PR_TRUE);
// We want to be a reflow root since we use reflows to move the
// slider. Any reflow inside the scrollbar frame will be a reflow to
// move the slider and will thus not change anything outside of the
// scrollbar or change the size of the scrollbar frame.
mState |= NS_FRAME_REFLOW_ROOT;
return rv;
}
NS_IMETHODIMP nsScrollbarFrame::IsPercentageBase(PRBool& aBase) const
{
// Return true so that the nsHTMLReflowState code is happy with us
// being a reflow root.
aBase = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP
nsScrollbarFrame::AttributeChanged(nsIPresContext* aPresContext,

Просмотреть файл

@ -96,6 +96,7 @@ public:
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
// nsIScrollbarFrame
NS_IMETHOD SetScrollbarMediator(nsIScrollbarMediator* aMediator) { mScrollbarMediator = aMediator; return NS_OK; };