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

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 7 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 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..0c6042334d330ef3314e3665368f3f9fa61e60f8
--- /dev/null
+++ b/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+ <head>
+ <script src="../../js/resources/js-test-pre.js"></script>
+ <script>
+ var count = 0;
+ var iframeStrict1, iframeStrict2, iframeStrict3, iframeStrict4;
+ var iframeQuirks1, iframeQuirks2, iframeQuirks3, iframeQuriks4;
+ function verifyTest() {
+ // Need to wait on both 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>
Julien - ping for review 2013/11/01 16:49:15 Description, condition for passing?
+ <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>
Julien - ping for review 2013/11/01 16:49:15 Does this single file with all the extra resources
+ <script src="../../js/resources/js-test-post.js"></script>
+ </body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698