OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script> |
| 5 function log(msg) |
| 6 { |
| 7 document.getElementById('console').appendChild(document.createTextNode(msg +
'\n')); |
| 8 } |
| 9 |
| 10 function updateSize() |
| 11 { |
| 12 if (window.testRunner) { |
| 13 testRunner.dumpAsText(); |
| 14 |
| 15 var textAreaElement = document.getElementById("textInputID"); |
| 16 |
| 17 textAreaElement.style.width = "400px"; |
| 18 textAreaElement.style.height = "400px"; |
| 19 textAreaElement.style.minWidth="200px"; |
| 20 textAreaElement.style.minHeight="200px"; |
| 21 testDragAndMove(); |
| 22 |
| 23 textAreaElement.style.width = "400px"; |
| 24 textAreaElement.style.height = "400px"; |
| 25 textAreaElement.style.minWidth="15vw"; |
| 26 textAreaElement.style.minHeight="15vh"; |
| 27 testDragAndMove(); |
| 28 |
| 29 textAreaElement.style.width = "400px"; |
| 30 textAreaElement.style.height = "400px"; |
| 31 textAreaElement.style.minWidth="10%"; |
| 32 textAreaElement.style.minHeight="10%"; |
| 33 testDragAndMove(); |
| 34 |
| 35 } else |
| 36 log("This test needs window.testRunner and window.eventSender to work. T
o manually test it, drag the textarea above. \nFor test to pass the width and he
ight of textarea should not go below min-width and min-height"); |
| 37 } |
| 38 |
| 39 function testDragAndMove() |
| 40 { |
| 41 var draggable = document.getElementById("textInputID"); |
| 42 var startX = draggable.offsetLeft + 400; |
| 43 var startY = draggable.offsetTop + 400; |
| 44 |
| 45 eventSender.dragMode = false; |
| 46 eventSender.mouseMoveTo(startX,startY); |
| 47 eventSender.mouseDown(); |
| 48 // Then drag it. |
| 49 eventSender.mouseMoveTo(startX - 150, startY - 150); |
| 50 eventSender.mouseUp(); |
| 51 |
| 52 if ((draggable.style.width == "250px") && (draggable.style.height == "250px"
)) |
| 53 log("PASS textAreaElement width is " + draggable.style.width + " and hei
ght is " + draggable.style.height); |
| 54 else |
| 55 log("FAIL textAreaElement width is " + draggable.style.width + " and hei
ght is " + draggable.style.height); |
| 56 } |
| 57 </script> |
| 58 </head> |
| 59 <body onload="updateSize()"> |
| 60 <div style="width:800px; height:800px"> |
| 61 <textarea id="textInputID"> |
| 62 Some text |
| 63 </textarea> |
| 64 </div> |
| 65 <pre id="console"></pre> |
| 66 </body> |
| 67 </html> |
OLD | NEW |