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

Unified Diff: third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime-nan.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime-nan.html
diff --git a/third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime-nan.html b/third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime-nan.html
new file mode 100644
index 0000000000000000000000000000000000000000..1cebc9d99a261aa0bb853e3a37f69cf1c545920f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime-nan.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<style>
+.scroller {
+ height: 100px;
+ width: 100px;
+ overflow: auto;
+}
+
+.content {
+ height: 500px;
+ width: 500px;
+}
+</style>
+
+<script src='../../../resources/testharness.js'></script>
+<script src='../../../resources/testharnessreport.js'></script>
+
+<div id='inlineScroller' class='scroller' style='display: inline;'>
+ <div class='content'></div>
+</div>
+<script>
+test(function() {
+ const scroller = document.querySelector('#inlineScroller');
+ const scrollTimeline = new ScrollTimeline(
+ { scrollSource: scroller, timeRange: 100, orientation: 'block' });
+
+ assert_equals(scrollTimeline.currentTime, NaN);
+}, 'currentTime returns NaN for a display: inline scrollSource');
+</script>
+
+<div id='displayNoneScroller' class='scroller' style='display: none;'>
+ <div class='content'></div>
+</div>
+<script>
+test(function() {
+ const scroller = document.querySelector('#displayNoneScroller');
+ const scrollTimeline = new ScrollTimeline(
+ { scrollSource: scroller, timeRange: 100, orientation: 'block' });
+
+ assert_equals(scrollTimeline.currentTime, NaN);
+}, 'currentTime returns NaN for a display: none scrollSource');
+</script>
+
+<script>
+test(function() {
+ const scroller = document.createElement('div');
+ const content = document.createElement('div');
+
+ scroller.style.overflow = 'auto';
+ scroller.style.height = '100px';
+ scroller.style.width = '100px';
+ content.style.height = '250px';
+ content.style.width = '250px';
+
+ scroller.appendChild(content);
+
+ const scrollTimeline = new ScrollTimeline(
+ { scrollSource: scroller, timeRange: 100, orientation: 'block' });
+
+ assert_equals(scrollTimeline.currentTime, NaN);
+}, 'currentTime returns NaN for an unattached scrollSource');
+</script>
+
+<div id='notAScroller' class='scroller' style='overflow: visible;'>
+ <div class='content'></div>
+</div>
+<script>
+test(function() {
+ const scroller = document.querySelector('#notAScroller');
+ const scrollTimeline = new ScrollTimeline(
+ { scrollSource: scroller, timeRange: 100, orientation: 'block' });
+
+ assert_equals(scrollTimeline.currentTime, NaN);
+}, 'currentTime returns NaN when the scrollSource is not a scroller');
+</script>

Powered by Google App Engine
This is Rietveld 408576698