Skip to content

Commit 1734e5b

Browse files
committed
Remove 'scroll-container-name', identifying the scrollSource via 'element(#id)' instead
1 parent d2f0ddc commit 1734e5b

2 files changed

Lines changed: 74 additions & 167 deletions

File tree

Overview.bs

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -327,29 +327,6 @@ element.
327327
</div>
328328
</div>
329329

330-
## The 'scroll-container-name' property ## {#scroll-container-name}
331-
332-
<pre class='propdef'>
333-
Name: scroll-container-name
334-
Value: [ none | <<custom-ident>> ]
335-
Initial: none
336-
Applies to: [=scroll containers=]
337-
Inherited: none
338-
Animatable: no
339-
Percentages: N/A
340-
Media: interactive
341-
Computed value: As specified
342-
Canonical order: per grammar
343-
</pre>
344-
345-
The 'scroll-container-name' property defines a custom identifier for a [=scroll container=],
346-
which allows the scroll container to be referred to by the 'animation-trigger' property
347-
(and possibly other properties in the future).
348-
349-
Each 'scroll-container-name' value in a document should be unique; if multiple scroll
350-
containers in a document have the same 'scroll-container-name', references to that name
351-
resolve to an unspecified one of them.
352-
353330
## The 'animation-trigger' property ## {#animation-trigger}
354331

355332
<pre class='propdef'>
@@ -367,7 +344,7 @@ Canonical order: per grammar
367344

368345
<dfn>&lt;single-animation-trigger></dfn> = auto | <<scroll-trigger>>
369346

370-
<dfn>&lt;scroll-trigger></dfn> = scroll(<<custom-ident>>, <<scroll-direction>> [, <<scroll-offset>> [, <<scroll-offset>>]])
347+
<dfn>&lt;scroll-trigger></dfn> = scroll(element(<<id-selector>>), <<scroll-direction>> [, <<scroll-offset>> [, <<scroll-offset>>]])
371348

372349
<dfn>&lt;scroll-direction></dfn> = auto | horizontal | vertical
373350

@@ -387,8 +364,8 @@ following effects:
387364
: <<scroll-trigger>>
388365
:: The animation's [[web-animations#timeline|timeline]] has a {{ScrollTrigger}}.
389366

390-
The trigger's {{ScrollTrigger/scrollSource}} is the [=scroll container=] whose
391-
'scroll-container-name' matches the provided <<custom-ident>>.
367+
The trigger's {{ScrollTrigger/scrollSource}} is the [=scroll container=] identified
368+
by the <<id-selector>>.
392369

393370
The trigger's {{ScrollTrigger/orientation}} is determined by the provided
394371
<<scroll-direction>>.
@@ -463,16 +440,14 @@ Issue: Do we need 'animation-trigger' at all, or is ''@trigger'' sufficient?
463440
transform: rotate(1turn);
464441
}
465442
}
466-
html {
467-
scroll-container-name: root;
468-
}
469443
#spinner {
470444
animation-name: spin;
471445
animation-duration: 300ms;
472446
animation-fill-mode: both;
473447
animation-iteration-count: infinite;
474448
animation-timing-function: linear;
475-
animation-trigger: scroll(root, vertical, 500px, 1000px);
449+
/* Assume the HTML element has id 'root' */
450+
animation-trigger: scroll(element(#root), vertical, 500px, 1000px);
476451
}
477452
</pre>
478453
</div>
@@ -488,10 +463,8 @@ Issue: Do we need 'animation-trigger' at all, or is ''@trigger'' sufficient?
488463
transform: rotate(1turn);
489464
}
490465
}
491-
html {
492-
scroll-container-name: root;
493-
}
494-
@trigger scroll(root, vertical, 500px, 1000px) {
466+
/* Assume the HTML element has id 'root' */
467+
@trigger scroll(element(#root), vertical, 500px, 1000px) {
495468
#spinner {
496469
animation-name: spin;
497470
animation-duration: 300ms;
@@ -724,9 +697,6 @@ following effects:
724697
width: 100vw;
725698
}
726699
}
727-
html {
728-
scroll-container-name: root;
729-
}
730700
#progress {
731701
position: fixed;
732702
top: 0;
@@ -736,7 +706,8 @@ following effects:
736706
animation-name: progress;
737707
animation-duration: 1s;
738708
animation-timing-function: linear;
739-
animation-trigger: scroll(root, vertical);
709+
/* Assume the HTML element has id 'root' */
710+
animation-trigger: scroll(element(#root), vertical);
740711
animation-timeline: scroll();
741712
}
742713
</pre>
@@ -753,17 +724,15 @@ following effects:
753724
width: 100vw;
754725
}
755726
}
756-
html {
757-
scroll-container-name: root;
758-
}
759727
#progress {
760728
position: fixed;
761729
top: 0;
762730
width: 0;
763731
height: 2px;
764732
background-color: red;
765733
}
766-
@trigger scroll(root, vertical) {
734+
/* Assume the HTML element has id 'root' */
735+
@trigger scroll(element(#root), vertical) {
767736
#progress {
768737
animation-name: progress;
769738
animation-duration: 1s;

0 commit comments

Comments
 (0)