Backed out changeset 888dc371081a (bug 1347791)

This commit is contained in:
Carsten "Tomcat" Book 2017-05-17 08:11:05 +02:00
Родитель 0412b67dd7
Коммит c60f5362f4
5 изменённых файлов: 2 добавлений и 17 удалений

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

@ -2069,7 +2069,7 @@
"audioPlaybackStopped", "pauseMedia", "stopMedia",
"blockMedia", "resumeMedia", "mute", "unmute", "blockedPopups", "lastURI",
"purgeSessionHistory", "stopScroll", "startScroll",
"userTypedValue", "userTypedClear", "mediaBlocked"
"userTypedValue", "userTypedClear"
]</field>
<method name="_createLazyBrowser">
@ -2122,8 +2122,6 @@
break;
case "reload":
case "reloadWithFlags":
case "blockMedia":
case "resumeMedia":
getter = () => {
return (params) => {
// Wait for load handler to be instantiated before
@ -2137,7 +2135,6 @@
break;
case "userTypedValue":
case "userTypedClear":
case "mediaBlocked":
getter = () => {
return SessionStore.getLazyTabValue(aTab, name);
};

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

@ -3588,8 +3588,6 @@ var SessionStoreInternal = {
tab.toggleMuteAudio(tabData.muteReason);
}
tab.setMediaBlock(!!tabData.mediaBlocked);
if (tabData.lastAccessed) {
tab.updateLastAccessed(tabData.lastAccessed);
}

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

@ -14,10 +14,8 @@ this.EXPORTED_SYMBOLS = ["TabAttributes"];
// 'pending' is used internal by sessionstore and managed accordingly.
// 'iconLoadingPrincipal' is same as 'image' that it should be handled by
// using the gBrowser.getIcon()/setIcon() methods.
// 'mediaBlocked' should not be accessed directly but handled by using the
// tab.linkedBrowser.mediaBlocked, setMediaBlock methods.
const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", "iconLoadingPrincipal",
"skipbackgroundnotify", "mediaBlocked"]);
"skipbackgroundnotify"]);
// A set of tab attributes to persist. We will read a given list of tab
// attributes when collecting tab data and will re-set those attributes when

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

@ -102,8 +102,6 @@ var TabStateInternal = {
tabData.muteReason = tab.muteReason;
}
tabData.mediaBlocked = browser.mediaBlocked;
// Save tab attributes.
tabData.attributes = TabAttributes.get(tab);

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

@ -25,21 +25,15 @@ add_task(async function test() {
// Check that the tab has a 'muted' attribute.
ok(tab.hasAttribute("muted"), "tab.muted exists");
tab.setMediaBlock(true /* block */);
// Check that the tab has a 'media-blocked' attribute.
ok(tab.hasAttribute("media-blocked"), "tab.media-blocked exists");
// Make sure we do not persist 'image' or 'muted' attributes.
ss.persistTabAttribute("image");
ss.persistTabAttribute("muted");
ss.persistTabAttribute("iconLoadingPrincipal");
ss.persistTabAttribute("mediaBlocked");
let {attributes} = JSON.parse(ss.getTabState(tab));
ok(!("image" in attributes), "'image' attribute not saved");
ok(!("iconLoadingPrincipal" in attributes), "'iconLoadingPrincipal' attribute not saved");
ok(!("muted" in attributes), "'muted' attribute not saved");
ok(!("custom" in attributes), "'custom' attribute not saved");
ok(!("mediaBlocked" in attributes), "'mediaBlocked' attribute not saved");
// Test persisting a custom attribute.
tab.setAttribute("custom", "foobar");