зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1522529 - Remove focus hack from the gURLBar getter and properly implement UrlbarInput focus and blur methods. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D17521 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
dd194db5d7
Коммит
535429cd1f
|
@ -190,11 +190,6 @@ XPCOMUtils.defineLazyGetter(this, "gURLBar", () => {
|
|||
return element;
|
||||
}
|
||||
|
||||
// Re-focus the input field if it was focused before switching bindings.
|
||||
if (element.hasAttribute("focused")) {
|
||||
element.inputField.focus();
|
||||
}
|
||||
|
||||
return new UrlbarInput({
|
||||
textbox: element,
|
||||
panel: document.getElementById("urlbar-results"),
|
||||
|
|
|
@ -62,7 +62,7 @@ class UrlbarInput {
|
|||
// Forward textbox methods and properties.
|
||||
const METHODS = ["addEventListener", "removeEventListener",
|
||||
"setAttribute", "hasAttribute", "removeAttribute", "getAttribute",
|
||||
"focus", "blur", "select"];
|
||||
"select"];
|
||||
const READ_ONLY_PROPERTIES = ["inputField", "editor"];
|
||||
const READ_WRITE_PROPERTIES = ["placeholder", "readOnly",
|
||||
"selectionStart", "selectionEnd"];
|
||||
|
@ -141,6 +141,14 @@ class UrlbarInput {
|
|||
this.view.close();
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.inputField.focus();
|
||||
}
|
||||
|
||||
blur() {
|
||||
this.inputField.blur();
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an internal URI (e.g. a wyciwyg URI) into one which we can
|
||||
* expose to the user.
|
||||
|
|
Загрузка…
Ссылка в новой задаче