OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 <html> |
| 4 <head> |
| 5 <script> |
| 6 function log(msg) |
| 7 { |
| 8 document.getElementById('console').appendChild(document.createTextNode(msg +
'\n')); |
| 9 } |
| 10 |
| 11 function test() |
| 12 { |
| 13 if (window.testRunner) { |
| 14 testRunner.waitUntilDone(); |
| 15 testRunner.dumpAsText(); |
| 16 testDragAndMove(); |
| 17 } else |
| 18 log("testRunner is not available"); |
| 19 } |
| 20 |
| 21 function testDragAndMove() |
| 22 { |
| 23 var draggable = document.getElementById("textInputID"); |
| 24 var startX = draggable.offsetLeft + 100; |
| 25 var startY = draggable.offsetTop + 50; |
| 26 |
| 27 log("TextArea initial width is " + draggable.style.width); |
| 28 log("TextArea initial height is " + draggable.style.height); |
| 29 log("Dragging textarea to reduce it's width and height by 30px"); |
| 30 |
| 31 eventSender.dragMode = false; |
| 32 eventSender.mouseMoveTo(startX,startY); |
| 33 eventSender.mouseDown(); |
| 34 // Then drag it. OK not to crash. |
| 35 eventSender.mouseMoveTo(startX - 30, startY - 30); |
| 36 //eventSender.mouseMoveTo(startX + 20, startY + 20); |
| 37 eventSender.mouseUp(); |
| 38 |
| 39 log("After dragging textarea new width is " + draggable.style.width); |
| 40 log("After dragging textarea new height is " + draggable.style.height); |
| 41 log("You will see a PASS message below if new width is 70px and new height i
s 20px"); |
| 42 |
| 43 if ((draggable.style.width == "70px") && (draggable.style.height == "20px")) |
| 44 log("PASS"); |
| 45 |
| 46 testRunner.notifyDone(); |
| 47 } |
| 48 </script> |
| 49 </head> |
| 50 <body onload="test()"> |
| 51 <textarea style="width:100px; height:50px; min-width:10px; min-height:10px" id="
textInputID"> |
| 52 Some text |
| 53 </textarea> |
| 54 <pre id="console"></pre> |
| 55 </body> |
| 56 </html> |
OLD | NEW |