summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly')
-rw-r--r--testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly/copy-contructor.html94
-rw-r--r--testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly/spacing.html237
2 files changed, 331 insertions, 0 deletions
diff --git a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly/copy-contructor.html b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly/copy-contructor.html
new file mode 100644
index 000000000..287ffe114
--- /dev/null
+++ b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly/copy-contructor.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>KeyframeEffectReadOnly copy constructor tests</title>
+<link rel="help"
+href="https://w3c.github.io/web-animations/#dom-keyframeeffectreadonly-keyframeeffectreadonly-source">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../testcommon.js"></script>
+<body>
+<div id="log"></div>
+<script>
+"use strict";
+
+test(function(t) {
+ var effect = new KeyframeEffectReadOnly(createDiv(t), null);
+ var copiedEffect = new KeyframeEffectReadOnly(effect);
+ assert_equals(copiedEffect.target, effect.target, 'same target');
+}, 'Test copied keyframeEffectReadOnly has the same target');
+
+test(function(t) {
+ var effect =
+ new KeyframeEffectReadOnly(null,
+ [ { marginLeft: '0px' },
+ { marginLeft: '-20px', easing: 'ease-in',
+ offset: 0.1 },
+ { marginLeft: '100px', easing: 'ease-out' },
+ { marginLeft: '50px' } ],
+ { spacing: 'paced(margin-left)' });
+
+ var copiedEffect = new KeyframeEffectReadOnly(effect);
+ var KeyframesA = effect.getKeyframes();
+ var KeyframesB = copiedEffect.getKeyframes();
+ assert_equals(KeyframesA.length, KeyframesB.length, 'same keyframes length');
+
+ for (var i = 0; i < KeyframesA.length; ++i) {
+ assert_equals(KeyframesA[i].offset, KeyframesB[i].offset,
+ 'Keyframe ' + i + ' has the same offset');
+ assert_equals(KeyframesA[i].computedOffset, KeyframesB[i].computedOffset,
+ 'keyframe ' + i + ' has the same computedOffset');
+ assert_equals(KeyframesA[i].easing, KeyframesB[i].easing,
+ 'keyframe ' + i + ' has the same easing');
+ assert_equals(KeyframesA[i].composite, KeyframesB[i].composite,
+ 'keyframe ' + i + ' has the same composite');
+
+ assert_true(!!KeyframesA[i].marginLeft,
+ 'original keyframe ' + i + ' has the valid property value');
+ assert_true(!!KeyframesB[i].marginLeft,
+ 'new keyframe ' + i + ' has the valid property value');
+ assert_equals(KeyframesA[i].marginLeft, KeyframesB[i].marginLeft,
+ 'keyframe ' + i + ' has the same property value pair');
+ }
+}, 'Test copied keyframeEffectReadOnly has the same keyframes');
+
+test(function(t) {
+ var effect = new KeyframeEffectReadOnly(null, null,
+ { spacing: 'paced(margin-left)',
+ iterationComposite: 'accumulate' });
+
+ var copiedEffect = new KeyframeEffectReadOnly(effect);
+ assert_equals(copiedEffect.spacing, effect.spacing, 'same spacing');
+ assert_equals(copiedEffect.iterationComposite, effect.iterationComposite,
+ 'same iterationCompositeOperation');
+ assert_equals(copiedEffect.composite, effect.composite,
+ 'same compositeOperation');
+}, 'Test copied keyframeEffectReadOnly has the same keyframeEffectOptions');
+
+test(function(t) {
+ var effect = new KeyframeEffectReadOnly(null, null,
+ { duration: 100 * MS_PER_SEC,
+ delay: -1 * MS_PER_SEC,
+ endDelay: 2 * MS_PER_SEC,
+ fill: 'forwards',
+ iterationStart: 2,
+ iterations: 20,
+ easing: 'ease-out',
+ direction: 'alternate' } );
+
+ var copiedEffect = new KeyframeEffectReadOnly(effect);
+ var timingA = effect.timing;
+ var timingB = copiedEffect.timing;
+ assert_not_equals(timingA, timingB, 'different timing objects');
+ assert_equals(timingA.delay, timingB.delay, 'same delay');
+ assert_equals(timingA.endDelay, timingB.endDelay, 'same endDelay');
+ assert_equals(timingA.fill, timingB.fill, 'same fill');
+ assert_equals(timingA.iterationStart, timingB.iterationStart,
+ 'same iterationStart');
+ assert_equals(timingA.iterations, timingB.iterations, 'same iterations');
+ assert_equals(timingA.duration, timingB.duration, 'same duration');
+ assert_equals(timingA.direction, timingB.direction, 'same direction');
+ assert_equals(timingA.easing, timingB.easing, 'same easing');
+}, 'Test copied keyframeEffectReadOnly has the same timing content');
+
+</script>
+</body>
diff --git a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly/spacing.html b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly/spacing.html
new file mode 100644
index 000000000..c83d1ebcb
--- /dev/null
+++ b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffectReadOnly/spacing.html
@@ -0,0 +1,237 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>KeyframeEffectReadOnly spacing attribute tests</title>
+<link rel="help"
+href="https://w3c.github.io/web-animations/#dom-keyframeeffectreadonly-spacing">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../testcommon.js"></script>
+<body>
+<div id="log"></div>
+<script>
+"use strict";
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: '' });
+ });
+}, 'Test throwing TypeError if using empty string');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'dist' });
+ });
+}, 'Test throwing TypeError if not using the correct keyword');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: ' paced(margin-left)' });
+ });
+}, 'Test throwing TypeError if adding leading spaces');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(margin-left) ' });
+ });
+}, 'Test throwing TypeError if adding trailing spaces');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced( margin-left)' });
+ });
+}, 'Test throwing TypeError if adding leading spaces before the ' +
+ 'paced property');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(margin-left )' });
+ });
+}, 'Test throwing TypeError if adding trailing spaces after the ' +
+ 'paced property');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced()' });
+ });
+}, 'Test throwing TypeError if these is no paced property');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(.margin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(1margin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(\\)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string with ' +
+ 'an invalid escape');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(\\\fmargin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string with ' +
+ 'an invalid escape (FF)');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(\\\rmargin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string with ' +
+ 'an invalid escape (CR)');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(\\\nmargin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string with ' +
+ 'an invalid escape (LF)');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(- )' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string with ' +
+ 'a leading minus and an invalid name-start code point');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(-\\)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string with ' +
+ 'a leading minus and an invalid escape');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(-\\\fmargin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string with ' +
+ 'a leading minus and an invalid escape (FF)');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(-\\\rmargin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string with ' +
+ 'a leading minus and an invalid escape (CR)');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(-\\\nmargin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident started string with ' +
+ 'a leading minus and an invalid escape (LF)');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(--\\)' });
+ });
+}, 'Test throwing TypeError if using a non-ident string with an invalid ' +
+ 'escape');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(--\\\fmargin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident string with an invalid ' +
+ 'escape (FF)');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(--\\\rmargin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident string with an invalid ' +
+ 'escape (CR)');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(--\\\nmargin)' });
+ });
+}, 'Test throwing TypeError if using a non-ident string with an invalid ' +
+ 'escape (LF)');
+
+test(function(t) {
+ assert_throws(new TypeError, function() {
+ createDiv(t).animate(null, { spacing: 'paced(margin.left)' });
+ });
+}, 'Test throwing TypeError if using a non-ident string with an invalid name ' +
+ 'code point');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'paced(A)' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test falling back to distribute spacing if using a unrecognized property');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'paced(\\.margin)' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test falling back to distribute spacing if using a unrecognized property ' +
+ 'which starts with a valid escape (Full stop)');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'paced(\\ margin)' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test falling back to distribute spacing if using a unrecognized property ' +
+ 'which starts with a valid escape (white space)');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'paced(_margin)' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test falling back to distribute spacing if using a unrecognized property ' +
+ 'which starts with a valid escape (low line)');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'paced(-_margin)' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test falling back to distribute spacing if using a unrecognized property ' +
+ 'which starts with a minus and a low line');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'paced(-\\.margin)' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test falling back to distribute spacing if using a unrecognized property ' +
+ 'which starts with a minus and a valid escape');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'paced(--bg-color)' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test falling back to distribute spacing if using CSS variables');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'paced(animation)' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test falling back to distribute spacing if using a non-animatable ' +
+ 'shorthand property');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null,
+ { spacing: 'paced(animation-duration)' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test falling back to distribute spacing if using a non-animatable ' +
+ 'property');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null);
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test default value of spacing');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'distribute' });
+ assert_equals(anim.effect.spacing, 'distribute', 'spacing mode');
+}, 'Test spacing value if setting distribute');
+
+test(function(t) {
+ var anim = createDiv(t).animate(null, { spacing: 'paced(margin-left)' });
+ assert_equals(anim.effect.spacing, 'paced(margin-left)', 'spacing mode');
+}, 'Test spacing value if setting paced');
+
+</script>
+</body>