Skip to content
This repository was archived by the owner on Apr 20, 2019. It is now read-only.

Commit 98f3282

Browse files
authored
Move to CSS (#103)
Fixes #99
1 parent e971a0f commit 98f3282

File tree

2 files changed

+35
-24
lines changed

2 files changed

+35
-24
lines changed

index.bs

+5-6
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,10 @@ animations. The worklet can be accessed via {{animationWorklet}} attribute.
169169

170170
The {{animationWorklet}}'s <a>worklet global scope type</a> is {{AnimationWorkletGlobalScope}}.
171171

172-
{{AnimationWorkletGlobalScope}} represents the global execution context of
173-
{{animationWorklet}}.
172+
{{AnimationWorkletGlobalScope}} represents the global execution context of {{animationWorklet}}.
174173

175174
<xmp class='idl'>
176-
partial interface Window {
175+
partial namespace CSS {
177176
[SameObject] readonly attribute Worklet animationWorklet;
178177
};
179178
</xmp>
@@ -743,7 +742,7 @@ animates fully to close or open position depending on its current position.
743742
</div>
744743

745744
<script>
746-
await animationWorklet.addModule('hidey-bar-animator.js');
745+
await CSS.animationWorklet.addModule('hidey-bar-animator.js');
747746
const scrollTimeline = new ScrollTimeline($scrollingContainer, {timeRange: 1000});
748747
const documentTimeline = document.timeline;
749748

@@ -817,7 +816,7 @@ sync with scroll offset.
817816
</div>
818817

819818
<script>
820-
await animationWorklet.addModule('twitter-header-animator.js');
819+
await CSS.animationWorklet.addModule('twitter-header-animator.js');
821820
const animation = new WorkletAnimation(
822821
'twitter-header',
823822
[new KeyFrameEffect($avatar, /* scales down as we scroll up */
@@ -876,7 +875,7 @@ A simple parallax background example.
876875
</div>
877876

878877
<script>
879-
await animationWorklet.addModule('parallax-animator.js');
878+
await CSS.animationWorklet.addModule('parallax-animator.js');
880879
const scrollTimeline = new ScrollTimeline($scrollingContainer, {timeRange: 1000});
881880
const scrollRange = $scrollingContainer.scrollHeight - $scrollingContainer.clientHeight;
882881

index.html

+30-18
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@
12141214
</style>
12151215
<meta content="Bikeshed version 0af8ece51a58310888d9da3e5b2ebda903d17c18" name="generator">
12161216
<link href="https://wicg.github.io/animation-worklet/" rel="canonical">
1217-
<meta content="911385d5839c26ce4524e0a88bf7e12069934a3d" name="document-revision">
1217+
<meta content="9a1a8fb2a8e328a5a39cc6b57b0482e2935ef846" name="document-revision">
12181218
<style>/* style-md-lists */
12191219

12201220
/* This is a weird hack for me not yet following the commonmark spec
@@ -1617,11 +1617,11 @@ <h2 class="heading settled" data-level="2" id="threading-model"><span class="sec
16171617
</figure>
16181618
<h2 class="heading settled" data-level="3" id="animation-worklet-desc"><span class="secno">3. </span><span class="content">Animation Worklet</span><a class="self-link" href="#animation-worklet-desc"></a></h2>
16191619
<dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="animation-worklet">Animation Worklet</dfn> is a <code class="idl"><a data-link-type="idl" href="https://drafts.css-houdini.org/worklets/#worklet" id="ref-for-worklet">Worklet</a></code> responsible for all classes related to custom
1620-
animations. The worklet can be accessed via <code class="idl"><a data-link-type="idl" href="#dom-window-animationworklet" id="ref-for-dom-window-animationworklet">animationWorklet</a></code> attribute.
1621-
<p>The <code class="idl"><a data-link-type="idl" href="#dom-window-animationworklet" id="ref-for-dom-window-animationworklet①">animationWorklet</a></code>'s <a data-link-type="dfn" href="https://drafts.css-houdini.org/worklets/#worklet-global-scope-type" id="ref-for-worklet-global-scope-type">worklet global scope type</a> is <code class="idl"><a data-link-type="idl" href="#animationworkletglobalscope" id="ref-for-animationworkletglobalscope">AnimationWorkletGlobalScope</a></code>.</p>
1622-
<p><code class="idl"><a data-link-type="idl" href="#animationworkletglobalscope" id="ref-for-animationworkletglobalscope①">AnimationWorkletGlobalScope</a></code> represents the global execution context of <code class="idl"><a data-link-type="idl" href="#dom-window-animationworklet" id="ref-for-dom-window-animationworklet②">animationWorklet</a></code>.</p>
1623-
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window"><c- g>Window</c-></a> {
1624-
[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.css-houdini.org/worklets/#worklet" id="ref-for-worklet①"><c- n>Worklet</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export data-readonly data-type="Worklet" id="dom-window-animationworklet"><code><c- g>animationWorklet</c-></code></dfn>;
1620+
animations. The worklet can be accessed via <code class="idl"><a data-link-type="idl" href="#dom-css-animationworklet" id="ref-for-dom-css-animationworklet">animationWorklet</a></code> attribute.
1621+
<p>The <code class="idl"><a data-link-type="idl" href="#dom-css-animationworklet" id="ref-for-dom-css-animationworklet①">animationWorklet</a></code>'s <a data-link-type="dfn" href="https://drafts.css-houdini.org/worklets/#worklet-global-scope-type" id="ref-for-worklet-global-scope-type">worklet global scope type</a> is <code class="idl"><a data-link-type="idl" href="#animationworkletglobalscope" id="ref-for-animationworkletglobalscope">AnimationWorkletGlobalScope</a></code>.</p>
1622+
<p><code class="idl"><a data-link-type="idl" href="#animationworkletglobalscope" id="ref-for-animationworkletglobalscope①">AnimationWorkletGlobalScope</a></code> represents the global execution context of <code class="idl"><a data-link-type="idl" href="#dom-css-animationworklet" id="ref-for-dom-css-animationworklet②">animationWorklet</a></code>.</p>
1623+
<pre class="idl highlight def"><c- b>partial</c-> <c- b>namespace</c-> <a class="idl-code" data-link-type="namespace" href="https://drafts.csswg.org/cssom-1/#namespacedef-css" id="ref-for-namespacedef-css"><c- g>CSS</c-></a> {
1624+
[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.css-houdini.org/worklets/#worklet" id="ref-for-worklet①"><c- n>Worklet</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CSS" data-dfn-type="attribute" data-export data-readonly data-type="Worklet" id="dom-css-animationworklet"><code><c- g>animationWorklet</c-></code></dfn>;
16251625
};
16261626
</pre>
16271627
<pre class="idl highlight def"><c- b>callback</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="callback" data-export id="callbackdef-voidfunction"><code><c- g>VoidFunction</c-></code></dfn> = <c- b>void</c-> ();
@@ -1911,7 +1911,7 @@ <h3 class="heading settled" data-level="6.2" id="creating-worklet-animation"><sp
19111911
<p>Let <var>workletAnimation</var> be a new <code class="idl"><a data-link-type="idl" href="#workletanimation" id="ref-for-workletanimation①">WorkletAnimation</a></code> object.</p>
19121912
<li data-md>
19131913
<p>Run the procedure to <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#set-the-timeline-of-an-animation" id="ref-for-set-the-timeline-of-an-animation">set the timeline of an animation</a> on <var>workletAnimation</var> passing <var>timeline</var> as the new timeline or, if a <var>timeline</var> argument is not provided,
1914-
passing the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#the-documents-default-timeline" id="ref-for-the-documents-default-timeline">default document timeline</a> of the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document" id="ref-for-document">Document</a></code> associated with the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window">Window</a></code> that is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object" id="ref-for-current-global-object">current global object</a>.</p>
1914+
passing the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#the-documents-default-timeline" id="ref-for-the-documents-default-timeline">default document timeline</a> of the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document" id="ref-for-document">Document</a></code> associated with the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window">Window</a></code> that is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object" id="ref-for-current-global-object">current global object</a>.</p>
19151915
<li data-md>
19161916
<p>Let <var>effect</var> be the result corresponding to the first matching condition from below.</p>
19171917
<dl>
@@ -2088,7 +2088,7 @@ <h3 class="heading settled" data-level="9.1" id="example-1"><span class="secno">
20882088
<c- p>&lt;/</c-><c- f>div</c-><c- p>></c->
20892089

20902090
<c- p>&lt;</c-><c- f>script</c-><c- p>></c->
2091-
await animationWorklet<c- p>.</c->addModule<c- p>(</c-><c- t>'hidey-bar-animator.js'</c-><c- p>);</c->
2091+
await CSS<c- p>.</c->animationWorklet<c- p>.</c->addModule<c- p>(</c-><c- t>'hidey-bar-animator.js'</c-><c- p>);</c->
20922092
<c- kr>const</c-> scrollTimeline <c- o>=</c-> <c- k>new</c-> ScrollTimeline<c- p>(</c->$scrollingContainer<c- p>,</c-> <c- p>{</c->timeRange<c- o>:</c-> <c- mi>1000</c-><c- p>});</c->
20932093
<c- kr>const</c-> documentTimeline <c- o>=</c-> document<c- p>.</c->timeline<c- p>;</c->
20942094

@@ -2151,7 +2151,7 @@ <h3 class="heading settled" data-level="9.2" id="example-2"><span class="secno">
21512151
<c- p>&lt;/</c-><c- f>div</c-><c- p>></c->
21522152

21532153
<c- p>&lt;</c-><c- f>script</c-><c- p>></c->
2154-
await animationWorklet<c- p>.</c->addModule<c- p>(</c-><c- t>'twitter-header-animator.js'</c-><c- p>);</c->
2154+
await CSS<c- p>.</c->animationWorklet<c- p>.</c->addModule<c- p>(</c-><c- t>'twitter-header-animator.js'</c-><c- p>);</c->
21552155
<c- kr>const</c-> animation <c- o>=</c-> <c- k>new</c-> WorkletAnimation<c- p>(</c->
21562156
<c- t>'twitter-header'</c-><c- p>,</c->
21572157
<c- p>[</c-><c- k>new</c-> KeyFrameEffect<c- p>(</c->$avatar<c- p>,</c-> <c- d>/* scales down as we scroll up */</c->
@@ -2203,7 +2203,7 @@ <h3 class="heading settled" data-level="9.3" id="example-3"><span class="secno">
22032203
<c- p>&lt;/</c-><c- f>div</c-><c- p>></c->
22042204

22052205
<c- p>&lt;</c-><c- f>script</c-><c- p>></c->
2206-
await animationWorklet<c- p>.</c->addModule<c- p>(</c-><c- t>'parallax-animator.js'</c-><c- p>);</c->
2206+
await CSS<c- p>.</c->animationWorklet<c- p>.</c->addModule<c- p>(</c-><c- t>'parallax-animator.js'</c-><c- p>);</c->
22072207
<c- kr>const</c-> scrollTimeline <c- o>=</c-> <c- k>new</c-> ScrollTimeline<c- p>(</c->$scrollingContainer<c- p>,</c-> <c- p>{</c->timeRange<c- o>:</c-> <c- mi>1000</c-><c- p>});</c->
22082208
<c- kr>const</c-> scrollRange <c- o>=</c-> $scrollingContainer<c- p>.</c->scrollHeight <c- o>-</c-> $scrollingContainer<c- p>.</c->clientHeight<c- p>;</c->
22092209

@@ -2389,7 +2389,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
23892389
<li><a href="#animation-animator-name">animation animator name</a><span>, in §6.1</span>
23902390
<li><a href="#animation-requested-flag">animation requested flag</a><span>, in §5.5</span>
23912391
<li><a href="#animation-worklet">Animation Worklet</a><span>, in §3</span>
2392-
<li><a href="#dom-window-animationworklet">animationWorklet</a><span>, in §3</span>
2392+
<li><a href="#dom-css-animationworklet">animationWorklet</a><span>, in §3</span>
23932393
<li><a href="#animationworkletglobalscope">AnimationWorkletGlobalScope</a><span>, in §3</span>
23942394
<li><a href="#animator-attached-timelines">animator attached timelines</a><span>, in §5</span>
23952395
<li><a href="#animator-current-time">animator current time</a><span>, in §5</span>
@@ -2435,6 +2435,12 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
24352435
<li><a href="#ref-for-typedef-ident①">4.1. Registering an Animator Definition</a>
24362436
</ul>
24372437
</aside>
2438+
<aside class="dfn-panel" data-for="term-for-namespacedef-css">
2439+
<a href="https://drafts.csswg.org/cssom-1/#namespacedef-css">https://drafts.csswg.org/cssom-1/#namespacedef-css</a><b>Referenced in:</b>
2440+
<ul>
2441+
<li><a href="#ref-for-namespacedef-css">3. Animation Worklet</a>
2442+
</ul>
2443+
</aside>
24382444
<aside class="dfn-panel" data-for="term-for-document">
24392445
<a href="https://dom.spec.whatwg.org/#document">https://dom.spec.whatwg.org/#document</a><b>Referenced in:</b>
24402446
<ul>
@@ -2444,8 +2450,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
24442450
<aside class="dfn-panel" data-for="term-for-window">
24452451
<a href="https://html.spec.whatwg.org/multipage/window-object.html#window">https://html.spec.whatwg.org/multipage/window-object.html#window</a><b>Referenced in:</b>
24462452
<ul>
2447-
<li><a href="#ref-for-window">3. Animation Worklet</a>
2448-
<li><a href="#ref-for-window①">6.2. Creating a Worklet Animation</a>
2453+
<li><a href="#ref-for-window">6.2. Creating a Worklet Animation</a>
24492454
</ul>
24502455
</aside>
24512456
<aside class="dfn-panel" data-for="term-for-current-global-object">
@@ -2573,6 +2578,11 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
25732578
<ul>
25742579
<li><span class="dfn-paneled" id="term-for-typedef-ident" style="color:initial">&lt;ident></span>
25752580
</ul>
2581+
<li>
2582+
<a data-link-type="biblio">[cssom-1]</a> defines the following terms:
2583+
<ul>
2584+
<li><span class="dfn-paneled" id="term-for-namespacedef-css" style="color:initial">CSS</span>
2585+
</ul>
25762586
<li>
25772587
<a data-link-type="biblio">[DOM]</a> defines the following terms:
25782588
<ul>
@@ -2624,6 +2634,8 @@ <h3 class="no-num no-ref heading settled" id="normative"><span class="content">N
26242634
<dd>David Baron; Dean Jackson; Brian Birtles. <a href="https://www.w3.org/TR/css-transitions-1/">CSS Transitions</a>. 30 November 2017. WD. URL: <a href="https://www.w3.org/TR/css-transitions-1/">https://www.w3.org/TR/css-transitions-1/</a>
26252635
<dt id="biblio-css-values-4">[CSS-VALUES-4]
26262636
<dd>CSS Values and Units Module Level 4 URL: <a href="https://drafts.csswg.org/css-values-4/">https://drafts.csswg.org/css-values-4/</a>
2637+
<dt id="biblio-cssom-1">[CSSOM-1]
2638+
<dd>Simon Pieters; Glenn Adams. <a href="https://www.w3.org/TR/cssom-1/">CSS Object Model (CSSOM)</a>. 17 March 2016. WD. URL: <a href="https://www.w3.org/TR/cssom-1/">https://www.w3.org/TR/cssom-1/</a>
26272639
<dt id="biblio-dom">[DOM]
26282640
<dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
26292641
<dt id="biblio-html">[HTML]
@@ -2645,8 +2657,8 @@ <h3 class="no-num no-ref heading settled" id="informative"><span class="content"
26452657
<dd><a href="https://github.com/WICG/animation-worklet/blob/gh-pages/README.md">Animation Worklet Explainer</a>. CR. URL: <a href="https://github.com/WICG/animation-worklet/blob/gh-pages/README.md">https://github.com/WICG/animation-worklet/blob/gh-pages/README.md</a>
26462658
</dl>
26472659
<h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
2648-
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window②"><c- g>Window</c-></a> {
2649-
[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.css-houdini.org/worklets/#worklet" id="ref-for-worklet①①"><c- n>Worklet</c-></a> <a data-readonly data-type="Worklet" href="#dom-window-animationworklet"><code><c- g>animationWorklet</c-></code></a>;
2660+
<pre class="idl highlight def"><c- b>partial</c-> <c- b>namespace</c-> <a class="idl-code" data-link-type="namespace" href="https://drafts.csswg.org/cssom-1/#namespacedef-css" id="ref-for-namespacedef-css①"><c- g>CSS</c-></a> {
2661+
[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.css-houdini.org/worklets/#worklet" id="ref-for-worklet①①"><c- n>Worklet</c-></a> <a data-readonly data-type="Worklet" href="#dom-css-animationworklet"><code><c- g>animationWorklet</c-></code></a>;
26502662
};
26512663

26522664
<c- b>callback</c-> <a href="#callbackdef-voidfunction"><code><c- g>VoidFunction</c-></code></a> = <c- b>void</c-> ();
@@ -2702,10 +2714,10 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
27022714
<li><a href="#ref-for-animation-worklet②">2. Threading Model</a>
27032715
</ul>
27042716
</aside>
2705-
<aside class="dfn-panel" data-for="dom-window-animationworklet">
2706-
<b><a href="#dom-window-animationworklet">#dom-window-animationworklet</a></b><b>Referenced in:</b>
2717+
<aside class="dfn-panel" data-for="dom-css-animationworklet">
2718+
<b><a href="#dom-css-animationworklet">#dom-css-animationworklet</a></b><b>Referenced in:</b>
27072719
<ul>
2708-
<li><a href="#ref-for-dom-window-animationworklet">3. Animation Worklet</a> <a href="#ref-for-dom-window-animationworklet①">(2)</a> <a href="#ref-for-dom-window-animationworklet②">(3)</a>
2720+
<li><a href="#ref-for-dom-css-animationworklet">3. Animation Worklet</a> <a href="#ref-for-dom-css-animationworklet①">(2)</a> <a href="#ref-for-dom-css-animationworklet②">(3)</a>
27092721
</ul>
27102722
</aside>
27112723
<aside class="dfn-panel" data-for="callbackdef-voidfunction">

0 commit comments

Comments
 (0)