Index: LayoutTests/fast/scroll-behavior/main-frame-scroll-in-quirks-mode.html |
diff --git a/LayoutTests/fast/scroll-behavior/main-frame-scroll-in-quirks-mode.html b/LayoutTests/fast/scroll-behavior/main-frame-scroll-in-quirks-mode.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bbf45c5590617d2af73668231842d9a4a2f9d63d |
--- /dev/null |
+++ b/LayoutTests/fast/scroll-behavior/main-frame-scroll-in-quirks-mode.html |
@@ -0,0 +1,68 @@ |
+<html> |
+<head> |
+ <style> |
+ #content { |
+ width: 7500px; |
+ height: 7500px; |
+ background-color: blue; |
+ } |
+ </style> |
+ <script src="../../resources/js-test.js"></script> |
+ <script> |
+ onload = function() { |
+ description('Test that calling scroll methods on the body element scrolls the viewport in quirks mode'); |
+ |
+ debug('Test that "scroll" on the document element does not scroll'); |
+ document.documentElement.scroll(100, 100); |
+ shouldBe("document.documentElement.scrollTop", "0"); |
+ shouldBe("document.documentElement.scrollLeft", "0"); |
+ shouldBe("document.body.scrollTop", "0"); |
+ shouldBe("document.body.scrollLeft", "0"); |
+ |
+ debug(''); |
+ debug('Test that "scrollTo" on the document element does not scroll'); |
+ document.documentElement.scrollTo(100, 100); |
+ shouldBe("document.documentElement.scrollTop", "0"); |
+ shouldBe("document.documentElement.scrollLeft", "0"); |
+ shouldBe("document.body.scrollTop", "0"); |
+ shouldBe("document.body.scrollLeft", "0"); |
+ |
+ debug(''); |
+ debug('Test that "scrollBy" on the document element does not scroll'); |
+ document.documentElement.scrollBy(100, 100); |
+ shouldBe("document.documentElement.scrollTop", "0"); |
+ shouldBe("document.documentElement.scrollLeft", "0"); |
+ shouldBe("document.body.scrollTop", "0"); |
+ shouldBe("document.body.scrollLeft", "0"); |
+ |
+ debug(''); |
+ debug('Test that "scroll" on the body element scrolls'); |
+ document.body.scroll(50, 100); |
+ shouldBe("document.documentElement.scrollTop", "0"); |
+ shouldBe("document.documentElement.scrollLeft", "0"); |
+ shouldBe("document.body.scrollTop", "100"); |
+ shouldBe("document.body.scrollLeft", "50"); |
+ |
+ debug(''); |
+ debug('Test that "scrollTo" on the body element scrolls'); |
+ document.body.scrollTo(450, 200); |
+ shouldBe("document.documentElement.scrollTop", "0"); |
+ shouldBe("document.documentElement.scrollLeft", "0"); |
+ shouldBe("document.body.scrollTop", "200"); |
+ shouldBe("document.body.scrollLeft", "450"); |
+ |
+ debug(''); |
+ debug('Test that "scrollBy" on the body element scrolls'); |
+ document.body.scrollBy(300, 100); |
+ shouldBe("document.documentElement.scrollTop", "0"); |
+ shouldBe("document.documentElement.scrollLeft", "0"); |
+ shouldBe("document.body.scrollTop", "300"); |
+ shouldBe("document.body.scrollLeft", "750"); |
+ } |
+ </script> |
+</head> |
+ |
+<body> |
+ <div id="content"></div> |
+</body> |
+</html> |