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

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

Issue 2873493002: Basic ScrollTimeline implementation for Animation Worklet (Closed)
Patch Set: Make document reference non-const Created 3 years, 7 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 Auto,
23 Block,
24 Inline,
25 };
26
27 static ScrollTimeline* Create(Document&,
28 ScrollTimelineOptions,
29 ExceptionState&);
30
31 // AnimationTimeline overrides.
32 // TODO(smcgruer): We shouldn't have to override this many methods. Instead,
33 // DocumentTimeline should own the |CurrentTimeInternal| methods so that we
34 // only have to override |currentTime|.
35 double currentTime(bool& is_null) override;
36 double currentTime() override;
37 double CurrentTimeInternal(bool& is_null) override;
38 double CurrentTimeInternal() 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698