Skip to content

Commit b13ac04

Browse files
committed
Address some of the issues
1 parent 65371a5 commit b13ac04

2 files changed

Lines changed: 209 additions & 245 deletions

File tree

Overview.bs

Lines changed: 31 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ partial interface DocumentTimeline {
200200

201201
<pre class="idl">
202202
enum ScrollDirection {
203+
"block",
204+
"inline",
203205
"horizontal",
204206
"vertical"
205207
};
@@ -208,6 +210,12 @@ enum ScrollDirection {
208210
The {{ScrollDirection}} enumeration specifies a direction of scroll of a
209211
scrollable element.
210212

213+
: <code>block</code>
214+
:: Selects the direction along the [=block axis=]
215+
216+
: <code>inline</code>
217+
:: Selects the direction along the [=inline axis=]
218+
211219
: <code>horizontal</code>
212220
:: Selects the horizontal direction
213221

@@ -216,8 +224,8 @@ scrollable element.
216224

217225
<div class="issue">
218226

219-
This should use logical directions such as "block" and "inline", but
220-
should it support physical directions as well?
227+
Should the physical directions ("horizontal" and "vertical") be removed, leaving
228+
only the logical directions ("block" and "inline")?
221229

222230
We should add an "auto" value here that means, "If only one direction is
223231
scrollable use that direction, otherwise use the block direction".
@@ -285,12 +293,7 @@ element.
285293
: <dfn attribute for=ScrollTrigger>scrollSource</dfn>
286294
:: The scrollable element whose scrolling activates and deactivates the trigger.
287295

288-
Issue: Is this required? If so, we should mark it as <code>required</code>
289-
in the IDL (and remove <code>optional</code> from the
290-
<code>options</code> parameter to the {{ScrollTrigger()}}
291-
constructor). If not, we should define the behavior when {{scrollSource}} is
292-
not specified (e.g. using the document element, or perhaps the nearest
293-
ancestor scroll container).
296+
If this is not specified, the document element is used.
294297

295298
: <dfn attribute for=ScrollTrigger>kind</dfn>
296299
:: Determines the way in which scrolling {{scrollSource}} activates and deactivates
@@ -314,13 +317,10 @@ element.
314317

315318
If a value for {{orientation}} is not specified, and {{scrollSource}} is only scrollable
316319
in one direction, that direction is used; if {{scrollSource}} is scrollable
317-
in both directions, an unspecified direction is used.
320+
in both directions, the {{block}} direction is used.
318321

319322
Issue: I think we should simply define a suitable "auto" value and make that
320323
the default value in the {{ScrollTriggerOptions}} dictionary.
321-
Also, we shouldn't have unspecified behavior (since, in practice, the
322-
most popular rendering engine at the time ends up becoming the spec for any
323-
undefined behavior, so we may as well spec it).
324324

325325
: <dfn attribute for=ScrollTrigger>scrollOffset</dfn>
326326
:: The scroll offset, in the direction specified by {{orientation}}, that triggers
@@ -375,7 +375,7 @@ CSS Animations [[CSS3-ANIMATIONS]] with the 'animation-trigger' property.
375375
<pre class='propdef'>
376376
Name: animation-trigger
377377
Value: <<single-animation-trigger>>#
378-
Initial: auto
378+
Initial: none
379379
Applies to: all elements, ::before and ::after pseudo-elements
380380
Inherited: none
381381
Animatable: no
@@ -385,9 +385,9 @@ Computed value: As specified
385385
Canonical order: per grammar
386386
</pre>
387387

388-
<dfn>&lt;single-animation-trigger></dfn> = auto | <<scroll-trigger>>
388+
<dfn>&lt;single-animation-trigger></dfn> = none | <<scroll-trigger>>
389389

390-
<dfn>&lt;scroll-trigger></dfn> = scroll(element(<<id-selector>>), <<scroll-direction>> [, <<scroll-offset>> [, <<scroll-offset>>]])
390+
<dfn>&lt;scroll-trigger></dfn> = scroll([element(<<id-selector>>), [,<<scroll-direction>> [, <<scroll-offset>> [, <<scroll-offset>>]]]])
391391

392392
<dfn>&lt;scroll-direction></dfn> = auto | horizontal | vertical
393393

@@ -402,35 +402,24 @@ element, with the triggers matched up with animations as described
402402
Each value has type <<single-animation-trigger>>, whose possible values have the
403403
following effects:
404404

405-
: auto
405+
: <dfn value for=animation-trigger>none</dfn>
406406
:: The animation's [=timeline=] has no {{AnimationTimeline/trigger|trigger}}.
407407

408-
Issue: Is &lsquo;none&rsquo; better here? I'm not sure what is more
409-
idiomatic CSS.
410-
411408
: <<scroll-trigger>>
412409
:: The animation's [=timeline=] has a {{ScrollTrigger}}.
413410

414411
The trigger's {{ScrollTrigger/scrollSource}} is the [=scroll container=] identified
415-
by the <<id-selector>>.
416-
417-
Issue: Should it be possible to omit the scroll container and use the
418-
initial container block? I think Apple's proposal did this? Also, in
419-
the example below we have to assume the HTML element has an ID attached
420-
to handle this case which seems unfortunate.
412+
by the <<id-selector>>, defaulting to the element's nearest scrollable ancestor.
421413

422-
The trigger's {{ScrollTrigger/orientation}} is determined by the provided
423-
<<scroll-direction>>.
424-
425-
Issue: Should it be possible to omit the scroll-direction and have it
426-
default to &lsquo;auto&rsquo;?
414+
The <<scroll-direction>>, if provided, determines the trigger's {{ScrollTrigger/orientation}}.
427415

428416
The first <<scroll-offset>>, if provided, determines the trigger's {{ScrollTrigger/scrollOffset}}.
429417

430418
The second <<scroll-offset>>, if provided, determines the trigger's {{ScrollTrigger/endScrollOffset}}.
431419

432-
Issue: It's not possible to specify the {{ScrollTrigger/kind}}. Is that ok?
433-
In any case, we need to define what value to use for {{ScrollTrigger/kind}}.
420+
The trigger's {{ScrollTrigger/kind}} is {{ScrollTriggerKind/range}}.
421+
422+
Issue: Should we allow overriding the kind to {{ScrollTriggerKind/offset}}?
434423

435424
## ''@trigger'' rules ## {#trigger-rules}
436425

@@ -569,10 +558,8 @@ A <dfn>scroll timeline</dfn> is an {{AnimationTimeline}} whose time values are d
569558
not by wall-clock time, but by the progress of scrolling in a [=scroll container=].
570559

571560
A {{ScrollTimeline}} must have a {{AnimationTimeline/trigger}}, it must be of type
572-
{{ScrollTrigger}}, and the trigger's {{kind}} must be {{range}}.
573-
574-
Issue: What happens if it doesn't? Throw a <strong>TypeError</strong> from the
575-
constructor?
561+
{{ScrollTrigger}}, and the trigger's {{kind}} must be {{range}}. If these criteria
562+
are not met, a <strong>TypeError</strong> is thrown from the constructor.
576563

577564
The scroll container whose scrolling drives the timeline is the trigger's
578565
{{scrollSource}}. The direction of scrolling that drives the timeline is the
@@ -713,13 +700,12 @@ following effects:
713700

714701
: auto
715702
:: The animation's [=timeline=] is a {{DocumentTimeline}}
716-
(possibly with a {{AnimationTimeline/trigger}}) specified using 'animation-trigger'.
717703

718-
Issue: We probably need to specify somewhere that if 'animation-trigger' is
719-
&lsquo;auto&rsquo; (or &lsquo;none&rsquo; if we decide to rename that value)
720-
that we use the <a>default document timeline</a> but otherwise we generate
721-
a new {{DocumentTimeline}} with the appropriate trigger. Or do we re-use
722-
{{DocumentTimeline}} objects when the trigger is the same?
704+
If 'animation-trigger' is ''animation-trigger/none'', the <a>default document timeline</a> is used;
705+
otherwise, a new {{DocumentTimeline}} with the appropriate
706+
{{AnimationTimeline/trigger}} is generated.
707+
708+
Issue: Do we re-use {{DocumentTimeline}} objects when the trigger is the same?
723709

724710
: scroll([<<time>> [, <<single-animation-fill-mode>>]])
725711
:: The animation's [=timeline=] is a {{ScrollTimeline}}.
@@ -729,15 +715,8 @@ following effects:
729715
The <<single-animation-fill-mode>> value, if specified, determines the timeline's
730716
{{ScrollTimeline/fill}}.
731717

732-
The animation's timeline must also have a {{ScrollTrigger}}, defined using the JS API
733-
or using the 'animation-trigger' property.
734-
735-
Issue: How would it be possible to define the trigger using JS and
736-
associate it with the timeline if the timeline is created from CSS?
737-
Would it be possible to use all default values for 'animation-trigger' so
738-
that you can simply write <code>animation-timeline: scroll()</code> and
739-
the animation tracks the scroll position of the document element?
740-
(Or nearest ancestor scroll container if that makes more sense)
718+
If a {{ScrollTrigger}} isn't specified using the 'animation-trigger' property, the animation's
719+
timeline is given a default {{ScrollTrigger}}, as if via <code>animation-trigger: scroll()</code>.
741720

742721
## Examples ## {#timeline-examples}
743722

@@ -851,6 +830,6 @@ rendered scroll offset of a scroll container may not be consistent with the stat
851830
of an animation driven by scrolling that scroll container. However, this will
852831
only occur in situations where the animation's effect changes the scroll offset
853832
of that same scroll container (in other words, in situations where the animation's
854-
author is asking for trobule). In normal situations, including - importantly -
833+
author is asking for trouble). In normal situations, including - importantly -
855834
when scrolling happens in response to input events, the rendered scroll offset
856835
and the state of scroll-driven animations will be consistent in each frame.

0 commit comments

Comments
 (0)