зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 888dc371081a (bug 1347791)
This commit is contained in:
Родитель
0412b67dd7
Коммит
c60f5362f4
|
@ -2069,7 +2069,7 @@
|
||||||
"audioPlaybackStopped", "pauseMedia", "stopMedia",
|
"audioPlaybackStopped", "pauseMedia", "stopMedia",
|
||||||
"blockMedia", "resumeMedia", "mute", "unmute", "blockedPopups", "lastURI",
|
"blockMedia", "resumeMedia", "mute", "unmute", "blockedPopups", "lastURI",
|
||||||
"purgeSessionHistory", "stopScroll", "startScroll",
|
"purgeSessionHistory", "stopScroll", "startScroll",
|
||||||
"userTypedValue", "userTypedClear", "mediaBlocked"
|
"userTypedValue", "userTypedClear"
|
||||||
]</field>
|
]</field>
|
||||||
|
|
||||||
<method name="_createLazyBrowser">
|
<method name="_createLazyBrowser">
|
||||||
|
@ -2122,8 +2122,6 @@
|
||||||
break;
|
break;
|
||||||
case "reload":
|
case "reload":
|
||||||
case "reloadWithFlags":
|
case "reloadWithFlags":
|
||||||
case "blockMedia":
|
|
||||||
case "resumeMedia":
|
|
||||||
getter = () => {
|
getter = () => {
|
||||||
return (params) => {
|
return (params) => {
|
||||||
// Wait for load handler to be instantiated before
|
// Wait for load handler to be instantiated before
|
||||||
|
@ -2137,7 +2135,6 @@
|
||||||
break;
|
break;
|
||||||
case "userTypedValue":
|
case "userTypedValue":
|
||||||
case "userTypedClear":
|
case "userTypedClear":
|
||||||
case "mediaBlocked":
|
|
||||||
getter = () => {
|
getter = () => {
|
||||||
return SessionStore.getLazyTabValue(aTab, name);
|
return SessionStore.getLazyTabValue(aTab, name);
|
||||||
};
|
};
|
||||||
|
|
|
@ -3588,8 +3588,6 @@ var SessionStoreInternal = {
|
||||||
tab.toggleMuteAudio(tabData.muteReason);
|
tab.toggleMuteAudio(tabData.muteReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
tab.setMediaBlock(!!tabData.mediaBlocked);
|
|
||||||
|
|
||||||
if (tabData.lastAccessed) {
|
if (tabData.lastAccessed) {
|
||||||
tab.updateLastAccessed(tabData.lastAccessed);
|
tab.updateLastAccessed(tabData.lastAccessed);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,8 @@ this.EXPORTED_SYMBOLS = ["TabAttributes"];
|
||||||
// 'pending' is used internal by sessionstore and managed accordingly.
|
// 'pending' is used internal by sessionstore and managed accordingly.
|
||||||
// 'iconLoadingPrincipal' is same as 'image' that it should be handled by
|
// 'iconLoadingPrincipal' is same as 'image' that it should be handled by
|
||||||
// using the gBrowser.getIcon()/setIcon() methods.
|
// 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",
|
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
|
// 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
|
// attributes when collecting tab data and will re-set those attributes when
|
||||||
|
|
|
@ -102,8 +102,6 @@ var TabStateInternal = {
|
||||||
tabData.muteReason = tab.muteReason;
|
tabData.muteReason = tab.muteReason;
|
||||||
}
|
}
|
||||||
|
|
||||||
tabData.mediaBlocked = browser.mediaBlocked;
|
|
||||||
|
|
||||||
// Save tab attributes.
|
// Save tab attributes.
|
||||||
tabData.attributes = TabAttributes.get(tab);
|
tabData.attributes = TabAttributes.get(tab);
|
||||||
|
|
||||||
|
|
|
@ -25,21 +25,15 @@ add_task(async function test() {
|
||||||
// Check that the tab has a 'muted' attribute.
|
// Check that the tab has a 'muted' attribute.
|
||||||
ok(tab.hasAttribute("muted"), "tab.muted exists");
|
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.
|
// Make sure we do not persist 'image' or 'muted' attributes.
|
||||||
ss.persistTabAttribute("image");
|
ss.persistTabAttribute("image");
|
||||||
ss.persistTabAttribute("muted");
|
ss.persistTabAttribute("muted");
|
||||||
ss.persistTabAttribute("iconLoadingPrincipal");
|
ss.persistTabAttribute("iconLoadingPrincipal");
|
||||||
ss.persistTabAttribute("mediaBlocked");
|
|
||||||
let {attributes} = JSON.parse(ss.getTabState(tab));
|
let {attributes} = JSON.parse(ss.getTabState(tab));
|
||||||
ok(!("image" in attributes), "'image' attribute not saved");
|
ok(!("image" in attributes), "'image' attribute not saved");
|
||||||
ok(!("iconLoadingPrincipal" in attributes), "'iconLoadingPrincipal' attribute not saved");
|
ok(!("iconLoadingPrincipal" in attributes), "'iconLoadingPrincipal' attribute not saved");
|
||||||
ok(!("muted" in attributes), "'muted' attribute not saved");
|
ok(!("muted" in attributes), "'muted' attribute not saved");
|
||||||
ok(!("custom" in attributes), "'custom' attribute not saved");
|
ok(!("custom" in attributes), "'custom' attribute not saved");
|
||||||
ok(!("mediaBlocked" in attributes), "'mediaBlocked' attribute not saved");
|
|
||||||
|
|
||||||
// Test persisting a custom attribute.
|
// Test persisting a custom attribute.
|
||||||
tab.setAttribute("custom", "foobar");
|
tab.setAttribute("custom", "foobar");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче