Bug 1495303 - FeaturePolicy: payment, r=marcosc

This commit is contained in:
Andrea Marchesini
2018-10-01 11:59:57 +02:00
parent e3663d410d
commit 2499ed36e4
13 changed files with 38 additions and 54 deletions

View File

@@ -174,7 +174,8 @@ HTMLIFrameElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
}
if ((aName == nsGkAtoms::allow ||
aName == nsGkAtoms::src ||
aName == nsGkAtoms::sandbox) &&
aName == nsGkAtoms::sandbox ||
aName == nsGkAtoms::allowpaymentrequest) &&
StaticPrefs::dom_security_featurePolicy_enabled()) {
RefreshFeaturePolicy();
}
@@ -307,8 +308,12 @@ HTMLIFrameElement::RefreshFeaturePolicy()
mFeaturePolicy->InheritPolicy(OwnerDoc()->Policy());
if (AllowPaymentRequest()) {
mFeaturePolicy->MaybeSetAllowedPolicy(NS_LITERAL_STRING("payment"));
}
// TODO: https://wicg.github.io/feature-policy/#process-feature-policy-attributes
// requires to check allowfullscreen, allowpaymentrequest and allowusermediarequest
// requires to check allowfullscreen, and allowusermediarequest
}
} // namespace dom