| OLD | NEW |
| 1 function offsetFromViewportTop(element) | 1 function offsetFromViewportTop(element) |
| 2 { | 2 { |
| 3 return element.getClientRects()[0].top; | 3 return element.getClientRects()[0].top; |
| 4 } | 4 } |
| 5 | 5 |
| 6 function offsetOfMiddleFromViewportTop(element) | 6 function offsetOfMiddleFromViewportTop(element) |
| 7 { | 7 { |
| 8 return element.getClientRects()[0].top + Math.round(element.getClientRects()
[0].height / 2); | 8 return element.getClientRects()[0].top + Math.round(element.getClientRects()
[0].height / 2); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 "PASS" : | 37 "PASS" : |
| 38 "FAIL<br>viewportMiddle: " + viewportMiddle + ", offsetOfInput: " + off
setOfInput); | 38 "FAIL<br>viewportMiddle: " + viewportMiddle + ", offsetOfInput: " + off
setOfInput); |
| 39 } | 39 } |
| 40 | 40 |
| 41 function performVerticalScrollingTest() | 41 function performVerticalScrollingTest() |
| 42 { | 42 { |
| 43 var initialOffset = offsetFromViewportTop(document.body.children[0]); | 43 var initialOffset = offsetFromViewportTop(document.body.children[0]); |
| 44 document.getElementById("input").focus(); | 44 document.getElementById("input").focus(); |
| 45 if (window.eventSender) { | 45 if (window.eventSender) { |
| 46 while (offsetFromViewportTop(document.body.children[0]) < initialOffset) | 46 while (offsetFromViewportTop(document.body.children[0]) < initialOffset) |
| 47 eventSender.keyDown("pageUp"); | 47 eventSender.keyDown("PageUp"); |
| 48 return true; | 48 return true; |
| 49 } | 49 } |
| 50 return false; | 50 return false; |
| 51 } | 51 } |
| 52 | 52 |
| 53 function performVerticalScrollingInputTest() | 53 function performVerticalScrollingInputTest() |
| 54 { | 54 { |
| 55 if (performVerticalScrollingTest()) | 55 if (performVerticalScrollingTest()) |
| 56 eventSender.keyDown("a"); | 56 eventSender.keyDown("a"); |
| 57 } | 57 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 81 jumpDetected = true; | 81 jumpDetected = true; |
| 82 break; | 82 break; |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 if (!jumpDetected) | 85 if (!jumpDetected) |
| 86 document.write("PASS"); | 86 document.write("PASS"); |
| 87 else | 87 else |
| 88 document.write("FAIL<br>Jump scroll from " + previousScrollTop + " t
o " + currentScrollTop); | 88 document.write("FAIL<br>Jump scroll from " + previousScrollTop + " t
o " + currentScrollTop); |
| 89 } | 89 } |
| 90 } | 90 } |
| OLD | NEW |