mirror of
https://github.com/servo/servo.git
synced 2025-07-21 14:23:41 +01:00
47 lines
1.7 KiB
HTML
47 lines
1.7 KiB
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<title>Animation IDL</title>
|
|
<link rel="help" href="https://w3c.github.io/web-animations/#animation">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/resources/WebIDLParser.js"></script>
|
|
<script src="/resources/idlharness.js"></script>
|
|
<div id="log"></div>
|
|
<script type="text/plain" id="Animation-IDL">
|
|
enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" };
|
|
|
|
[Constructor (optional AnimationEffectReadOnly? effect = null,
|
|
optional AnimationTimeline? timeline)]
|
|
interface Animation : EventTarget {
|
|
attribute DOMString id;
|
|
attribute AnimationEffectReadOnly? effect;
|
|
attribute AnimationTimeline? timeline;
|
|
attribute double? startTime;
|
|
attribute double? currentTime;
|
|
attribute double playbackRate;
|
|
readonly attribute AnimationPlayState playState;
|
|
readonly attribute Promise<Animation> ready;
|
|
readonly attribute Promise<Animation> finished;
|
|
attribute EventHandler onfinish;
|
|
attribute EventHandler oncancel;
|
|
void cancel ();
|
|
void finish ();
|
|
void play ();
|
|
void pause ();
|
|
void reverse ();
|
|
};
|
|
</script>
|
|
<script>
|
|
'use strict';
|
|
|
|
const idlArray = new IdlArray();
|
|
|
|
idlArray.add_untested_idls('interface AnimationTimeline {};');
|
|
idlArray.add_untested_idls('interface EventHandler {};');
|
|
idlArray.add_untested_idls('interface EventTarget {};');
|
|
idlArray.add_idls(document.getElementById('Animation-IDL').textContent);
|
|
idlArray.add_objects( { Animation: ['new Animation()'] } );
|
|
|
|
idlArray.test();
|
|
|
|
</script>
|