зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
8544352bff
Коммит
8c5bb35531
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче