Bug 353539 - textarea.focus() puts caret at end without scrolling it into view; r=roc

This commit is contained in:
Ehsan Akhgari
2010-03-18 12:14:40 -04:00
parent 0b77e5262d
commit 15d70f00ea
3 changed files with 59 additions and 0 deletions

View File

@@ -1865,6 +1865,11 @@ void nsTextControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
if (NS_SUCCEEDED(InitFocusedValue()))
MaybeBeginSecureKeyboardInput();
// Scroll the current selection into view
mSelCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
nsISelectionController::SELECTION_FOCUS_REGION,
PR_FALSE);
// tell the caret to use our selection
nsCOMPtr<nsISelection> ourSel;