Skip to content

Commit 2093954

Browse files
committed
[scroll-animations-1] Switch ViewTimeline start/end to using lengths, now that currentTime is percentages. w3c#7312
1 parent c55700b commit 2093954

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

scroll-animations-1/rewrite.bs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ spec: cssom-view-1; type: dfn;
357357
interface ViewTimeline : ScrollTimeline {
358358
constructor(optional ViewTimelineOptions options = {});
359359
readonly attribute Element subject;
360-
readonly attribute CSSNumberish startTime;
361-
readonly attribute CSSNumberish endTime;
360+
readonly attribute CSSNumericValue startOffset;
361+
readonly attribute CSSNumericValue endOffset;
362362
};
363363
</pre>
364364

@@ -373,25 +373,25 @@ spec: cssom-view-1; type: dfn;
373373
:: The element whose [=principal box=]’s visibility in the [=scrollport=]
374374
defines the progress of the timeline.
375375

376-
: <dfn>startTime</dfn>
376+
: <dfn>startOffset</dfn>
377377
:: Represents the starting (0% progress) scroll position
378378
of the [=view progress timeline=]
379-
as a percentage {{CSSUnitValue}}
380-
representing its [=scroll container=]’s scroll progress at that position.
379+
as a length offset (in ''px'') from the scroll origin.
381380
Null when the timeline is [=timeline inactive state|inactive=].
382381

383-
: <dfn>endTime</dfn>
384-
:: Represents the ending (100%) scroll position
382+
: <dfn>endOffset</dfn>
383+
:: Represents the ending (100% progress) scroll position
385384
of the [=view progress timeline=]
386-
as a percentage {{CSSUnitValue}}
387-
representing its [=scroll container=]’s scroll progress at that position.
385+
as a length offset (in ''px'') from the scroll origin.
388386
Null when the timeline is [=timeline inactive state|inactive=].
389387
</dl>
390388

391-
Note: The {{ViewTimeline/startTime}} and {{ViewTimeline/endTime}} attributes
392-
have odd names for being specific to ScrollTimeline;
393-
this is to keep them consistent with {{AnimationTimeline/currentTime}},
394-
which represents the currently-active position on the same scale.
389+
Note: The value of {{ViewTimeline/startOffset}} can be greater than {{ViewTimeline/endOffset}},
390+
for example in the [=horizontal axis=] in a right-to-left (''rtl'') [=writing mode=].
391+
392+
ISSUE: This makes the offsets compatible with the way scrollLeft and scrollTop work,
393+
which go negative from zero in RTL scroll containers,
394+
is this how we want it to work here?
395395

396396
Inherited attributes:
397397

0 commit comments

Comments
 (0)