mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
per-window browse with caret: allow the caret to be moved with arrow keys on any window (e.g., viewsource) for which the caret is enabled, b=254078, r+sr=bzbarsky
This commit is contained in:
parent
6310329ee0
commit
0d6c204cda
@ -256,15 +256,17 @@ nsSelectMoveScrollCommand::DoSelectCommand(const char *aCommandName, nsIDOMWindo
|
||||
GetSelectionControllerFromWindow(aWindow, getter_AddRefs(selCont));
|
||||
NS_ENSURE_TRUE(selCont, NS_ERROR_NOT_INITIALIZED);
|
||||
|
||||
PRBool doBrowseWithCaret = PR_FALSE;
|
||||
PRBool caretOn = PR_FALSE;
|
||||
selCont->GetCaretEnabled(&caretOn);
|
||||
|
||||
nsCOMPtr<nsIEventStateManager> esm;
|
||||
GetEventStateManagerForWindow(aWindow, getter_AddRefs(esm));
|
||||
if (esm)
|
||||
doBrowseWithCaret = esm->GetBrowseWithCaret();
|
||||
|
||||
nsresult rv;
|
||||
if (doBrowseWithCaret)
|
||||
// We allow the caret to be moved with arrow keys on any window for which
|
||||
// the caret is enabled. In particular, this includes caret-browsing mode,
|
||||
// but we refer to this mode again in the test condition for readability.
|
||||
if (caretOn || (esm && esm->GetBrowseWithCaret()))
|
||||
rv = DoCommandBrowseWithCaretOn(aCommandName, selCont, esm);
|
||||
else
|
||||
rv = DoCommandBrowseWithCaretOff(aCommandName, selCont);
|
||||
|
Loading…
Reference in New Issue
Block a user