Bug 901671 - Control-L should always select the text in the address field [r=rsilveira]

This commit is contained in:
Matt Brubeck 2013-08-06 16:06:37 -07:00
parent 6bdd15e23a
commit 2db118e308
2 changed files with 9 additions and 0 deletions

View File

@ -1022,6 +1022,7 @@ var BrowserUI = {
case "cmd_openLocation":
ContextUI.displayNavbar();
this._edit.beginEditing(true);
this._edit.select();
break;
case "cmd_addBookmark":
ContextUI.displayNavbar();

View File

@ -84,6 +84,14 @@ gTests.push({
is(edit.selectionStart, 0, "Location field is selected");
is(edit.selectionEnd, edit.value.length, "Location field is selected");
edit.selectionEnd = 0;
is(edit.selectionStart, 0, "Location field is unselected");
is(edit.selectionEnd, 0, "Location field is unselected");
EventUtils.synthesizeKey('l', { accelKey: true });
is(edit.selectionStart, 0, "Location field is selected again");
is(edit.selectionEnd, edit.value.length, "Location field is selected again");
Browser.closeTab(tab, { forceClose: true });
}
});