Bug 1477525 part 2 - Try hiding toolbox again when input in chrome loses the focus. r?dao
MozReview-Commit-ID: LnwVXN4oS2Z
--- a/browser/base/content/browser-fullScreenAndPointerLock.js
+++ b/browser/base/content/browser-fullScreenAndPointerLock.js
@@ -591,19 +591,25 @@ var FullScreen = {
return;
}
// On OS X Lion we don't want to hide toolbars.
if (this.useLionFullScreen) {
return;
}
// a textbox in chrome is focused (location bar anyone?): don't collapse chrome
- if (document.commandDispatcher.focusedElement &&
- document.commandDispatcher.focusedElement.ownerDocument == document &&
- document.commandDispatcher.focusedElement.localName == "input") {
+ let focused = document.commandDispatcher.focusedElement;
+ if (focused && focused.ownerDocument == document &&
+ focused.localName == "input") {
+ // But try collapse the chrome again when it loses the focus.
+ focused.addEventListener("blur", () => {
+ // If we don't set any timeout here, the content may move before
+ // user's click takes effect.
+ setTimeout(() => this.hideNavToolbox(aAnimate), 300);
+ }, {once: true});
return;
}
this._fullScrToggler.hidden = false;
if (aAnimate && Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled")) {
gNavToolbox.setAttribute("fullscreenShouldAnimate", true);
// Hide the fullscreen toggler until the transition ends.