User:Mantaroh/Scroll-driven animations: Difference between revisions

Jump to navigation Jump to search
changed third parameter type.
(fix wrong url)
(changed third parameter type.)
Line 19: Line 19:
Perhaps, WebIDL of ScrollTimeline is same to [[Platform/Layout/Extended|previous API proposal]].
Perhaps, WebIDL of ScrollTimeline is same to [[Platform/Layout/Extended|previous API proposal]].


  [Constructor ((Window or Element) scrollSource, Orientation orientation, optional DOMString maxTime)
  [Constructor ((Window or Element) scrollSource, Orientation orientation, optional double maxTime)
  interface ScrollTimeline : AnimationTimeline {
  interface ScrollTimeline : AnimationTimeline {
   attribute Orientation orientation;
   attribute Orientation orientation;
   attribute DOMString maxTime;
   attribute double maxTime;
  };
  };
   
   
Line 28: Line 28:
  enum Orientation { "vertical", "horizontal" };
  enum Orientation { "vertical", "horizontal" };


コンストラクタの第3引数の maxTime は、アニメーションの繰り返し回数が無限(Infinte)の為に使用します。
We will specify the third parameter when iterations of animation is 'Infinite'.
この引数を指定しない場合は、以下の計算により自動で設定されます。
And update the range of ScrollTimeline based on the first maching conditions:
  - もし ScrollTimeline に関連する Aniamtion が存在しない場合は 0ms
  - If ScrollTimeline doesn't have any related animation, maxRange should be 0ms.
  - Animation が存在する場合、[https://w3c.github.io/web-animations/#target-effect-end| target effect end]
  - If ScrollTimeline has related animation, maxRnage should be max value in animations.  
  - 値が Inifinity の場合、関連する Animation で一番大きな target effect end とする。
  (We should ignore the infinity duration.)
  - 関連するすべての Animation の target effect end が Infinity の場合、
- If all of related animation's duration is infinity, maxRange should be max value in animation's duration.
   
  e.g. we have two animations.
    target1.animation = "anim1 10s linear infinite";
    target2.animation = "anim2 20s linear infinite";
 
  Then we should be max value of ScrollTimeline is 20s.
 
=== Interface of CSS proposal ===
=== Interface of CSS proposal ===


28

edits

Navigation menu