| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <style> | 4 <style> |
| 5 #container { | 5 #container { |
| 6 width: 200px; | 6 width: 200px; |
| 7 height: 200px; | 7 height: 200px; |
| 8 overflow: scroll; | 8 overflow: scroll; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 function jsScroll(testCase) { | 28 function jsScroll(testCase) { |
| 29 var element = document.getElementById("container"); | 29 var element = document.getElementById("container"); |
| 30 if (testCase.js) { | 30 if (testCase.js) { |
| 31 element.scrollTop = {y: testCase.y, behavior: testCase.js}; | 31 element.scrollTop = {y: testCase.y, behavior: testCase.js}; |
| 32 } else { | 32 } else { |
| 33 element.scrollTop = testCase.y; | 33 element.scrollTop = testCase.y; |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 const testScrolls = [ | 37 const testScrolls = [ |
| 38 {js: "instant", css: "instant", x: 0, y: 2}, | 38 {js: "instant", css: "auto", x: 0, y: 2}, |
| 39 {js: "instant", css: "smooth", x: 0, y: 3}, | 39 {js: "instant", css: "smooth", x: 0, y: 3}, |
| 40 {js: "auto", css: "instant", x: 0, y: 4}, | 40 {js: "auto", css: "auto", x: 0, y: 4}, |
| 41 {js: "", css: "instant", x: 0, y: 5}, | 41 {js: "", css: "auto", x: 0, y: 5}, |
| 42 {js: "smooth", css: "instant", waitForEnd: true, x: 0, y: 15}, | 42 {js: "smooth", css: "auto", waitForEnd: true, x: 0, y: 15}, |
| 43 {js: "smooth", css: "smooth", waitForEnd: true, x: 0, y: 25}, | 43 {js: "smooth", css: "smooth", waitForEnd: true, x: 0, y: 25}, |
| 44 {js: "auto", css: "smooth", waitForEnd: true, x: 0, y: 35}, | 44 {js: "auto", css: "smooth", waitForEnd: true, x: 0, y: 35}, |
| 45 {js: "", css: "smooth", waitForEnd: true, x: 0, y: 45}, | 45 {js: "", css: "smooth", waitForEnd: true, x: 0, y: 45}, |
| 46 {js: "smooth", css: "instant", waitForEnd: false, x: 0, y: 4100}, | 46 {js: "smooth", css: "auto", waitForEnd: false, x: 0, y: 4100}, |
| 47 {js: "smooth", css: "smooth", waitForEnd: false, x: 0, y: 20}, | 47 {js: "smooth", css: "smooth", waitForEnd: false, x: 0, y: 20}, |
| 48 {js: "auto", css: "smooth", waitForEnd: false, x: 0, y: 4000}, | 48 {js: "auto", css: "smooth", waitForEnd: false, x: 0, y: 4000}, |
| 49 {js: "", css: "smooth", waitForEnd: false, x: 0, y: 5}, | 49 {js: "", css: "smooth", waitForEnd: false, x: 0, y: 5}, |
| 50 ]; | 50 ]; |
| 51 | 51 |
| 52 function doTest() | 52 function doTest() |
| 53 { | 53 { |
| 54 var testCases = []; | 54 var testCases = []; |
| 55 for (var i = 0; i < testScrolls.length; i++) { | 55 for (var i = 0; i < testScrolls.length; i++) { |
| 56 testCases.push(new ScrollBehaviorTestCase(testScrolls[i])); | 56 testCases.push(new ScrollBehaviorTestCase(testScrolls[i])); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 69 </script> | 69 </script> |
| 70 </head> | 70 </head> |
| 71 | 71 |
| 72 <body> | 72 <body> |
| 73 <p>Test that setting scrollTop on an overflow:scroll element works with both s
croll behaviors</p> | 73 <p>Test that setting scrollTop on an overflow:scroll element works with both s
croll behaviors</p> |
| 74 <div id="container"> | 74 <div id="container"> |
| 75 <div id="content"></div> | 75 <div id="content"></div> |
| 76 </div> | 76 </div> |
| 77 </body> | 77 </body> |
| 78 </html> | 78 </html> |
| OLD | NEW |