Loading browser/base/content/browser-tabPreviews.js +6 −2 Original line number Diff line number Diff line Loading @@ -617,8 +617,12 @@ var ctrlTab = { case "keydown": case "keyup": if (event.target == this.searchField) { if (event.keyCode == event.DOM_VK_RETURN) this.panel.focus(); if (event.keyCode == event.DOM_VK_RETURN) { // If there's a pending search, kick it off now. if (this.searchField._timer) this.search(); this.selectThumbnail(); } } else { // Manually consume the events, as the panel is open but doesn't // necessarily have focus. Loading browser/base/content/test/browser_ctrlTab.js +12 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,18 @@ function test() { ok(isOpen(), "panel is sticky after focusing the search field and releasing the Ctrl key"); ctrlTab.searchField.value = "foo"; EventUtils.synthesizeKey("f", {}); EventUtils.synthesizeKey("o", {}); EventUtils.synthesizeKey("o", {}); is(ctrlTab.searchField.value, "foo", "text entered into search field"); EventUtils.synthesizeKey("VK_RETURN", {}); ok(isOpen(), "Enter key kicks pending search off; the panel stays open as there's no match"); is(ctrlTab.searchField.value, "foo", "search field value persists after Enter pressed"); EventUtils.synthesizeKey("VK_ESCAPE", {}); is(ctrlTab.searchField.value, "", "ESC key clears the search field"); Loading Loading
browser/base/content/browser-tabPreviews.js +6 −2 Original line number Diff line number Diff line Loading @@ -617,8 +617,12 @@ var ctrlTab = { case "keydown": case "keyup": if (event.target == this.searchField) { if (event.keyCode == event.DOM_VK_RETURN) this.panel.focus(); if (event.keyCode == event.DOM_VK_RETURN) { // If there's a pending search, kick it off now. if (this.searchField._timer) this.search(); this.selectThumbnail(); } } else { // Manually consume the events, as the panel is open but doesn't // necessarily have focus. Loading
browser/base/content/test/browser_ctrlTab.js +12 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,18 @@ function test() { ok(isOpen(), "panel is sticky after focusing the search field and releasing the Ctrl key"); ctrlTab.searchField.value = "foo"; EventUtils.synthesizeKey("f", {}); EventUtils.synthesizeKey("o", {}); EventUtils.synthesizeKey("o", {}); is(ctrlTab.searchField.value, "foo", "text entered into search field"); EventUtils.synthesizeKey("VK_RETURN", {}); ok(isOpen(), "Enter key kicks pending search off; the panel stays open as there's no match"); is(ctrlTab.searchField.value, "foo", "search field value persists after Enter pressed"); EventUtils.synthesizeKey("VK_ESCAPE", {}); is(ctrlTab.searchField.value, "", "ESC key clears the search field"); Loading