From e0cc767b0554f6234ac947ad63b315efbedbaf10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 11 Jan 2012 11:16:52 -0800 Subject: [PATCH] Bug 717030 - Cancel fullscreen animation when entering dom fullscreen [r=dao] --- browser/base/content/browser.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 9620d28e8e0..b1ffeac036d 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3907,13 +3907,10 @@ var FullScreen = { } else { // The user may quit fullscreen during an animation - window.mozCancelAnimationFrame(this._animationHandle); - this._animationHandle = 0; - clearTimeout(this._animationTimeout); + this._cancelAnimation(); gNavToolbox.style.marginTop = ""; if (this._isChromeCollapsed) this.mouseoverToggle(true); - this._isAnimating = false; // This is needed if they use the context menu to quit fullscreen this._isPopupOpen = false; @@ -3974,10 +3971,7 @@ var FullScreen = { // Cancel any "hide the toolbar" animation which is in progress, and make // the toolbar hide immediately. - clearInterval(this._animationInterval); - clearTimeout(this._animationTimeout); - this._isAnimating = false; - this._shouldAnimate = false; + this._cancelAnimation(); this.mouseoverToggle(false); // If there's a full-screen toggler, remove its listeners, so that mouseover @@ -4122,11 +4116,8 @@ var FullScreen = { if (pos >= 1) { // We've animated enough - window.mozCancelAnimationFrame(this._animationHandle); + this._cancelAnimation(); gNavToolbox.style.marginTop = ""; - this._animationHandle = 0; - this._isAnimating = false; - this._shouldAnimate = false; // Just to make sure this.mouseoverToggle(false); return; } @@ -4135,6 +4126,14 @@ var FullScreen = { this._animationHandle = window.mozRequestAnimationFrame(this); }, + _cancelAnimation: function() { + window.mozCancelAnimationFrame(this._animationHandle); + this._animationHandle = 0; + clearTimeout(this._animationTimeout); + this._isAnimating = false; + this._shouldAnimate = false; + }, + cancelWarning: function(event) { if (!this.warningBox) { return;