From 5f1bda47c801c105144536afd2bff61521a4c1f7 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Thu, 28 May 2009 11:52:26 -0400 Subject: [PATCH] Bug 470441: Can't switch tabs between website and about:config, r=mfinkle --- mobile/chrome/content/WidgetStack.js | 12 +++++++++--- mobile/chrome/content/browser.js | 5 +---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mobile/chrome/content/WidgetStack.js b/mobile/chrome/content/WidgetStack.js index 75650990da8..d94a2836edb 100644 --- a/mobile/chrome/content/WidgetStack.js +++ b/mobile/chrome/content/WidgetStack.js @@ -352,6 +352,7 @@ WidgetStack.prototype = { _dragState: null, _skipViewportUpdates: 0, + _forceViewportUpdate: false, // // init: @@ -734,21 +735,26 @@ WidgetStack.prototype = { }, beginUpdateBatch: function startUpdate() { - if (!this._skipViewportUpdates) + if (!this._skipViewportUpdates) { this._startViewportBoundsString = this._viewportBounds.toString(); + this._forceViewportUpdate = false; + } this._skipViewportUpdates++; }, - endUpdateBatch: function endUpdate() { + endUpdateBatch: function endUpdate(aForceRedraw) { if (!this._skipViewportUpdates) throw new Error("Unbalanced call to endUpdateBatch"); + + this._forceViewportUpdate = this._forceViewportUpdate || aForceRedraw; + this._skipViewportUpdates--; if (this._skipViewportUpdates) return let boundsSizeChanged = this._startViewportBoundsString != this._viewportBounds.toString(); - this._callViewportUpdateHandler(boundsSizeChanged); + this._callViewportUpdateHandler(boundsSizeChanged || this._forceViewportUpdate); }, // diff --git a/mobile/chrome/content/browser.js b/mobile/chrome/content/browser.js index 2e1e5e70a10..70ccda81d3a 100644 --- a/mobile/chrome/content/browser.js +++ b/mobile/chrome/content/browser.js @@ -354,9 +354,6 @@ var Browser = { let firstTab = this._selectedTab == null; this._selectedTab = tab; - // reset the viewportBounds to ensure a redraw - this._currentViewportBounds = { width: 0, height: 0}; - ws.beginUpdateBatch(); this._canvasBrowser.setCurrentBrowser(this.selectedBrowser, firstTab); document.getElementById("tabs").selectedItem = tab.content; @@ -380,7 +377,7 @@ var Browser = { event.initEvent("TabSelect", true, false); tab.content.dispatchEvent(event); } - ws.endUpdateBatch(); + ws.endUpdateBatch(true); }, supportsCommand: function(cmd) {