Skip to content

Commit 65bb4af

Browse files
authored
Add normative and other cleanups (w3c#106)
Add notes to intro and threading section making it clear they are not normative. Other small changes: - Remove empty security and privacy sections - Use should instead of must in one case.
1 parent 2626450 commit 65bb4af

File tree

2 files changed

+20
-32
lines changed

2 files changed

+20
-32
lines changed

index.bs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ urlPrefix: https://wicg.github.io/scroll-animations/#; type: dfn
102102

103103
Introduction {#intro}
104104
=====================
105+
<em>This section is not normative.</em>
106+
105107
This document introduces a new primitive for creating scroll-linked and other high performance
106108
procedural animations on the web. For details on the rationale and motivation see [[explainer]].
107109

@@ -124,6 +126,7 @@ animations.
124126

125127
Threading Model {#threading-model}
126128
==================================
129+
<em>This section is not normative.</em>
127130

128131
<a>Animation Worklet</a> is designed to be thread-agnostic. Rendering engines may create one or more
129132
parallel worklet execution contexts separate from the main javascript execution context, e.g., on
@@ -142,7 +145,7 @@ limit themselves to animating properties which do not require the user agent to
142145
will have a much better chance of meeting the strict frame budgets required for smooth playback.
143146

144147
If a Worklet Animation animation is executing in a parallel worklet execution context, the last
145-
known state of its animation effects must be periodically synced back to the main javascript
148+
known state of its animation effects should be periodically synced back to the main javascript
146149
execution context. The synchronization of <a>effect values</a> from the parallel worklet execution
147150
context to the main javascript execution context <em>must</em> occur before <a>running the animation
148151
frame callbacks</a> as part of the document lifecycle. Note that due to the asynchronous nature of
@@ -727,15 +730,6 @@ As with other animations, <a>worklet animations</a> participate in the <a>effect
727730
worklet animation does not have a specific <a>animation class</a> which means it has the same
728731
composite order as other Javascript created web animations.
729732

730-
Security Considerations {#security-considerations}
731-
==================================================
732-
733-
Issue: Need to decide what security considerations there are for this spec.
734-
735-
Privacy Considerations {#privacy-considerations}
736-
================================================
737-
738-
Issue: Need to decide what privacy considerations there are for this spec.
739733

740734
Examples {#examples}
741735
====================

index.html

Lines changed: 16 additions & 22 deletions
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="9fdddcda8e8eb5e4d9027999cdeeac3f65b4e4eb" name="document-revision">
1217+
<meta content="26264503e48ed9ed311680c45c18bc1e9ee56732" name="document-revision">
12181218
<style>/* style-md-lists */
12191219

12201220
/* This is a weird hack for me not yet following the commonmark spec
@@ -1472,7 +1472,7 @@
14721472
<div class="head">
14731473
<p data-fill-with="logo"></p>
14741474
<h1 class="p-name no-ref" id="title">CSS Animation Worklet API</h1>
1475-
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="2018-08-07">7 August 2018</time></span></h2>
1475+
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="2018-08-08">8 August 2018</time></span></h2>
14761476
<div data-fill-with="spec-metadata">
14771477
<dl>
14781478
<dt>This version:
@@ -1542,14 +1542,12 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
15421542
<li><a href="#worklet-group-effect"><span class="secno">6.7</span> <span class="content">WorkletGroupEffect</span></a>
15431543
<li><a href="#effect-stack-composite-order"><span class="secno">6.8</span> <span class="content">Effect Stack and Composite Order</span></a>
15441544
</ol>
1545-
<li><a href="#security-considerations"><span class="secno">7</span> <span class="content">Security Considerations</span></a>
1546-
<li><a href="#privacy-considerations"><span class="secno">8</span> <span class="content">Privacy Considerations</span></a>
15471545
<li>
1548-
<a href="#examples"><span class="secno">9</span> <span class="content">Examples</span></a>
1546+
<a href="#examples"><span class="secno">7</span> <span class="content">Examples</span></a>
15491547
<ol class="toc">
1550-
<li><a href="#example-1"><span class="secno">9.1</span> <span class="content">Example 1: Hidey Bar.</span></a>
1551-
<li><a href="#example-2"><span class="secno">9.2</span> <span class="content">Example 2: Twitter header.</span></a>
1552-
<li><a href="#example-3"><span class="secno">9.3</span> <span class="content">Example 3: Parallax backgrounds.</span></a>
1548+
<li><a href="#example-1"><span class="secno">7.1</span> <span class="content">Example 1: Hidey Bar.</span></a>
1549+
<li><a href="#example-2"><span class="secno">7.2</span> <span class="content">Example 2: Twitter header.</span></a>
1550+
<li><a href="#example-3"><span class="secno">7.3</span> <span class="content">Example 3: Parallax backgrounds.</span></a>
15531551
</ol>
15541552
<li><a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
15551553
<li>
@@ -1570,8 +1568,9 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
15701568
</nav>
15711569
<main>
15721570
<h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
1573-
This document introduces a new primitive for creating scroll-linked and other high performance
1574-
procedural animations on the web. For details on the rationale and motivation see <a data-link-type="biblio" href="#biblio-explainer">[explainer]</a>.
1571+
<em>This section is not normative.</em>
1572+
<p>This document introduces a new primitive for creating scroll-linked and other high performance
1573+
procedural animations on the web. For details on the rationale and motivation see <a data-link-type="biblio" href="#biblio-explainer">[explainer]</a>.</p>
15751574
<p>The <a data-link-type="dfn" href="#animation-worklet" id="ref-for-animation-worklet">Animation Worklet</a> API provides a method to create scripted animations that control a set
15761575
of <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#animation-effect" id="ref-for-animation-effect">animation effects</a>. The API is designed to make it possible for user agents to run such
15771576
animations in their own dedicated thread to provide a degree of performance isolation from main
@@ -1584,6 +1583,7 @@ <h3 class="heading settled" data-level="1.1" id="relationship-to-web-animations"
15841583
or alter the input time (reverse, finish, etc.) have different semantics for Animation Worklet
15851584
animations.</p>
15861585
<h2 class="heading settled" data-level="2" id="threading-model"><span class="secno">2. </span><span class="content">Threading Model</span><a class="self-link" href="#threading-model"></a></h2>
1586+
<em>This section is not normative.</em>
15871587
<p><a data-link-type="dfn" href="#animation-worklet" id="ref-for-animation-worklet②">Animation Worklet</a> is designed to be thread-agnostic. Rendering engines may create one or more
15881588
parallel worklet execution contexts separate from the main javascript execution context, e.g., on
15891589
their own dedicated threads. Rendering engines may then choose to assign Animation Worklet
@@ -1598,7 +1598,7 @@ <h2 class="heading settled" data-level="2" id="threading-model"><span class="sec
15981598
limit themselves to animating properties which do not require the user agent to consult main thread
15991599
will have a much better chance of meeting the strict frame budgets required for smooth playback.</p>
16001600
<p>If a Worklet Animation animation is executing in a parallel worklet execution context, the last
1601-
known state of its animation effects must be periodically synced back to the main javascript
1601+
known state of its animation effects should be periodically synced back to the main javascript
16021602
execution context. The synchronization of <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#effect-value" id="ref-for-effect-value">effect values</a> from the parallel worklet execution
16031603
context to the main javascript execution context <em>must</em> occur before <a data-link-type="dfn" href="https://html.spec.whatwg.org/#run-the-animation-frame-callbacks" id="ref-for-run-the-animation-frame-callbacks">running the animation
16041604
frame callbacks</a> as part of the document lifecycle. Note that due to the asynchronous nature of
@@ -2046,7 +2046,7 @@ <h3 class="heading settled" data-level="6.7" id="worklet-group-effect"><span cla
20462046
<p><code class="idl"><a data-link-type="idl" href="#workletgroupeffect" id="ref-for-workletgroupeffect①">WorkletGroupEffect</a></code> is a type of <a data-link-type="dfn" href="https://w3c.github.io/web-animations/level-2/#group-effect" id="ref-for-group-effect">group effect</a> that allows its <a data-link-type="dfn" href="https://w3c.github.io/web-animations/level-2/#child-effect" id="ref-for-child-effect">child effect’s</a> <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#local-time" id="ref-for-local-time④">local times</a> to be mutated individually.</p>
20472047
<p>When a <code class="idl"><a data-link-type="idl" href="#workletgroupeffect" id="ref-for-workletgroupeffect②">WorkletGroupEffect</a></code> is set as the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#animation-effect" id="ref-for-animation-effect⑤">animation effect</a> of a <code class="idl"><a data-link-type="idl" href="#workletanimation" id="ref-for-workletanimation②">WorkletAnimation</a></code>, the
20482048
corresponding <a data-link-type="dfn" href="#animator-instance" id="ref-for-animator-instance②③">animator instance</a> can directly control the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/level-2/#child-effect" id="ref-for-child-effect①">child effects</a>' <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#local-time" id="ref-for-local-time⑤">local
2049-
times</a>. This allows a single worklet animation to coordinate multiple effects - see <a href="#example-2">§9.2 Example 2: Twitter header.</a> for an example of such a use-case.</p>
2049+
times</a>. This allows a single worklet animation to coordinate multiple effects - see <a href="#example-2">§7.2 Example 2: Twitter header.</a> for an example of such a use-case.</p>
20502050
<pre class="idl highlight def"><c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="workletgroupeffect"><code><c- g>WorkletGroupEffect</c-></code></dfn> {
20512051
<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/web-animations-1/#animationeffect" id="ref-for-animationeffect④"><c- n>AnimationEffect</c-></a>> <dfn class="idl-code" data-dfn-for="WorkletGroupEffect" data-dfn-type="method" data-export data-lt="getChildren()" id="dom-workletgroupeffect-getchildren"><code><c- g>getChildren</c-></code><a class="self-link" href="#dom-workletgroupeffect-getchildren"></a></dfn>();
20522052
};
@@ -2080,12 +2080,8 @@ <h3 class="heading settled" data-level="6.8" id="effect-stack-composite-order"><
20802080
<p>As with other animations, <a data-link-type="dfn" href="#worklet-animation" id="ref-for-worklet-animation①③">worklet animations</a> participate in the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#effect-stack" id="ref-for-effect-stack">effect stack</a>. A
20812081
worklet animation does not have a specific <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#animation-class" id="ref-for-animation-class">animation class</a> which means it has the same
20822082
composite order as other Javascript created web animations.</p>
2083-
<h2 class="heading settled" data-level="7" id="security-considerations"><span class="secno">7. </span><span class="content">Security Considerations</span><a class="self-link" href="#security-considerations"></a></h2>
2084-
<p class="issue" id="issue-de770110"><a class="self-link" href="#issue-de770110"></a> Need to decide what security considerations there are for this spec.</p>
2085-
<h2 class="heading settled" data-level="8" id="privacy-considerations"><span class="secno">8. </span><span class="content">Privacy Considerations</span><a class="self-link" href="#privacy-considerations"></a></h2>
2086-
<p class="issue" id="issue-19f9ed9b"><a class="self-link" href="#issue-19f9ed9b"></a> Need to decide what privacy considerations there are for this spec.</p>
2087-
<h2 class="heading settled" data-level="9" id="examples"><span class="secno">9. </span><span class="content">Examples</span><a class="self-link" href="#examples"></a></h2>
2088-
<h3 class="heading settled" data-level="9.1" id="example-1"><span class="secno">9.1. </span><span class="content">Example 1: Hidey Bar.</span><a class="self-link" href="#example-1"></a></h3>
2083+
<h2 class="heading settled" data-level="7" id="examples"><span class="secno">7. </span><span class="content">Examples</span><a class="self-link" href="#examples"></a></h2>
2084+
<h3 class="heading settled" data-level="7.1" id="example-1"><span class="secno">7.1. </span><span class="content">Example 1: Hidey Bar.</span><a class="self-link" href="#example-1"></a></h3>
20892085
An example of header effect where a header is moved with scroll and as soon as finger is lifted it
20902086
animates fully to close or open position depending on its current position.
20912087
<pre class="lang-markup highlight"><c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>'scrollingContainer'</c-><c- p>></c->
@@ -2147,7 +2143,7 @@ <h3 class="heading settled" data-level="9.1" id="example-1"><span class="secno">
21472143
is no longer actively scrolling. This is a reasonable thing to have on scroll timeline. A simple
21482144
fallback can emulate this by detecting when timeline time (i.e. scroll offset) has not changed in
21492145
the last few frames.</p>
2150-
<h3 class="heading settled" data-level="9.2" id="example-2"><span class="secno">9.2. </span><span class="content">Example 2: Twitter header.</span><a class="self-link" href="#example-2"></a></h3>
2146+
<h3 class="heading settled" data-level="7.2" id="example-2"><span class="secno">7.2. </span><span class="content">Example 2: Twitter header.</span><a class="self-link" href="#example-2"></a></h3>
21512147
An example of twitter profile header effect where two elements (avatar, and header) are updated in
21522148
sync with scroll offset.
21532149
<pre class="lang-markup highlight">// In document scope.
@@ -2193,7 +2189,7 @@ <h3 class="heading settled" data-level="9.2" id="example-2"><span class="secno">
21932189
<c- p>}</c->
21942190
<c- p>});</c->
21952191
</pre>
2196-
<h3 class="heading settled" data-level="9.3" id="example-3"><span class="secno">9.3. </span><span class="content">Example 3: Parallax backgrounds.</span><a class="self-link" href="#example-3"></a></h3>
2192+
<h3 class="heading settled" data-level="7.3" id="example-3"><span class="secno">7.3. </span><span class="content">Example 3: Parallax backgrounds.</span><a class="self-link" href="#example-3"></a></h3>
21972193
A simple parallax background example.
21982194
<pre class="lang-markup highlight"><c- p>&lt;</c-><c- f>style</c-><c- p>></c->
21992195
<c- p>.</c-><c- nc>parallax</c-> <c- p>{</c->
@@ -2721,8 +2717,6 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
27212717
<div class="issue"> The above interface exposes a conservative subset
27222718
of GroupEffect proposed as part of web-animation-2. Once that is available we
27232719
should switch to it. <a href="https://github.com/w3c/csswg-drafts/issues/2071">&lt;https://github.com/w3c/csswg-drafts/issues/2071></a><a href="#issue-82bc9872"></a></div>
2724-
<div class="issue"> Need to decide what security considerations there are for this spec.<a href="#issue-de770110"></a></div>
2725-
<div class="issue"> Need to decide what privacy considerations there are for this spec.<a href="#issue-19f9ed9b"></a></div>
27262720
<div class="issue"> This example uses a hypothetical "phase" property on timeline as a way to detect when user
27272721
is no longer actively scrolling. This is a reasonable thing to have on scroll timeline. A simple
27282722
fallback can emulate this by detecting when timeline time (i.e. scroll offset) has not changed in

0 commit comments

Comments
 (0)