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

Unified Diff: LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html

Issue 670833002: Early out if the scroll position passed in by js is NaN (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 6 years, 2 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
« no previous file with comments | « no previous file | LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html
diff --git a/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html b/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html
new file mode 100644
index 0000000000000000000000000000000000000000..7c248df7772e42d7467047ee09e6a2847fdfbb3c
--- /dev/null
+++ b/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html
@@ -0,0 +1,59 @@
+<!DOCTYPE HTML>
+<style>
+
+body {
+ height: 30000px;
+ width: 30000px;
+}
+
+.spacer {
+ height: 1000px;
+ width: 1000px;
+}
+
+#scroller {
+ height: 100px;
+ width: 100px;
+ overflow: scroll;
+}
+</style>
+
+<div id=scroller>
+ <div class=spacer></div>
+</div>
+
+<script src="../../resources/js-test.js"></script>
+<script>
+description("Verifies that nan scroll position works correctly.");
+
+function scroll()
+{
+ window.scrollTo(1, 1);
+ shouldBe('window.scrollY', "1");
+ shouldBe('window.scrollX', "1");
+
+ window.scrollTo(window.NaN, window.NaN);
+ shouldBe('window.scrollY', "1");
+ shouldBe('window.scrollX', "1");
+
+ window.scrollBy(window.NaN, window.NaN);
+ shouldBe('window.scrollY', "1");
+ shouldBe('window.scrollX', "1");
+
+ scroller.scrollTop = 1;
+ shouldBe("scroller.scrollTop", "1");
+ scroller.scrollTop = window.NaN;
+ shouldBe("scroller.scrollTop", "1");
+
+ scroller.scrollLeft = 1;
+ shouldBe("scroller.scrollLeft", "1");
+ scroller.scrollLeft = window.NaN;
+ shouldBe("scroller.scrollLeft", "1");
+}
+
+onload = function() {
+ if (window.eventSender)
+ scroll();
+}
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698