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

Side by Side Diff: LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body.html

Issue 51553002: Fix body.scrollTop/Left for scrollable <body> tags (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <script>
5 var count = 0;
6 var iframeStrict1, iframeStrict2, iframeStrict3, iframeStrict4;
7 var iframeQuirks1, iframeQuirks2, iframeQuirks3, iframeQuriks4;
8 function verifyTest() {
9 // Need to wait on all inner frames to load.
10 if (count++ < 7)
11 return;
12
13 description('Test for scrollTop/Left values of scrollable document.body in quirks and strict modes');
14
15 iframeStrict1 = document.getElementById("strict1");
16 iframeStrict2 = document.getElementById("strict2");
17 iframeStrict3 = document.getElementById("strict3");
18 iframeStrict4 = document.getElementById("strict4");
19 iframeQuirks1 = document.getElementById("quirks1");
20 iframeQuirks2 = document.getElementById("quirks2");
21 iframeQuirks3 = document.getElementById("quirks3");
22 iframeQuirks4 = document.getElementById("quirks4");
23
24 shouldBe("iframeStrict1.contentDocument.documentElement.scrollTop", "0") ;
25 shouldBe("iframeStrict1.contentDocument.documentElement.scrollLeft", "10 0");
26 shouldBe("iframeStrict1.contentDocument.body.scrollTop", "200");
27 shouldBe("iframeStrict1.contentDocument.body.scrollLeft", "0");
28 shouldBe("iframeStrict1.contentWindow.pageYOffset", "0");
29 shouldBe("iframeStrict1.contentWindow.pageXOffset", "100");
30
31 shouldBe("iframeQuirks1.contentDocument.documentElement.scrollTop", "0") ;
32 shouldBe("iframeQuirks1.contentDocument.documentElement.scrollLeft", "0" );
33 shouldBe("iframeQuirks1.contentDocument.body.scrollTop", "200");
34 shouldBe("iframeQuirks1.contentDocument.body.scrollLeft", "0");
35 shouldBe("iframeQuirks1.contentWindow.pageYOffset", "0");
36 shouldBe("iframeQuirks1.contentWindow.pageXOffset", "0");
37
38 shouldBe("iframeStrict2.contentDocument.documentElement.scrollTop", "0") ;
39 shouldBe("iframeStrict2.contentDocument.documentElement.scrollLeft", "10 0");
40 shouldBe("iframeStrict2.contentDocument.body.scrollTop", "0");
41 shouldBe("iframeStrict2.contentDocument.body.scrollLeft", "0");
42 shouldBe("iframeStrict2.contentWindow.pageYOffset", "0");
43 shouldBe("iframeStrict2.contentWindow.pageXOffset", "100");
44
45 shouldBe("iframeQuirks2.contentDocument.documentElement.scrollTop", "0") ;
46 shouldBe("iframeQuirks2.contentDocument.documentElement.scrollLeft", "0" );
47 shouldBe("iframeQuirks2.contentDocument.body.scrollTop", "0");
48 shouldBe("iframeQuirks2.contentDocument.body.scrollLeft", "0");
49 shouldBe("iframeQuirks2.contentWindow.pageYOffset", "0");
50 shouldBe("iframeQuirks2.contentWindow.pageXOffset", "0");
51
52 shouldBe("iframeStrict3.contentDocument.documentElement.scrollTop", "0") ;
53 shouldBe("iframeStrict3.contentDocument.documentElement.scrollLeft", "10 0");
54 shouldBe("iframeStrict3.contentDocument.body.scrollTop", "200");
55 shouldBe("iframeStrict3.contentDocument.body.scrollLeft", "0");
56 shouldBe("iframeStrict3.contentWindow.pageYOffset", "0");
57 shouldBe("iframeStrict3.contentWindow.pageXOffset", "100");
58
59 shouldBe("iframeQuirks3.contentDocument.documentElement.scrollTop", "0") ;
60 shouldBe("iframeQuirks3.contentDocument.documentElement.scrollLeft", "0" );
61 shouldBe("iframeQuirks3.contentDocument.body.scrollTop", "200");
62 shouldBe("iframeQuirks3.contentDocument.body.scrollLeft", "0");
63 shouldBe("iframeQuirks3.contentWindow.pageYOffset", "0");
64 shouldBe("iframeQuirks3.contentWindow.pageXOffset", "0");
65
66 shouldBe("iframeStrict4.contentDocument.body.scrollTop", "0");
67 shouldBe("iframeStrict4.contentDocument.body.scrollLeft", "0");
68
69 shouldBe("iframeQuirks4.contentDocument.body.scrollTop", "0");
70 shouldBe("iframeQuirks4.contentDocument.body.scrollLeft", "0");
71
72 finishJSTest();
73 }
74 var jsTestIsAsync = true;
75 </script>
76 </head>
77 <body>
78 <iframe id="strict1" src="resources/overflow-scroll-scrollable-body-strict.h tml"></iframe>
79 <iframe id="quirks1" src="resources/overflow-scroll-scrollable-body-quirks.h tml"></iframe>
80 <iframe id="strict2" src="resources/overflow-scroll-non-scrollable-body-stri ct.html"></iframe>
81 <iframe id="quirks2" src="resources/overflow-scroll-non-scrollable-body-quir ks.html"></iframe>
82 <iframe id="strict3" src="resources/overflow-hidden-scrollable-body-strict.h tml"></iframe>
83 <iframe id="quirks3" src="resources/overflow-hidden-scrollable-body-quirks.h tml"></iframe>
84 <iframe id="strict4" src="resources/display-none-body-strict.html"></iframe>
85 <iframe id="quirks4" src="resources/display-none-body-quirks.html"></iframe>
86 </body>
87 </html>
88
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698