Index: LayoutTests/fast/scroll-behavior/listbox-interrupted-scroll.html |
diff --git a/LayoutTests/fast/scroll-behavior/listbox-interrupted-scroll.html b/LayoutTests/fast/scroll-behavior/listbox-interrupted-scroll.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a821fc35133e3e8cd2f710c04ffe439857362167 |
--- /dev/null |
+++ b/LayoutTests/fast/scroll-behavior/listbox-interrupted-scroll.html |
@@ -0,0 +1,48 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <script src="../../resources/testharness.js"></script> |
+ <script src="../../resources/testharnessreport.js"></script> |
+ <script src="resources/scroll-interruption-test.js"></script> |
+ <script type="text/javascript"> |
+ const numItems = 500; |
+ |
+ function initializeContents(listbox) |
+ { |
+ for (var i = 0; i < numItems; i++) { |
+ var option = document.createElement("option"); |
+ option.appendChild(document.createTextNode(i)); |
+ listbox.appendChild(option); |
+ } |
+ } |
+ |
+ function initializeTestCase(testCase, innerPoint, listbox) |
+ { |
+ var itemHeight = (listbox.scrollHeight - listbox.clientHeight) / (numItems - listbox.size); |
+ var boundingRect = listbox.getBoundingClientRect(); |
+ innerPoint.x = (boundingRect.left + boundingRect.right)/2; |
+ innerPoint.y = (boundingRect.top + boundingRect.bottom)/2; |
+ testCase.y1 = testCase.index1 * itemHeight; |
+ testCase.y2 = testCase.index2 * itemHeight; |
+ testCase.y3 = testCase.index3 * itemHeight; |
+ } |
+ |
+ function doTest() |
+ { |
+ var testCase = {index1: 3, index2: 200, index3: 1}; |
+ var innerPoint = {x:0, y:0 }; |
Ian Vollick
2014/02/06 16:02:31
Nit: extra space.
|
+ var element = document.getElementById("listbox"); |
+ initializeContents(element); |
+ initializeTestCase(testCase, innerPoint, element); |
+ runScrollInterruptionTests(element, testCase, innerPoint); |
+ } |
+ |
+ window.addEventListener('load', doTest, false); |
+ </script> |
+</head> |
+ |
+<body> |
+ <p>Test that interrupting a smooth scroll on a listbox works with both scroll behaviors and with input</p> |
+ <select size="4" id="listbox"></select> |
+</body> |
+</html> |