| OLD | NEW |
| 1 <head> | 1 <head> |
| 2 <script src="../../resources/ahem.js"></script> | 2 <script src="../../resources/ahem.js"></script> |
| 3 <style type="text/css"> | 3 <style type="text/css"> |
| 4 .ahem { font: 20px Ahem; } | 4 .ahem { font: 20px Ahem; } |
| 5 </style> | 5 </style> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 if (window.testRunner) | 8 if (window.testRunner) |
| 9 testRunner.dumpAsText(); | 9 testRunner.dumpAsText(); |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 runScrollingTest("div", editable, offsets, function() { return editable.scro
llTop; }); | 48 runScrollingTest("div", editable, offsets, function() { return editable.scro
llTop; }); |
| 49 } | 49 } |
| 50 | 50 |
| 51 function runScrollingTest(testName, frame, offsets, scrollFunction) { | 51 function runScrollingTest(testName, frame, offsets, scrollFunction) { |
| 52 var tolerance = 0; | 52 var tolerance = 0; |
| 53 var modifiers = onMacPlatform ? ["altKey"] : []; | 53 var modifiers = onMacPlatform ? ["altKey"] : []; |
| 54 | 54 |
| 55 if (!window.eventSender) | 55 if (!window.eventSender) |
| 56 return; | 56 return; |
| 57 | 57 |
| 58 eventSender.keyDown("pageDown", modifiers); | 58 eventSender.keyDown("PageDown", modifiers); |
| 59 if (Math.abs(scrollFunction() - offsets[0]) > tolerance) { | 59 if (Math.abs(scrollFunction() - offsets[0]) > tolerance) { |
| 60 throw "Frame viewport should be around " + offsets[0] + | 60 throw "Frame viewport should be around " + offsets[0] + |
| 61 "px , not at " + scrollFunction(); | 61 "px , not at " + scrollFunction(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 eventSender.keyDown("pageDown", modifiers); | 64 eventSender.keyDown("PageDown", modifiers); |
| 65 if (Math.abs(scrollFunction() - offsets[1]) > tolerance) { | 65 if (Math.abs(scrollFunction() - offsets[1]) > tolerance) { |
| 66 throw "Frame viewport should be around " + offsets[1] + | 66 throw "Frame viewport should be around " + offsets[1] + |
| 67 "px , not " + scrollFunction(); | 67 "px , not " + scrollFunction(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 eventSender.keyDown("pageUp", modifiers); | 70 eventSender.keyDown("PageUp", modifiers); |
| 71 if (Math.abs(scrollFunction() - offsets[0]) > tolerance) { | 71 if (Math.abs(scrollFunction() - offsets[0]) > tolerance) { |
| 72 throw "Frame viewport should be around " + offsets[0] + | 72 throw "Frame viewport should be around " + offsets[0] + |
| 73 "px , not at " + scrollFunction(); | 73 "px , not at " + scrollFunction(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 document.getElementById("results").innerHTML += testName + " PASS<br/>"; | 76 document.getElementById("results").innerHTML += testName + " PASS<br/>"; |
| 77 } | 77 } |
| 78 </script> | 78 </script> |
| 79 </head> | 79 </head> |
| 80 <body onload="runTest()"> | 80 <body onload="runTest()"> |
| 81 <div>Page up/down (option+page up/down on Mac) should move the move cursor and s
croll the content | 81 <div>Page up/down (option+page up/down on Mac) should move the move cursor and s
croll the content |
| 82 in contenteditable elements. This sample covers scroll position test of a) ifram
e element containing | 82 in contenteditable elements. This sample covers scroll position test of a) ifram
e element containing |
| 83 contenteditable body and b) content editable div element. Even though the cursor
will move exactly to | 83 contenteditable body and b) content editable div element. Even though the cursor
will move exactly to |
| 84 the same location on all platforms (covered by test option-page-up-down.html), p
lease note that Mac will | 84 the same location on all platforms (covered by test option-page-up-down.html), p
lease note that Mac will |
| 85 scroll the visible area by placing the cursor position in the middle. All other
platforms will scroll by | 85 scroll the visible area by placing the cursor position in the middle. All other
platforms will scroll by |
| 86 keeping the cursor aligned with the top edge of the visible area. </div> | 86 keeping the cursor aligned with the top edge of the visible area. </div> |
| 87 <iframe src="../resources/contenteditable-iframe-fixed-size-src.html" style="hei
ght:150px; padding: 0px;"></iframe> | 87 <iframe src="../resources/contenteditable-iframe-fixed-size-src.html" style="hei
ght:150px; padding: 0px;"></iframe> |
| 88 <div id="editable" contenteditable="true" class="ahem" style="height:150px; over
flow:auto; padding: 0px; margin: 0px;"></div> | 88 <div id="editable" contenteditable="true" class="ahem" style="height:150px; over
flow:auto; padding: 0px; margin: 0px;"></div> |
| 89 <div id="results"></div> | 89 <div id="results"></div> |
| 90 </body> | 90 </body> |
| OLD | NEW |