Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: third_party/WebKit/Source/core/animation/ScrollTimeline.h

Issue 2873493002: Basic ScrollTimeline implementation for Animation Worklet (Closed)
Patch Set: Switch back to RuntimeEnabled, fix nits Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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.
alancutter (OOO until 2018) 2017/07/04 04:13:41 It's worth adding the spec link here since it's di
smcgruer 2017/07/04 13:48:53 Done.
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;
alancutter (OOO until 2018) 2017/07/04 04:13:41 Let's use the final keyword here and save override
smcgruer 2017/07/04 13:48:53 Done.
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698