Bug 1176019 - Clear cached layers on location change r?mconley
To avoid a flash of stale content in the event of a slow tab
switch, we need to make sure we remove a tab from the cache if
its location changes while it's in the background.
MozReview-Commit-ID: ElpoWhhjb0n
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -4668,16 +4668,24 @@ class TabProgressListener {
// Tabs in private windows aren't registered as "Open" so
// that they don't appear as switch-to-tab candidates.
if (!isBlankPageURL(aLocation.spec) &&
(!PrivateBrowsingUtils.isWindowPrivate(window) ||
PrivateBrowsingUtils.permanentPrivateBrowsing)) {
gBrowser._unifiedComplete.registerOpenPage(aLocation, userContextId);
this.mBrowser.registeredOpenURI = aLocation;
}
+
+ if (this.mTab != gBrowser.selectedTab) {
+ let tabCacheIndex = gBrowser._tabLayerCache.indexOf(this.mTab);
+ if (tabCacheIndex != -1) {
+ gBrowser._tabLayerCache.splice(tabCacheIndex, 1);
+ gBrowser._getSwitcher().cleanUpTabAfterEviction(this.mTab);
+ }
+ }
}
if (!this.mBlank) {
this._callProgressListeners("onLocationChange",
[aWebProgress, aRequest, aLocation, aFlags]);
}
if (topLevel) {