mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 690011 - Do not initialize the urlbar binding until the UI get activated [r=mfinkle]
This commit is contained in:
parent
c4a996026b
commit
45eb9818b0
@ -399,14 +399,25 @@ var BrowserUI = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
this._edit = document.getElementById("urlbar-edit");
|
let edit = this._edit = document.getElementById("urlbar-edit");
|
||||||
this._title = document.getElementById("urlbar-title");
|
this._title = document.getElementById("urlbar-title");
|
||||||
this._throbber = document.getElementById("urlbar-throbber");
|
this._throbber = document.getElementById("urlbar-throbber");
|
||||||
this._favicon = document.getElementById("urlbar-favicon");
|
this._favicon = document.getElementById("urlbar-favicon");
|
||||||
this._favicon.addEventListener("error", this, false);
|
this._favicon.addEventListener("error", this, false);
|
||||||
|
|
||||||
this._edit.addEventListener("click", this, false);
|
edit.addEventListener("click", this, false);
|
||||||
this._edit.addEventListener("mousedown", this, false);
|
|
||||||
|
// Delay urlbar binding initialization until the user interact with it
|
||||||
|
function urlbarBindOnFocus() {
|
||||||
|
if (!edit.hasAttribute("delaybinding"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
window.removeEventListener("mousedown", urlbarBindOnFocus, true);
|
||||||
|
window.removeEventListener("keydown", urlbarBindOnFocus, true);
|
||||||
|
edit.removeAttribute("delaybinding");
|
||||||
|
};
|
||||||
|
window.addEventListener("mousedown", urlbarBindOnFocus, true);
|
||||||
|
window.addEventListener("keydown", urlbarBindOnFocus, true);
|
||||||
|
|
||||||
window.addEventListener("NavigationPanelShown", this, false);
|
window.addEventListener("NavigationPanelShown", this, false);
|
||||||
window.addEventListener("NavigationPanelHidden", this, false);
|
window.addEventListener("NavigationPanelHidden", this, false);
|
||||||
|
@ -6,7 +6,7 @@ browser[remote="true"] {
|
|||||||
-moz-binding: url("chrome://browser/content/bindings/browser.xml#remote-browser");
|
-moz-binding: url("chrome://browser/content/bindings/browser.xml#remote-browser");
|
||||||
}
|
}
|
||||||
|
|
||||||
#urlbar-edit {
|
#urlbar-edit:not([delaybinding]) {
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#autocomplete-aligned");
|
-moz-binding: url("chrome://browser/content/bindings.xml#autocomplete-aligned");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,6 +253,7 @@
|
|||||||
placeholder="&urlbar.emptytext;"
|
placeholder="&urlbar.emptytext;"
|
||||||
collapsed="true"
|
collapsed="true"
|
||||||
flex="1"
|
flex="1"
|
||||||
|
delaybinding="true"
|
||||||
readonly="true"
|
readonly="true"
|
||||||
ontextentered="BrowserUI.goToURI();"
|
ontextentered="BrowserUI.goToURI();"
|
||||||
clickSelectsAll="true"/>
|
clickSelectsAll="true"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user