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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <style>
3 .spacer {
4 height: 1000px;
5 width: 1000px;
6 }
7
8 #scroller {
9 height: 100px;
10 width: 100px;
11 overflow: scroll;
12 }
13 </style>
14
15 <body style="width:30000px;height:30000px" onload="runTest()">
Rick Byers 2014/10/22 13:55:33 nit: omit body tag (put style in CSS and see below
Yufeng Shen (Slow to review) 2014/10/22 17:38:46 Done.
16 <div id=scroller>
17 <div class=spacer></div>
18 </div>
19 </body>
20
21 <script src="../../resources/js-test.js"></script>
22 <script>
23 description("Verifies that nan scroll position works correctly.");
24
25 function scroll()
26 {
27 window.scrollTo(1, 1);
28 shouldBe('window.scrollY', "1");
29 shouldBe('window.scrollX', "1");
30
31 window.scrollTo(window.NaN, window.NaN);
32 shouldBe('window.scrollY', "1");
33 shouldBe('window.scrollX', "1");
34
35 window.scrollBy(window.NaN, window.NaN);
36 shouldBe('window.scrollY', "1");
37 shouldBe('window.scrollX', "1");
38
39 scroller.scrollTop = 1;
40 shouldBe("scroller.scrollTop", "1");
41 scroller.scrollTop = window.NaN;
42 shouldBe("scroller.scrollTop", "1");
43
44 scroller.scrollLeft = 1;
45 shouldBe("scroller.scrollLeft", "1");
46 scroller.scrollLeft = window.NaN;
47 shouldBe("scroller.scrollLeft", "1");
48 }
49
50 function runTest()
Rick Byers 2014/10/22 13:55:33 to avoid needing <body onload=runTest> use just: o
Yufeng Shen (Slow to review) 2014/10/22 17:38:46 Done.
51 {
52 if (window.eventSender)
53 scroll();
54 }
55
56 </script>
57 </html>
Rick Byers 2014/10/22 13:55:33 nit: omit </html> (you have no <html> tag)
Yufeng Shen (Slow to review) 2014/10/22 17:38:46 Done.
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position-expected.txt » ('j') | Source/core/dom/Element.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698