diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-transitions')
3 files changed, 78 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-transitions/crashtests/delete-image-set.html b/testing/web-platform/tests/css/css-transitions/crashtests/delete-image-set.html new file mode 100644 index 0000000000..b6ba763858 --- /dev/null +++ b/testing/web-platform/tests/css/css-transitions/crashtests/delete-image-set.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<link rel="help" href="https://crbug.com/363567"> +<link rel="help" href="https://issues.chromium.org/issues/40360947"> +<style> + div { background: url(#); } + div { background: -webkit-image-set(url(#) 1x); } + div { background: image-set(url(#) 1x); } +</style> +<body> + <div style="transition: 1s">This test passes if it does not crash.</div> +</body> +<script> +window.onload = () => { + document.styleSheets[0].deleteRule(2); + document.styleSheets[0].deleteRule(1); +}; +</script> diff --git a/testing/web-platform/tests/css/css-transitions/parsing/starting-style-parsing.html b/testing/web-platform/tests/css/css-transitions/parsing/starting-style-parsing.html new file mode 100644 index 0000000000..bd147a630a --- /dev/null +++ b/testing/web-platform/tests/css/css-transitions/parsing/starting-style-parsing.html @@ -0,0 +1,38 @@ +<!doctype html> +<title>@starting-style: parsing</title> +<link rel="help" href="https://drafts.csswg.org/css-transitions-2/#at-ruledef-starting-style"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<main id=main></main> +<script> + function test_valid(actual, expected) { + if (expected === undefined) + expected = actual; + test(t => { + t.add_cleanup(() => main.replaceChildren()); + let style = document.createElement('style'); + style.textContent = `${actual}{}`; + main.append(style); + assert_equals(style.sheet.rules.length, 1); + let rule = style.sheet.rules[0]; + assert_equals(rule.cssText, `${expected} {\n}`); + }, `${actual} is valid`); + } + + function test_invalid(actual) { + test(t => { + t.add_cleanup(() => main.replaceChildren()); + let style = document.createElement('style'); + style.textContent = `${actual}{}`; + main.append(style); + assert_equals(style.sheet.rules.length, 0); + }, `${actual} is not valid`); + } + + test_valid('@starting-style'); + + test_invalid('@starting-style div'); + test_invalid('@starting-style ()'); + test_invalid('@starting-style ( {}'); + test_invalid('@starting-style }'); +</script> diff --git a/testing/web-platform/tests/css/css-transitions/starting-style-adjustment.html b/testing/web-platform/tests/css/css-transitions/starting-style-adjustment.html new file mode 100644 index 0000000000..addc795e72 --- /dev/null +++ b/testing/web-platform/tests/css/css-transitions/starting-style-adjustment.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<title>CSS Transitions Test: Style adjustments for @starting-style</title> +<link rel="help" href="https://drafts.csswg.org/css-transitions-2/#defining-before-change-style-the-starting-style-rule"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/css-transitions/support/helper.js"></script> +<style> +legend { + transition: display 1s step-end allow-discrete; +} +@starting-style { + legend { display:inline; } +} +</style> +<body> +<legend></legend> +<script> +promise_test(async t => { + await waitForAnimationFrames(1); + assert_equals(document.getAnimations().length, 0, "No transitions"); +}, "The display property in <legend> @starting-style should be blockified so no transition should start"); +</script> +</body> |