Bug 470441: Can't switch tabs between website and about:config, r=mfinkle

This commit is contained in:
Vivien Nicolas 2009-05-28 11:52:26 -04:00
parent 33e8511b30
commit 5f1bda47c8
2 changed files with 10 additions and 7 deletions

View File

@ -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);
},
//

View File

@ -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) {