OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ScrollTimeline_h |
| 6 #define ScrollTimeline_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "core/animation/AnimationTimeline.h" |
| 10 #include "core/animation/ScrollTimelineOptions.h" |
| 11 #include "core/dom/Element.h" |
| 12 #include "platform/bindings/ScriptWrappable.h" |
| 13 #include "platform/wtf/text/WTFString.h" |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 // Implements the ScrollTimeline concept from the Scroll-linked Animations spec. |
| 18 // |
| 19 // A ScrollTimeline is a special form of AnimationTimeline whose time values are |
| 20 // not determined by wall-clock time but instead the progress of scrolling in a |
| 21 // scroll container. The user is able to specify which scroll container to |
| 22 // track, the direction of scroll they care about, and various attributes to |
| 23 // control the conversion of scroll amount to time output. |
| 24 // |
| 25 // Spec: https://wicg.github.io/scroll-animations/#scroll-timelines |
| 26 class CORE_EXPORT ScrollTimeline final : public AnimationTimeline { |
| 27 DEFINE_WRAPPERTYPEINFO(); |
| 28 |
| 29 public: |
| 30 enum ScrollDirection { |
| 31 Block, |
| 32 Inline, |
| 33 }; |
| 34 |
| 35 static ScrollTimeline* Create(Document&, |
| 36 ScrollTimelineOptions, |
| 37 ExceptionState&); |
| 38 |
| 39 // AnimationTimeline implementation. |
| 40 double currentTime(bool& is_null) final; |
| 41 |
| 42 // IDL API implementation. |
| 43 Element* scrollSource(); |
| 44 String orientation(); |
| 45 void timeRange(DoubleOrScrollTimelineAutoKeyword&); |
| 46 |
| 47 DECLARE_VIRTUAL_TRACE(); |
| 48 |
| 49 private: |
| 50 ScrollTimeline(const Document&, Element*, ScrollDirection, double); |
| 51 |
| 52 Member<Element> scroll_source_; |
| 53 ScrollDirection orientation_; |
| 54 double time_range_; |
| 55 }; |
| 56 |
| 57 } // namespace blink |
| 58 |
| 59 #endif |
OLD | NEW |