import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -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>

View file

@ -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>