Bug 1507230 - dom.security.featurePolicy.webidl.enabled pref controls the exposing of document.policy and HTMLIFrameElement.policy attributes, r=ckerschb

This commit is contained in:
Andrea Marchesini 2018-11-14 23:58:52 +01:00
parent 3c9a4a719c
commit 5e3dc65e1b
13 changed files with 20 additions and 10 deletions

View File

@ -50,7 +50,8 @@ var gTestWindows = [
{ test: "file_fullscreen-event-order.html" },
{ test: "file_fullscreen-featurePolicy.html",
prefs: [["dom.security.featurePolicy.enabled", true],
["dom.security.featurePolicy.header.enabled", true]] },
["dom.security.featurePolicy.header.enabled", true],
["dom.security.featurePolicy.webidl.enabled", true]] },
];
var testWindow = null;

View File

@ -2,6 +2,7 @@
prefs =
dom.security.featurePolicy.enabled=true
dom.security.featurePolicy.header.enabled=true
dom.security.featurePolicy.webidl.enabled=true
support-files =
empty.html
test_parser.html^headers^

View File

@ -48,6 +48,7 @@ function nextTest() {
SpecialPowers.pushPrefEnv({"set": [
["dom.security.featurePolicy.enabled", true],
["dom.security.featurePolicy.header.enabled", true],
["dom.security.featurePolicy.webidl.enabled", true],
]}).then(nextTest);
</script>
</body>

View File

@ -550,6 +550,6 @@ Document implements DocumentOrShadowRoot;
// https://wicg.github.io/feature-policy/#policy
partial interface Document {
[SameObject, Pref="dom.security.featurePolicy.enabled"]
[SameObject, Pref="dom.security.featurePolicy.webidl.enabled"]
readonly attribute Policy policy;
};

View File

@ -72,7 +72,7 @@ HTMLIFrameElement implements BrowserElement;
// https://wicg.github.io/feature-policy/#policy
partial interface HTMLIFrameElement {
[SameObject, Pref="dom.security.featurePolicy.enabled"]
[SameObject, Pref="dom.security.featurePolicy.webidl.enabled"]
readonly attribute Policy policy;
[CEReactions, SetterThrows, Pure, Pref="dom.security.featurePolicy.enabled"]

View File

@ -1799,6 +1799,13 @@ VARCACHE_PREF(
dom_security_featurePolicy_header_enabled,
bool, PREF_VALUE
)
// Expose the 'policy' attribute in document and HTMLIFrameElement
VARCACHE_PREF(
"dom.security.featurePolicy.webidl.enabled",
dom_security_featurePolicy_webidl_enabled,
bool, PREF_VALUE
)
#undef PREF_VALUE
//---------------------------------------------------------------------------

View File

@ -1,2 +1,2 @@
prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true]
prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true]
lsan-allowed: [Alloc, MakeUnique, Malloc, NewPage, Realloc, mozilla::EMEDecryptor::EMEDecryptor, mozilla::SchedulerGroup::CreateEventTargetFor, CreateCDMProxy, mozilla::dom::MediaKeys::CreateCDMProxy, mozilla::dom::nsIContentChild::GetConstructedEventTarget]

View File

@ -1,2 +1,2 @@
prefs: [dom.security.featurePolicy.enabled:true, dom.payments.request.enabled:true, dom.reporting.enabled:true, dom.reporting.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.webmidi.enabled:true, dom.vr.enabled:true]
prefs: [dom.security.featurePolicy.enabled:true, dom.payments.request.enabled:true, dom.reporting.enabled:true, dom.reporting.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true, dom.webmidi.enabled:true, dom.vr.enabled:true]
lsan-allowed: []

View File

@ -1,2 +1,2 @@
prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true]
prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true]
lsan-allowed: []

View File

@ -1,2 +1,2 @@
prefs: [media.navigator.permission.disabled:true, media.navigator.streams.fake:true, dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true]
prefs: [media.navigator.permission.disabled:true, media.navigator.streams.fake:true, dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true]
lsan-allowed: [Alloc, NewEmptyScopeData, XPCWrappedNative::GetNewOrUsed, js_new, mozilla::BasePrincipal::CreateCodebasePrincipal, mozilla::dom::ChromeUtils::GenerateQI, nsStringBuffer::Alloc]

View File

@ -1 +1 @@
prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true]
prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true]

View File

@ -1 +1 @@
prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true]
prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true]

View File

@ -1 +1 @@
prefs: [dom.vr.enabled:true,dom.security.featurePolicy.enabled:true,dom.security.featurePolicy.header.enabled:true]
prefs: [dom.vr.enabled:true,dom.security.featurePolicy.enabled:true,dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true]