Bug 609685 - "Having opened panorama once in a window affects all rendering in that window, even in tabs that are opened later" [f=ian r=ian a=blocking]

This commit is contained in:
Sean Dunn 2010-11-16 16:35:00 -06:00
Родитель 69869e5ba0
Коммит 35882f33b9
3 изменённых файлов: 51 добавлений и 12 удалений

Просмотреть файл

@ -1052,10 +1052,10 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
return: 'widthAndColumns', return: 'widthAndColumns',
count: count || this._children.length count: count || this._children.length
}; };
let {childWidth, columns} = Items.arrange(null, bb, options); let arrObj = Items.arrange(null, bb, options);
let shouldStack = childWidth < TabItems.minTabWidth * 1.35; let shouldStack = arrObj.childWidth < TabItems.minTabWidth * 1.35;
this._columns = shouldStack ? null : columns; this._columns = shouldStack ? null : arrObj.columns;
return shouldStack; return shouldStack;
}, },
@ -1646,6 +1646,7 @@ let GroupItems = {
_arrangePaused: false, _arrangePaused: false,
_arrangesPending: [], _arrangesPending: [],
_removingHiddenGroups: false, _removingHiddenGroups: false,
_delayedModUpdates: [],
minGroupHeight: 110, minGroupHeight: 110,
minGroupWidth: 125, minGroupWidth: 125,
@ -1659,9 +1660,18 @@ let GroupItems = {
self._handleAttrModified(xulTab); self._handleAttrModified(xulTab);
} }
// make sure any closed tabs are removed from the delay update list
function handleClose(xulTab) {
let idx = self._delayedModUpdates.indexOf(xulTab);
if (idx != -1)
self._delayedModUpdates.splice(idx, 1);
}
AllTabs.register("attrModified", handleAttrModified); AllTabs.register("attrModified", handleAttrModified);
AllTabs.register("close", handleClose);
this._cleanupFunctions.push(function() { this._cleanupFunctions.push(function() {
AllTabs.unregister("attrModified", handleAttrModified); AllTabs.unregister("attrModified", handleAttrModified);
AllTabs.unregister("close", handleClose);
}); });
}, },
@ -1728,6 +1738,30 @@ let GroupItems = {
// Function: _handleAttrModified // Function: _handleAttrModified
// watch for icon changes on app tabs // watch for icon changes on app tabs
_handleAttrModified: function GroupItems__handleAttrModified(xulTab) { _handleAttrModified: function GroupItems__handleAttrModified(xulTab) {
if (!UI.isTabViewVisible()) {
if (this._delayedModUpdates.indexOf(xulTab) == -1) {
this._delayedModUpdates.push(xulTab);
}
} else
this._updateAppTabIcons(xulTab);
},
// ----------
// Function: flushTabUpdates
// Update apptab icons based on xulTabs which have been updated
// while the TabView hasn't been visible
flushAppTabUpdates: function GroupItems_flushAppTabUpdates() {
let self = this;
this._delayedModUpdates.forEach(function(xulTab) {
self._updateAppTabIcons(xulTab);
});
this._delayedModUpdates = [];
},
// ----------
// Function: _updateAppTabIcons
// Update images of any apptab icons that point to passed in xultab
_updateAppTabIcons: function GroupItems__updateAppTabIcons(xulTab) {
if (xulTab.ownerDocument.defaultView != gWindow || !xulTab.pinned) if (xulTab.ownerDocument.defaultView != gWindow || !xulTab.pinned)
return; return;
@ -1742,7 +1776,7 @@ let GroupItems = {
$icon.attr("src", iconUrl); $icon.attr("src", iconUrl);
}); });
}); });
}, },
// ---------- // ----------
// Function: addAppTab // Function: addAppTab

Просмотреть файл

@ -900,12 +900,9 @@ let TabItems = {
Date.now() - this._lastUpdateTime < this._heartbeatTiming Date.now() - this._lastUpdateTime < this._heartbeatTiming
); );
let isCurrentTab = ( if (shouldDefer) {
!UI.isTabViewVisible() && if (!this.reconnectingPaused() && !tab._tabViewTabItem._reconnected)
tab == gBrowser.selectedTab this._reconnect(tab._tabViewTabItem);
);
if (shouldDefer && !isCurrentTab) {
if (this._tabsWaitingForUpdate.indexOf(tab) == -1) if (this._tabsWaitingForUpdate.indexOf(tab) == -1)
this._tabsWaitingForUpdate.push(tab); this._tabsWaitingForUpdate.push(tab);
this.startHeartbeat(); this.startHeartbeat();
@ -1297,7 +1294,9 @@ TabCanvas.prototype = {
ctx.save(); ctx.save();
ctx.scale(scaler, scaler); ctx.scale(scaler, scaler);
try{ try{
ctx.drawWindow(fromWin, fromWin.scrollX, fromWin.scrollY, w/scaler, h/scaler, "#fff"); ctx.drawWindow(fromWin, fromWin.scrollX, fromWin.scrollY,
w/scaler, h/scaler, "#fff",
Ci.nsIDOMCanvasRenderingContext2D.DRAWWINDOW_DO_NOT_FLUSH);
} catch(e) { } catch(e) {
Utils.error('paint', e); Utils.error('paint', e);
} }

Просмотреть файл

@ -500,6 +500,9 @@ let UI = {
self._resize(true); self._resize(true);
dispatchEvent(event); dispatchEvent(event);
// Flush pending updates
GroupItems.flushAppTabUpdates();
TabItems.resumePainting(); TabItems.resumePainting();
}); });
} else { } else {
@ -509,6 +512,9 @@ let UI = {
self.setActiveTab(null); self.setActiveTab(null);
dispatchEvent(event); dispatchEvent(event);
// Flush pending updates
GroupItems.flushAppTabUpdates();
TabItems.resumePainting(); TabItems.resumePainting();
} }
}, },