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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/SmoothScrollSequencer.h

Issue 2650343008: Implement Element.scrollIntoView for scroll-behavior: smooth. (Closed)
Patch Set: Change the default setting. 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 (c) 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 #ifndef SmoothScrollSequencer_h
5 #define SmoothScrollSequencer_h
6
7 #include <utility>
8 #include "platform/heap/Handle.h"
9 #include "platform/scroll/ScrollTypes.h"
10
11 namespace blink {
12
13 class ScrollableArea;
14
15 // A sequencer that queues the nested scrollers from inside to outside,
16 // so that they can be animated from outside to inside when smooth scroll
17 // is called.
18 class PLATFORM_EXPORT SmoothScrollSequencer final
19 : public GarbageCollected<SmoothScrollSequencer> {
20 public:
21 SmoothScrollSequencer();
22 // Add a scroll offset animation to the back of a queue.
23 void QueueAnimation(ScrollableArea*, ScrollOffset);
24
25 // Run the animation at the back of the queue.
26 void RunQueuedAnimations();
27
28 // Abort the currently running animation and all the animations in the queue.
29 void AbortAnimations();
30
31 DECLARE_TRACE();
32
33 private:
34 typedef std::pair<Member<ScrollableArea>, ScrollOffset> ScrollerAndOffsetPair;
35 HeapVector<ScrollerAndOffsetPair> queue_;
36 Member<ScrollableArea> current_scrollable_;
37 };
38
39 } // namespace blink
40
41 #endif // SmoothScrollSequencer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698