| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <head> | 2 <head> |
| 3 <style type="text/css"> | 3 <style type="text/css"> |
| 4 #scrollable { | 4 #scrollable { |
| 5 height: 200px; | 5 height: 200px; |
| 6 overflow: auto; | 6 overflow: auto; |
| 7 border: solid 3px #cc0000; | 7 border: solid 3px #cc0000; |
| 8 font-size: 80px; | 8 font-size: 80px; |
| 9 } | 9 } |
| 10 </style> | 10 </style> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 function recordScroll2(e) | 63 function recordScroll2(e) |
| 64 { | 64 { |
| 65 autoscrollTestPart2(); | 65 autoscrollTestPart2(); |
| 66 iframeDocument.removeEventListener("scroll", recordScroll); | 66 iframeDocument.removeEventListener("scroll", recordScroll); |
| 67 } | 67 } |
| 68 | 68 |
| 69 function autoscrollTestPart1() | 69 function autoscrollTestPart1() |
| 70 { | 70 { |
| 71 if (iframe.contentDocument.body.scrollTop == 0) { | 71 if (iframe.contentDocument.scrollingElement.scrollTop == 0) { |
| 72 testFailed("Autoscroll should have scrolled the iframe downwards, but di
d not"); | 72 testFailed("Autoscroll should have scrolled the iframe downwards, but di
d not"); |
| 73 finishTest(); | 73 finishTest(); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 | 76 |
| 77 testPassed("Autoscroll should have scrolled the iframe downwards, and did.")
; | 77 testPassed("Autoscroll should have scrolled the iframe downwards, and did.")
; |
| 78 | 78 |
| 79 middleTermScrollOffset = iframe.contentDocument.body.scrollTop; | 79 middleTermScrollOffset = iframe.contentDocument.scrollingElement.scrollTop; |
| 80 iframeDocument.addEventListener("scroll", recordScroll2); | 80 iframeDocument.addEventListener("scroll", recordScroll2); |
| 81 | 81 |
| 82 // Move mouse to the upper autoscroll border belt. | 82 // Move mouse to the upper autoscroll border belt. |
| 83 y = iframe.offsetTop + 10; | 83 y = iframe.offsetTop + 10; |
| 84 eventSender.mouseMoveTo(x, y); | 84 eventSender.mouseMoveTo(x, y); |
| 85 } | 85 } |
| 86 | 86 |
| 87 function autoscrollTestPart2() | 87 function autoscrollTestPart2() |
| 88 { | 88 { |
| 89 shouldBeTrue("iframe.contentDocument.body.scrollTop < middleTermScrollOffset
") | 89 shouldBeTrue("iframe.contentDocument.scrollingElement.scrollTop < middleTerm
ScrollOffset") |
| 90 finishTest(); | 90 finishTest(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 function finishTest() | 93 function finishTest() |
| 94 { | 94 { |
| 95 eventSender.mouseUp(); | 95 eventSender.mouseUp(); |
| 96 document.body.removeChild(iframe); | 96 document.body.removeChild(iframe); |
| 97 finishJSTest(); | 97 finishJSTest(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 description('Check autoscroll within an inner frame by drag-and-drop'); | 100 description('Check autoscroll within an inner frame by drag-and-drop'); |
| 101 window.jsTestIsAsync = true; | 101 window.jsTestIsAsync = true; |
| 102 window.onload = setUpTest; | 102 window.onload = setUpTest; |
| 103 </script> | 103 </script> |
| 104 <iframe id="scrollable" src="data:text/html, | 104 <iframe id="scrollable" src="data:text/html, |
| 105 <p id='draggable' draggable='true' style='cursor: hand;'> | 105 <p id='draggable' draggable='true' style='cursor: hand;'> |
| 106 <b>Drag me!</b> | 106 <b>Drag me!</b> |
| 107 </p> | 107 </p> |
| 108 Try to drag and drop the text above in the input element at the bottom of this i
frame. It should scroll. Then, try the way back. | 108 Try to drag and drop the text above in the input element at the bottom of this i
frame. It should scroll. Then, try the way back. |
| 109 <br><br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>
more<br>more<br>more<br><input> | 109 <br><br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>
more<br>more<br>more<br><input> |
| 110 "></iframe> | 110 "></iframe> |
| 111 </body> | 111 </body> |
| OLD | NEW |