From 951816d187003e565966e5a82387704e7c8f346f Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Sun, 1 Dec 2013 01:15:34 +0900 Subject: [PATCH] Don't call onSizemodeChange on the initialization process, if it is not fullscreen --- modules/fullscreenObserver.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/fullscreenObserver.js b/modules/fullscreenObserver.js index fbb07570..a2254031 100644 --- a/modules/fullscreenObserver.js +++ b/modules/fullscreenObserver.js @@ -72,8 +72,7 @@ FullscreenObserver.prototype = { aMutations.forEach(function(aMutation) { if (aMutation.type != 'attributes') return; - if (aMutation.attributeName == 'sizemode' && - this.window.document.documentElement.getAttribute('sizemode') == 'fullscreen') + if (aMutation.attributeName == 'sizemode') this.window.setTimeout((function() { this.onSizeModeChange(); }).bind(this), 10); @@ -84,6 +83,8 @@ FullscreenObserver.prototype = { { var w = this.window: var d = w.document; + if (d.documentElement.getAttribute('sizemode') != 'fullscreen') + return; var toolbox = w.gNavToolbox; toolbox.style.marginTop = -toolbox.getBoundingClientRect().height + 'px';