| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <title>Web Animations API: Keyframe Property tests</title> | 2 <title>Web Animations API: Keyframe Property tests</title> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <div id="log"></div> | 5 <div id="log"></div> |
| 6 <div id="div"></div> | 6 <div id="div"></div> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 test(function() { | 9 test(function() { |
| 10 var keyframe = {}; | 10 var keyframe = {}; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 test(function() { | 30 test(function() { |
| 31 var KeyframeParent = function() { this.width = "100px"; }; | 31 var KeyframeParent = function() { this.width = "100px"; }; |
| 32 KeyframeParent.prototype = { height: "100px" }; | 32 KeyframeParent.prototype = { height: "100px" }; |
| 33 var Keyframe = function() { this.top = "100px"; }; | 33 var Keyframe = function() { this.top = "100px"; }; |
| 34 Keyframe.prototype = Object.create(KeyframeParent.prototype); | 34 Keyframe.prototype = Object.create(KeyframeParent.prototype); |
| 35 Object.defineProperty(Keyframe.prototype, "left", { | 35 Object.defineProperty(Keyframe.prototype, "left", { |
| 36 value: '100px', | 36 value: '100px', |
| 37 enumerable: 'true'}); | 37 enumerable: 'true'}); |
| 38 var keyframe = new Keyframe(); | 38 var keyframe = new Keyframe(); |
| 39 assert_array_equals(Object.keys(keyframe), ["top"]); | |
| 40 try { | 39 try { |
| 41 div.animate([keyframe, {top: '200px'}], 1); | 40 div.animate([keyframe, {top: '200px', left: '200px', height: '200px'}], 1); |
| 42 } catch (e) { | 41 } catch (e) { |
| 43 assert_unreached("Mismatched properties - left, width or height considered o
n keyframe."); | 42 assert_unreached("Mismatched properties - left, width or height not consider
ed on keyframe."); |
| 44 } | 43 } |
| 45 }, | 44 }, |
| 46 'inherited keyframe properties tests', | 45 'inherited keyframe properties tests', |
| 47 { | 46 { |
| 48 help: 'http://dev.w3.org/fxtf/web-animations/#dfn-procedure-for-converting-a
n-ecmascript-value-to-an-idl-keyframe-object', | 47 help: 'http://dev.w3.org/fxtf/web-animations/#dfn-procedure-for-converting-a
n-ecmascript-value-to-an-idl-keyframe-object', |
| 49 assert: 'Only properties in Object.keys on keyframes are considered', | 48 assert: 'Only properties in Object.keys on keyframes are considered', |
| 50 author: 'Shane Stephens' | 49 author: 'Shane Stephens' |
| 51 }); | 50 }); |
| 52 | 51 |
| 53 | 52 |
| 54 </script> | 53 </script> |
| OLD | NEW |