Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 
 
bokan
2017/05/19 19:35:57
Please add a copy of this test that uses event sen
 
sunyunjia
2017/05/25 20:07:10
Done.
 
 | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <div id='space1' style='height: 300px; width: 1000px'></div> | |
| 5 <div id='container' style='height: 400px; width: 500px; overflow: scroll;'> | |
| 6 <div id='red' style='height: 300px; width: 1000px; background-color: red'></di v> | |
| 7 <div id='blue' style='height: 300px; background-color: blue'></div> | |
| 8 </div> | |
| 9 <div id='space2' style='height: 1000px'></div> | |
| 10 | |
| 11 <script> | |
| 12 var container = document.getElementById('container'); | |
| 13 var test = async_test('scroll-boundary-behavior-y: none should only prevent over scroll propagation on y axis'); | |
| 
 
bokan
2017/05/19 19:35:57
overscroll typically refers to scrolling a fully s
 
sunyunjia
2017/05/25 20:07:10
Done.
 
 | |
| 14 container.style.scrollBoundaryBehaviorX = 'auto'; | |
| 15 container.style.scrollBoundaryBehaviorY = 'none'; | |
| 16 test.step(function () { | |
| 17 window.scrollBy(100, 100); | |
| 18 assert_equals(window.scrollY, 100); | |
| 19 assert_equals(window.scrollX, 100); | |
| 20 chrome.gpuBenchmarking.smoothDrag(100, 400, 100, 500, | |
| 21 function() { | |
| 22 assert_equals(window.scrollY, 100); | |
| 23 chrome.gpuBenchmarking.smoothDrag(100, 400, 200, 400, | |
| 24 function() { | |
| 25 assert_less_than(window.scrollX, 100); | |
| 
 
bokan
2017/05/19 19:35:57
Make this assert_equals - if you're using less_tha
 
sunyunjia
2017/05/25 20:07:10
Done.
 
 | |
| 26 test_func1(); | |
| 27 test.done(); | |
| 28 }); | |
| 29 }); | |
| 30 }); | |
| 31 | |
| 32 function test_func1() { | |
| 33 var test1 = async_test('scroll-boundary-behavior-x: none should only prevent overscroll propagation on x axis'); | |
| 34 container.style.scrollBoundaryBehaviorX = 'none'; | |
| 35 container.style.scrollBoundaryBehaviorY = 'auto'; | |
| 36 window.scrollTo(0, 0); | |
| 37 container.scrollTo(0, 0); | |
| 38 test1.step(function () { | |
| 39 window.scrollBy(100, 100); | |
| 40 assert_equals(window.scrollY, 100); | |
| 41 assert_equals(window.scrollX, 100); | |
| 42 chrome.gpuBenchmarking.smoothDrag(100, 400, 200, 400, | |
| 43 function() { | |
| 44 assert_equals(window.scrollX, 100); | |
| 45 chrome.gpuBenchmarking.smoothDrag(100, 400, 100, 500, | |
| 46 function() { | |
| 47 assert_less_than(window.scrollY, 100); | |
| 48 test_func2(); | |
| 49 test1.done(); | |
| 50 }); | |
| 51 }); | |
| 52 }); | |
| 53 } | |
| 54 | |
| 55 function test_func2() { | |
| 56 var test2 = async_test('scroll-boundary-behavior should not affect scrolling i nside the applied container'); | |
| 57 container.style.scrollBoundaryBehaviorX = 'none'; | |
| 58 container.style.scrollBoundaryBehaviorY = 'none'; | |
| 59 window.scrollTo(0, 0); | |
| 60 container.scrollTo(0, 0); | |
| 61 test2.step(function () { | |
| 62 assert_equals(container.scrollTop, 0); | |
| 63 assert_equals(container.scrollLeft, 0); | |
| 64 chrome.gpuBenchmarking.smoothDrag(100, 400, 0, 300, | |
| 65 function() { | |
| 66 assert_greater_than(container.scrollTop, 0); | |
| 67 assert_greater_than(container.scrollLeft, 0); | |
| 68 test2.done(); | |
| 69 }); | |
| 70 }); | |
| 71 } | |
| 72 | |
| 73 </script> | |
| OLD | NEW |