Index: LayoutTests/fast/scroll-behavior/subframe-scrollLeft.html |
diff --git a/LayoutTests/fast/scroll-behavior/subframe-scrollLeft.html b/LayoutTests/fast/scroll-behavior/subframe-scrollLeft.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6a1ddec6d8a53a89b2166a77fd7fe768a7dc1994 |
--- /dev/null |
+++ b/LayoutTests/fast/scroll-behavior/subframe-scrollLeft.html |
@@ -0,0 +1,71 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <style> |
+ #subframe { |
+ width: 200px; |
+ height: 200px; |
+ } |
+ </style> |
+ <script src="../../resources/testharness.js"></script> |
+ <script src="../../resources/testharnessreport.js"></script> |
+ <script src="resources/scroll-behavior-test.js"></script> |
+ <script type="text/javascript"> |
+ const instantScrolls = [ |
+ {js: "instant", css: "instant", x: 1}, |
+ {js: "instant", css: "smooth", x: 2}, |
+ {js: "auto", css: "instant", x: 3}, |
+ {js: "", css: "instant", x: 4} |
+ ]; |
+ |
+ const smoothScrolls = [ |
+ {js: "smooth", css: "instant", waitForEnd: true, x: 10}, |
+ {js: "smooth", css: "smooth", waitForEnd: true, x: 20}, |
+ {js: "auto", css: "smooth", waitForEnd: true, x: 30}, |
+ {js: "", css: "smooth", waitForEnd: true, x: 40}, |
+ {js: "smooth", css: "instant", waitForEnd: false, x: 4000}, |
+ {js: "smooth", css: "smooth", waitForEnd: false, x: 15}, |
+ {js: "auto", css: "smooth", waitForEnd: false, x: 4100}, |
+ {js: "", css: "smooth", waitForEnd: false, x: 10}, |
+ ]; |
+ |
+ function runTestCase(testCase) |
+ { |
+ var subframeDocumentElement = document.getElementById("subframe").contentDocument.documentElement; |
+ if (testCase.js) |
+ subframeDocumentElement.scrollLeft = {x: testCase.x, behavior: testCase.js}; |
+ else |
+ subframeDocumentElement.scrollLeft = testCase.x; |
+ } |
+ |
+ function endX(testCase) |
+ { |
+ return testCase.x; |
+ } |
+ |
+ function endY(testCase, startY) |
+ { |
+ return startY; |
+ } |
+ |
+ function doTest() |
+ { |
+ var subframe = document.getElementById("subframe"); |
+ runScrollBehaviorTests(subframe.contentDocument.documentElement, |
+ subframe.contentDocument, |
+ instantScrolls, |
+ smoothScrolls, |
+ runTestCase, |
+ endX, |
+ endY); |
+ } |
+ |
+ window.addEventListener('load', doTest, false); |
+ </script> |
+</head> |
+ |
+<body> |
+ <p>Test that setting scrollLeft on a subframe works with both scroll behaviors</p> |
+ <iframe id="subframe" src="resources/large-subframe.html"></iframe> |
+</body> |
+</html> |