diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-transitions/transition-001.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-transitions/transition-001.html')
-rw-r--r-- | testing/web-platform/tests/css/css-transitions/transition-001.html | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-transitions/transition-001.html b/testing/web-platform/tests/css/css-transitions/transition-001.html new file mode 100644 index 0000000000..492b443747 --- /dev/null +++ b/testing/web-platform/tests/css/css-transitions/transition-001.html @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>CSS Transitions Test: Parsing transition shorthand</title> + <meta name="assert" content="Test checks that transition shorthand values are parsed properly"> + <link rel="help" title="2.5. The 'transition' Shorthand Property" href="http://www.w3.org/TR/css3-transitions/#transition-shorthand-property"> + <link rel="author" title="Rodney Rehm" href="http://rodneyrehm.de/en/"> + <meta name="flags" content="dom"> + + <script src="/resources/testharness.js" type="text/javascript"></script> + <script src="/resources/testharnessreport.js" type="text/javascript"></script> + + <script src="./support/vendorPrefix.js" type="text/javascript"></script> + <script src="./support/helper.js" type="text/javascript"></script> + </head> + <body> + <!-- required by testharnessreport.js --> + <div id="log"></div> + <!-- elements used for testing --> + <div id="container"> + <div id="transition"></div> + </div> + + <script> + var transition = document.getElementById('transition'); + // Note that order is important in this property. The first value that can be parsed as a time is assigned to + // the transition-duration. The second value that can be parsed as a time is assigned to transition-delay. + // [<‘transition-property’> || <‘transition-duration’> || <‘transition-timing-function’> || <‘transition-delay’> [, [<‘transition-property’> || <‘transition-duration’> || <‘transition-timing-function’> || <‘transition-delay’>]]* + var values = { + // [property, duration, timing, delay] + // random order + '1s' : ["all", "1s", "ease", "0s"], + '1s 2s' : ["all", "1s", "ease", "2s"], + '1s 2s ease-in' : ["all", "1s", "ease-in", "2s"], + '1s ease-in 2s' : ["all", "1s", "ease-in", "2s"], + 'ease-in 1s 2s' : ["all", "1s", "ease-in", "2s"], + '1s width' : ["width", "1s", "ease", "0s"], + 'width 1s' : ["width", "1s", "ease", "0s"], + '1s width 2s' : ["width", "1s", "ease", "2s"], + '1s 2s width ease-in' : ["width", "1s", "ease-in", "2s"], + '1s ease-in 2s width' : ["width", "1s", "ease-in", "2s"], + 'width ease-in 1s 2s' : ["width", "1s", "ease-in", "2s"], + 'width .1s ease-in .2s' : ["width", "0.1s", "ease-in", "0.2s"], + '1s width linear(0, .5 10% 20%, 1, .5 50%, 1) 2s' : ["width", "1s", "linear(0 0%, 0.5 10%, 0.5 20%, 1 35%, 0.5 50%, 1 100%)", "2s"]}; + + for (var key in values) { + if (Object.prototype.hasOwnProperty.call(values, key)) { + test(function() { + setStyle('#transition', { + 'transition': key + }); + // WET much? + assert_equals(computedStyle(transition, 'transition-property'), values[key][0], "transition-property"); + assert_equals(computedStyle(transition, 'transition-duration'), values[key][1], "transition-duration"); + assert_equals(computedStyle(transition, 'transition-timing-function'), values[key][2], "transition-timing-function"); + assert_equals(computedStyle(transition, 'transition-delay'), values[key][3], "transition-delay"); + }, "parse '" + key + "'"); + } + } + </script> + </body> +</html> |