diff --git a/accessible/src/html/nsHyperTextAccessible.cpp b/accessible/src/html/nsHyperTextAccessible.cpp index 553b075667e..be723c487e0 100644 --- a/accessible/src/html/nsHyperTextAccessible.cpp +++ b/accessible/src/html/nsHyperTextAccessible.cpp @@ -1305,7 +1305,8 @@ nsresult nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEn // If range 0 was successfully set, clear any additional selection // ranges remaining from previous selection nsCOMPtr domSel; - GetSelections(nsnull, getter_AddRefs(domSel)); + nsCOMPtr selCon; + GetSelections(getter_AddRefs(selCon), getter_AddRefs(domSel)); if (domSel) { PRInt32 numRanges; domSel->GetRangeCount(&numRanges); @@ -1316,6 +1317,11 @@ nsresult nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEn domSel->RemoveRange(range); } } + + if (selCon) { + selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL, + nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE); + } return NS_OK; }