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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-creation.html

Issue 2873493002: Basic ScrollTimeline implementation for Animation Worklet (Closed)
Patch Set: address reviewer 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <style>
3 .scroller {
4 height: 100px;
5 width: 100px;
6 overflow: scroll;
7 }
8
9 .content {
10 height: 500px;
11 width: 500px;
12 }
13 </style>
14
15 <div class='scroller'>
16 <div class='content'></div>
17 </div>
18
19 <script src='../../../resources/testharness.js'></script>
20 <script src='../../../resources/testharnessreport.js'></script>
21 <script>
22 test(function() {
23 const scroller = document.querySelector('.scroller');
24 const scrollTimeline = new ScrollTimeline(
25 { scrollSource: scroller, timeRange: 100, orientation: 'inline' });
26
27 assert_equals(scrollTimeline.scrollSource, scroller);
28 assert_equals(scrollTimeline.timeRange, 100);
29 assert_equals(scrollTimeline.orientation, 'inline');
30 }, 'Basic ScrollTimeline creation should work');
31
32 test(function() {
33 const scrollTimeline = new ScrollTimeline(
34 { timeRange: 100, orientation: 'block' });
35
36 assert_equals(scrollTimeline.scrollSource, document.scrollingElement);
37 }, 'If the scrollSource is unspecified, use the document scrollingElement');
38
39 test(function() {
40 const scroller = document.querySelector('.scroller');
41 const constructorFunc = function() { new ScrollTimeline(
42 { scrollSource: scroller, orientation: 'nonsense', timeRange: 100 }) };
43 assert_throws(TypeError(), constructorFunc);
44 }, 'If the orientation is invalid, object construction should fail');
45
46 // TODO(smcgruer): Remove once 'auto' timeRange is supported.
47 test(function() {
48 const scroller = document.querySelector('.scroller');
49 const constructorFunc = function() { new ScrollTimeline(
50 { scrollSource: scroller, orientation: 'block' }) };
51 assert_throws('NotSupportedError', constructorFunc);
52 }, 'If the timeRange is unspecified, object construction should fail');
53 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698