New issue
Advanced search Search tips

Issue 719517 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 430155



Sign in to add a comment

AnimationWorklet - Add ScrollTimeline in Blink (with JS bindings)

Project Member Reported by smcgruer@chromium.org, May 8 2017

Issue description

For AnimationWorklet, we require some form of ScrollTimeline interface to be available so that scroll-based animations can be created[0].

As of the date of bug creation, there is a ScrollTimeline API specified in a WICG[1], which is replicated below, but it is not yet stable. However for the first implementation of AnimationWorklet we are happy to implement and use a simpler draft version, and update as the spec solidifies.

Current spec for ScrollTimeline:

enum ScrollDirection {
  "auto",
  "block",
  "inline",
  "horizontal",
  "vertical"
};

enum ScrollTimelineAutoKeyword { "auto" };

dictionary ScrollTimelineOptions {
  Element scrollSource;
  ScrollDirection orientation = "auto";
  DOMString startScrollOffset = "auto";
  DOMString endScrollOffset = "auto";
  (double or ScrollTimelineAutoKeyword) timeRange = "auto";
  FillMode fill = "none";
};

[Constructor(optional ScrollTimelineOptions options)]
interface ScrollTimeline : AnimationTimeline {
  readonly attribute Element scrollSource;
  readonly attribute ScrollDirection orientation;
  readonly attribute DOMString startScrollOffset;
  readonly attribute DOMString endScrollOffset;
  readonly attribute (double or ScrollTimelineAutoKeyword) timeRange;
  readonly attribute FillMode fill;
};



Our first step should be to identify what simplified API we actually *need* for AnimationWorklet.


[0]: https://github.com/WICG/animation-worklet/blob/gh-pages/WIP.md

[1]: https://wicg.github.io/scroll-animations/#scrolltimeline-interface
 
Blocking: 430155
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd

commit a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd
Author: smcgruer <smcgruer@chromium.org>
Date: Tue Jul 04 15:48:41 2017

Basic ScrollTimeline implementation for Animation Worklet

This is based on the WICG spec[0], but simplified for the Animation Worklet
origin trial. Specifically, the following things were changed from the spec:

  * ScrollDirection only has two values: "block" and "inline".
  * Dropped startScrollOffset.
  * Dropped endScrollOffset.
  * timeRange is not allowed to be "auto".
  * Dropped fill.

[0] https://wicg.github.io/scroll-animations/#scrolltimeline-interface

BUG= 719517 

Review-Url: https://codereview.chromium.org/2873493002
Cr-Commit-Position: refs/heads/master@{#484117}

[add] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-creation.html
[add] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime-nan.html
[add] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime.html
[modify] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
[modify] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/Source/core/animation/BUILD.gn
[add] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/Source/core/animation/ScrollTimeline.cpp
[add] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/Source/core/animation/ScrollTimeline.h
[add] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/Source/core/animation/ScrollTimeline.idl
[add] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/Source/core/animation/ScrollTimelineOptions.idl
[modify] https://crrev.com/a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd/third_party/WebKit/Source/core/core_idl_files.gni

a5a47f2f0ae0b0ec8e114f0023d1bae7290475cd should be sufficient for our AW needs. I hope. :)
Status: Fixed (was: Available)

Sign in to add a comment