Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / scrolling / scrolling-apis-nan-scroll-position.html
1 <!DOCTYPE HTML>
2 <style>
3
4 body {
5   height: 30000px;
6   width: 30000px;
7 }
8
9 .spacer {
10   height: 1000px;
11   width: 1000px;
12 }
13
14 #scroller {
15   height: 100px;
16   width: 100px;
17   overflow: scroll;
18 }
19 </style>
20
21 <div id=scroller>
22     <div class=spacer></div>
23 </div>
24
25 <script src="../../resources/js-test.js"></script>
26 <script>
27 description("Verifies that nan scroll position works correctly.");
28
29 function scroll()
30 {
31     window.scrollTo(1, 1);
32     shouldBe('window.scrollY', "1");
33     shouldBe('window.scrollX', "1");
34
35     window.scrollTo(window.NaN, window.NaN);
36     shouldBe('window.scrollY', "1");
37     shouldBe('window.scrollX', "1");
38
39     window.scrollBy(window.NaN, window.NaN);
40     shouldBe('window.scrollY', "1");
41     shouldBe('window.scrollX', "1");
42
43     scroller.scrollTop = 1;
44     shouldBe("scroller.scrollTop", "1");
45     scroller.scrollTop = window.NaN;
46     shouldBe("scroller.scrollTop", "1");
47
48     scroller.scrollLeft = 1;
49     shouldBe("scroller.scrollLeft", "1");
50     scroller.scrollLeft = window.NaN;
51     shouldBe("scroller.scrollLeft", "1");
52 }
53
54 onload = function() {
55     if (window.eventSender)
56       scroll();
57 }
58
59 </script>