gecko-dev/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/composite.html
Brian Birtles 29e984d336 Bug 1483404 - Use "auto" values for unspecified keyframe-specific composite operations; r=smaug
Summary:
This brings our implementation into line with the following spec change:

  ced6b5aac0

See https://github.com/w3c/csswg-drafts/issues/3000

Reviewers: smaug

Tags: #secure-revision

Bug #: 1483404

Differential Revision: https://phabricator.services.mozilla.com/D3384

--HG--
extra : rebase_source : 097d8307cea82b5d1ea0345414153965067b2b5b
extra : amend_source : fe1f4aeef842961600fe3dba760a573ed2fc84df
2018-08-15 09:51:28 +09:00

47 lines
1.6 KiB
HTML

<!doctype html>
<meta charset=utf-8>
<title>KeyframeEffect.composite</title>
<link rel="help"
href="https://drafts.csswg.org/web-animations/#dom-keyframeeffect-composite">
<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(t => {
const anim = createDiv(t).animate(null);
assert_equals(anim.effect.composite, 'replace',
'The default value should be replace');
}, 'Default value');
test(t => {
const anim = createDiv(t).animate(null);
anim.effect.composite = 'add';
assert_equals(anim.effect.composite, 'add',
'The effect composite value should be replaced');
}, 'Change composite value');
test(t => {
const anim = createDiv(t).animate({ left: '10px' });
anim.effect.composite = 'add';
const keyframes = anim.effect.getKeyframes();
assert_equals(keyframes[0].composite, 'auto',
'unspecified keyframe composite value should be auto even ' +
'if effect composite is set');
}, 'Unspecified keyframe composite value when setting effect composite');
test(t => {
const anim = createDiv(t).animate({ left: '10px', composite: 'replace' });
anim.effect.composite = 'add';
const keyframes = anim.effect.getKeyframes();
assert_equals(keyframes[0].composite, 'replace',
'specified keyframe composite value should not be overridden ' +
'by setting effect composite');
}, 'Specified keyframe composite value when setting effect composite');
</script>