зеркало из https://github.com/mozilla/pjs.git
49339 "Saving File" dialog doesn't initially show complete filename
Replaced call to ScrollSelectionIntoView() in SetTextControlFrameState() with a call to nsIScrollableView::ScrollTo() that resets the scroll position of the text widget to (0,0) when the value is replaced. r=sfraser@netscape.com
This commit is contained in:
Родитель
fde1da2784
Коммит
150231e9f0
|
@ -1075,6 +1075,7 @@ nsGfxTextControlFrame2::nsGfxTextControlFrame2(nsIPresShell* aShell):nsStackFram
|
|||
mCachedState = nsnull;
|
||||
mSuggestedWidth = NS_FORMSIZE_NOTSET;
|
||||
mSuggestedHeight = NS_FORMSIZE_NOTSET;
|
||||
mScrollableView = nsnull;
|
||||
}
|
||||
|
||||
nsGfxTextControlFrame2::~nsGfxTextControlFrame2()
|
||||
|
@ -3035,7 +3036,14 @@ nsGfxTextControlFrame2::SetTextControlFrameState(const nsAReadableString& aValue
|
|||
if (domSel)
|
||||
domSel->EndBatchChanges();
|
||||
}
|
||||
mTextSelImpl->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,nsISelectionController::SELECTION_FOCUS_REGION);
|
||||
|
||||
if (mScrollableView)
|
||||
{
|
||||
// Scroll the upper left corner of the text control's
|
||||
// content area back into view.
|
||||
|
||||
mScrollableView->ScrollTo(0, 0, NS_VMREFRESH_NO_SYNC);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3109,6 +3117,7 @@ nsGfxTextControlFrame2::SetInitialChildList(nsIPresContext* aPresContext,
|
|||
view->QueryInterface(NS_GET_IID(nsIScrollableView),(void **)&scrollView);
|
||||
if (scrollView)
|
||||
{
|
||||
mScrollableView = scrollView; // Note: views are not addref'd
|
||||
mTextSelImpl->SetScrollableView(scrollView);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ class nsISelectionController;
|
|||
class nsTextInputSelectionImpl;
|
||||
class nsTextInputListener;
|
||||
class nsIDOMCharacterData;
|
||||
class nsIScrollableView;
|
||||
|
||||
|
||||
class nsGfxTextControlFrame2 : public nsStackFrame,
|
||||
|
@ -251,6 +252,7 @@ private:
|
|||
nsFormFrame *mFormFrame;
|
||||
nsTextInputSelectionImpl *mTextSelImpl;
|
||||
nsTextInputListener *mTextListener;
|
||||
nsIScrollableView *mScrollableView;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче