2 <title>Web Animations API: Keyframe Property tests
</title>
3 <script src=
"../../resources/testharness.js"></script>
4 <script src=
"../../resources/testharnessreport.js"></script>
11 Object
.defineProperty(keyframe
, 'width', {value
: '200px'});
12 Object
.defineProperty(keyframe
, 'height', {
15 assert_equals(keyframe
.width
, '200px', 'width of keyframe is readable');
16 assert_equals(keyframe
.height
, '100px', 'height of keyframe is readable');
18 div
.animate([keyframe
, {height
: '200px'}], 1);
20 assert_unreached("Mismatched properties - both or neither properties on keyframe were considered.");
23 'enumerable keyframe properties tests',
25 help
: 'http://dev.w3.org/fxtf/web-animations/#dfn-procedure-for-converting-an-ecmascript-value-to-an-idl-keyframe-object',
26 assert
: 'Only enumerable properties on keyframes are considered',
27 author
: 'Shane Stephens'
31 var KeyframeParent = function() { this.width
= "100px"; };
32 KeyframeParent
.prototype = { height
: "100px" };
33 var Keyframe = function() { this.top
= "100px"; };
34 Keyframe
.prototype = Object
.create(KeyframeParent
.prototype);
35 Object
.defineProperty(Keyframe
.prototype, "left", {
38 var keyframe
= new Keyframe();
40 div
.animate([keyframe
, {top
: '200px', left
: '200px', height
: '200px'}], 1);
42 assert_unreached("Mismatched properties - left, width or height not considered on keyframe.");
45 'inherited keyframe properties tests',
47 help
: 'http://dev.w3.org/fxtf/web-animations/#dfn-procedure-for-converting-an-ecmascript-value-to-an-idl-keyframe-object',
48 assert
: 'Only properties in Object.keys on keyframes are considered',
49 author
: 'Shane Stephens'