mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1170242 - On accessibility SetSelectionRange, scroll the selection into view. r=surkov
This commit is contained in:
parent
db2853b001
commit
980959a1a0
@ -1336,6 +1336,13 @@ HyperTextAccessible::SetSelectionRange(int32_t aStartPos, int32_t aEndPos)
|
||||
domSel->RemoveRange(domSel->GetRangeAt(idx));
|
||||
SetSelectionBoundsAt(0, aStartPos, aEndPos);
|
||||
|
||||
// Make sure it is visible
|
||||
domSel->ScrollIntoView(nsISelectionController::SELECTION_FOCUS_REGION,
|
||||
nsIPresShell::ScrollAxis(),
|
||||
nsIPresShell::ScrollAxis(),
|
||||
dom::Selection::SCROLL_FOR_CARET_MOVE |
|
||||
dom::Selection::SCROLL_OVERFLOW_HIDDEN);
|
||||
|
||||
// When selection is done, move the focus to the selection if accessible is
|
||||
// not focusable. That happens when selection is set within hypertext
|
||||
// accessible.
|
||||
|
Loading…
Reference in New Issue
Block a user