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 class CORE_EXPORT ScrollTimeline final : public AnimationTimeline { |
| 25 DEFINE_WRAPPERTYPEINFO(); |
| 26 |
| 27 public: |
| 28 enum ScrollDirection { |
| 29 Block, |
| 30 Inline, |
| 31 }; |
| 32 |
| 33 static ScrollTimeline* Create(Document&, |
| 34 ScrollTimelineOptions, |
| 35 ExceptionState&); |
| 36 |
| 37 // AnimationTimeline implementation. |
| 38 double currentTime(bool& is_null) override; |
| 39 |
| 40 // IDL API implementation. |
| 41 Element* scrollSource(); |
| 42 String orientation(); |
| 43 void timeRange(DoubleOrScrollTimelineAutoKeyword&); |
| 44 |
| 45 DECLARE_VIRTUAL_TRACE(); |
| 46 |
| 47 private: |
| 48 ScrollTimeline(const Document&, Element*, ScrollDirection, double); |
| 49 |
| 50 Member<Element> scroll_source_; |
| 51 ScrollDirection orientation_; |
| 52 double time_range_; |
| 53 }; |
| 54 |
| 55 } // namespace blink |
| 56 |
| 57 #endif |
OLD | NEW |