зеркало из https://github.com/mozilla/gecko-dev.git
Bug 950378 - Focus and select the findbar input when using Control-F while findbar is displayed; r=mbrubeck
This commit is contained in:
Родитель
ba6c1b4316
Коммит
158997fd52
|
@ -109,8 +109,16 @@ var FindHelperUI = {
|
|||
},
|
||||
|
||||
show: function findHelperShow() {
|
||||
if (BrowserUI.isStartTabVisible || this._open)
|
||||
if (BrowserUI.isStartTabVisible) {
|
||||
return;
|
||||
}
|
||||
if (this._open) {
|
||||
setTimeout(() => {
|
||||
this._textbox.select();
|
||||
this._textbox.focus();
|
||||
}, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Hide any menus
|
||||
ContextUI.dismiss();
|
||||
|
|
|
@ -26,6 +26,12 @@ gTests.push({
|
|||
EventUtils.sendString("bar");
|
||||
is(textbox.value, "bar", "Type 'bar' into find bar");
|
||||
|
||||
EventUtils.synthesizeKey("f", { accelKey: true});
|
||||
yield waitForEvent(Elements.findbar, "transitionend");
|
||||
ok(document.commandDispatcher.focusedElement, textbox.inputField, "textbox field is focused with Ctrl-F");
|
||||
is(textbox.selectionStart, 0, "textbox field is selected with Ctrl-F.");
|
||||
is(textbox.selectionEnd, textbox.value.length, "textbox field is selected with Ctrl-F.");
|
||||
|
||||
EventUtils.synthesizeKey("VK_ESCAPE", { accelKey: true });
|
||||
yield waitForEvent(Elements.findbar, "transitionend");
|
||||
is(Elements.findbar.isShowing, false, "Hide find bar with Esc");
|
||||
|
|
Загрузка…
Ссылка в новой задаче