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

Unified 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, 11 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
Index: LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body.html
diff --git a/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body.html b/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body.html
new file mode 100644
index 0000000000000000000000000000000000000000..b17cc7ae3a9a9fe3fe9bc48f72cb7354011d6b33
--- /dev/null
+++ b/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body.html
@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+ <head>
+ <script src="../../../resources/js-test.js"></script>
+ <script>
+ var count = 0;
+ var iframeStrict1, iframeStrict2, iframeStrict3, iframeStrict4;
+ var iframeQuirks1, iframeQuirks2, iframeQuirks3, iframeQuriks4;
+ function verifyTest() {
+ // Need to wait on all inner frames to load.
+ if (count++ < 7)
+ return;
+
+ description('Test for scrollTop/Left values of scrollable document.body in quirks and strict modes');
+
+ iframeStrict1 = document.getElementById("strict1");
+ iframeStrict2 = document.getElementById("strict2");
+ iframeStrict3 = document.getElementById("strict3");
+ iframeStrict4 = document.getElementById("strict4");
+ iframeQuirks1 = document.getElementById("quirks1");
+ iframeQuirks2 = document.getElementById("quirks2");
+ iframeQuirks3 = document.getElementById("quirks3");
+ iframeQuirks4 = document.getElementById("quirks4");
+
+ shouldBe("iframeStrict1.contentDocument.documentElement.scrollTop", "0");
+ shouldBe("iframeStrict1.contentDocument.documentElement.scrollLeft", "100");
+ shouldBe("iframeStrict1.contentDocument.body.scrollTop", "200");
+ shouldBe("iframeStrict1.contentDocument.body.scrollLeft", "0");
+ shouldBe("iframeStrict1.contentWindow.pageYOffset", "0");
+ shouldBe("iframeStrict1.contentWindow.pageXOffset", "100");
+
+ shouldBe("iframeQuirks1.contentDocument.documentElement.scrollTop", "0");
+ shouldBe("iframeQuirks1.contentDocument.documentElement.scrollLeft", "0");
+ shouldBe("iframeQuirks1.contentDocument.body.scrollTop", "200");
+ shouldBe("iframeQuirks1.contentDocument.body.scrollLeft", "0");
+ shouldBe("iframeQuirks1.contentWindow.pageYOffset", "0");
+ shouldBe("iframeQuirks1.contentWindow.pageXOffset", "0");
+
+ shouldBe("iframeStrict2.contentDocument.documentElement.scrollTop", "0");
+ shouldBe("iframeStrict2.contentDocument.documentElement.scrollLeft", "100");
+ shouldBe("iframeStrict2.contentDocument.body.scrollTop", "0");
+ shouldBe("iframeStrict2.contentDocument.body.scrollLeft", "0");
+ shouldBe("iframeStrict2.contentWindow.pageYOffset", "0");
+ shouldBe("iframeStrict2.contentWindow.pageXOffset", "100");
+
+ shouldBe("iframeQuirks2.contentDocument.documentElement.scrollTop", "0");
+ shouldBe("iframeQuirks2.contentDocument.documentElement.scrollLeft", "0");
+ shouldBe("iframeQuirks2.contentDocument.body.scrollTop", "0");
+ shouldBe("iframeQuirks2.contentDocument.body.scrollLeft", "0");
+ shouldBe("iframeQuirks2.contentWindow.pageYOffset", "0");
+ shouldBe("iframeQuirks2.contentWindow.pageXOffset", "0");
+
+ shouldBe("iframeStrict3.contentDocument.documentElement.scrollTop", "0");
+ shouldBe("iframeStrict3.contentDocument.documentElement.scrollLeft", "100");
+ shouldBe("iframeStrict3.contentDocument.body.scrollTop", "200");
+ shouldBe("iframeStrict3.contentDocument.body.scrollLeft", "0");
+ shouldBe("iframeStrict3.contentWindow.pageYOffset", "0");
+ shouldBe("iframeStrict3.contentWindow.pageXOffset", "100");
+
+ shouldBe("iframeQuirks3.contentDocument.documentElement.scrollTop", "0");
+ shouldBe("iframeQuirks3.contentDocument.documentElement.scrollLeft", "0");
+ shouldBe("iframeQuirks3.contentDocument.body.scrollTop", "200");
+ shouldBe("iframeQuirks3.contentDocument.body.scrollLeft", "0");
+ shouldBe("iframeQuirks3.contentWindow.pageYOffset", "0");
+ shouldBe("iframeQuirks3.contentWindow.pageXOffset", "0");
+
+ shouldBe("iframeStrict4.contentDocument.body.scrollTop", "0");
+ shouldBe("iframeStrict4.contentDocument.body.scrollLeft", "0");
+
+ shouldBe("iframeQuirks4.contentDocument.body.scrollTop", "0");
+ shouldBe("iframeQuirks4.contentDocument.body.scrollLeft", "0");
+
+ finishJSTest();
+ }
+ var jsTestIsAsync = true;
+ </script>
+ </head>
+ <body>
+ <iframe id="strict1" src="resources/overflow-scroll-scrollable-body-strict.html"></iframe>
+ <iframe id="quirks1" src="resources/overflow-scroll-scrollable-body-quirks.html"></iframe>
+ <iframe id="strict2" src="resources/overflow-scroll-non-scrollable-body-strict.html"></iframe>
+ <iframe id="quirks2" src="resources/overflow-scroll-non-scrollable-body-quirks.html"></iframe>
+ <iframe id="strict3" src="resources/overflow-hidden-scrollable-body-strict.html"></iframe>
+ <iframe id="quirks3" src="resources/overflow-hidden-scrollable-body-quirks.html"></iframe>
+ <iframe id="strict4" src="resources/display-none-body-strict.html"></iframe>
+ <iframe id="quirks4" src="resources/display-none-body-quirks.html"></iframe>
+ </body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698