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

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

Issue 2873493002: Basic ScrollTimeline implementation for Animation Worklet (Closed)
Patch Set: Rebase Created 3 years, 6 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 class CORE_EXPORT ScrollTimeline final : public AnimationTimeline {
18 DEFINE_WRAPPERTYPEINFO();
19
20 public:
21 enum ScrollDirection {
22 Block,
23 Inline,
24 };
25
26 static ScrollTimeline* Create(Document&,
27 ScrollTimelineOptions,
28 ExceptionState&);
29
30 // AnimationTimeline overrides.
31 // TODO(smcgruer): We shouldn't have to override this many methods. Instead,
32 // DocumentTimeline should own the |CurrentTimeInternal| methods so that we
33 // only have to override |currentTime|.
alancutter (OOO until 2018) 2017/06/08 05:00:31 I agree with this for all the code in AnimationTim
34 double currentTime(bool& is_null) override;
35 double currentTime() override;
36 double CurrentTimeInternal(bool& is_null) override;
37 double CurrentTimeInternal() override;
38
39 // IDL API implementation.
40 Element* scrollSource();
41 String orientation();
42 void timeRange(DoubleOrScrollTimelineAutoKeyword&);
43
44 DECLARE_VIRTUAL_TRACE();
45
46 private:
47 ScrollTimeline(const Document&, Element*, ScrollDirection, double);
48
49 Member<Element> scroll_source_;
50 ScrollDirection orientation_;
51 double time_range_;
52 };
53
54 } // namespace blink
55
56 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698