mirror of
https://github.com/servo/servo.git
synced 2025-07-13 02:13:40 +01:00
43 lines
1.6 KiB
HTML
43 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/feature-policy/experimental-features/resources/common.js"></script>
|
|
<title> 'layout-animations' Policy : violation reports from javascript
|
|
</title>
|
|
<body>
|
|
<script>
|
|
test(() => {
|
|
document.featurePolicy.allowedFeatures().forEach((enabled_feature) => {
|
|
assert_not_equals(enabled_feature, "layout-animations");
|
|
});
|
|
},
|
|
"Verify 'layout-animations' is not in document's feature list.");
|
|
|
|
promise_test(async () => {
|
|
let promise = wait_for_violation_in_file(
|
|
"layout-animations",
|
|
"animation-property-height.js");
|
|
let script = document.createElement("script");
|
|
script.src = "/feature-policy/experimental-features/resources/" +
|
|
"animation-property-height.js";
|
|
document.body.appendChild(script);
|
|
await promise;
|
|
},
|
|
"Verify that when 'layout-animations' is disabled, an 'element.animate' " +
|
|
"API including a keyframe that uses a blocked property generates violation " +
|
|
"report (linked scripts).");
|
|
|
|
promise_test(async () => {
|
|
let promise = wait_for_violation_in_file(
|
|
"layout-animations",
|
|
"layout-animations-disabled-violation-report-js-tentative.html");
|
|
let div = document.createElement("div");
|
|
document.body.appendChild(div);
|
|
div.animate([{width: "100px"}, {width: "200px"}]);
|
|
await promise;
|
|
},
|
|
"Verify that when 'layout-animations' is disabled, an 'element.animate' " +
|
|
"API including a keyframe that uses a blocked property generates violation " +
|
|
"report (inline scripts).");
|
|
</script>
|
|
</body>
|