Bug 1495358 - FeaturePolicy: vr, r=kip

This commit is contained in:
Andrea Marchesini 2018-10-03 12:39:44 +02:00
Родитель f3b4178593
Коммит 9c943359e1
7 изменённых файлов: 8 добавлений и 27 удалений

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

@ -1274,11 +1274,17 @@ Navigator::RequestGamepadServiceTest()
already_AddRefed<Promise>
Navigator::GetVRDisplays(ErrorResult& aRv)
{
if (!mWindow || !mWindow->GetDocShell()) {
if (!mWindow || !mWindow->GetDocShell() || !mWindow->GetExtantDoc()) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
if (!FeaturePolicyUtils::IsFeatureAllowed(mWindow->GetExtantDoc(),
NS_LITERAL_STRING("vr"))) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}
nsGlobalWindowInner* win = nsGlobalWindowInner::Cast(mWindow);
win->NotifyVREventListenerAdded();

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

@ -40,7 +40,6 @@ static FeatureMap sSupportedFeatures[] = {
{ "payment", FeatureMap::eSelf },
// TODO: not supported yet!!!
{ "speaker", FeatureMap::eSelf },
// TODO: not supported yet!!!
{ "vr", FeatureMap::eSelf },
};

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

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

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

@ -1,10 +0,0 @@
[webvr-disabled-by-feature-policy.https.sub.html]
[Feature-Policy header vr "none" disallows the top-level document.]
expected: FAIL
[Feature-Policy header vr "none" disallows same-origin iframes.]
expected: FAIL
[Feature-Policy header vr "none" disallows cross-origin iframes.]
expected: FAIL

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

@ -1,7 +0,0 @@
[webvr-enabled-by-feature-policy-attribute-redirect-on-load.https.sub.html]
[Feature-Policy allow="vr" attribute allows same-origin relocation]
expected: FAIL
[Feature-Policy allow="vr" attribute disallows cross-origin relocation]
expected: FAIL

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

@ -1,7 +1,4 @@
[webvr-enabled-by-feature-policy-attribute.https.sub.html]
[Feature-Policy allow="vr" attribute allows same-origin iframe]
expected: FAIL
[Feature-Policy allow="vr" attribute allows cross-origin iframe]
expected: FAIL

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

@ -1,4 +0,0 @@
[webvr-enabled-on-self-origin-by-feature-policy.https.sub.html]
[Feature-Policy header vr "self" disallows cross-origin iframes.]
expected: FAIL