OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <pre id="console"></pre> |
| 8 <textarea style="width:400px; height:400px" id="textInputID"> |
| 9 Some text |
| 10 </textarea> |
| 11 <script> |
| 12 description("<b>Test for resizing the Textarea below it's min intrinsic size.</b
>"); |
| 13 test(); |
| 14 |
| 15 function log(msg) |
| 16 { |
| 17 document.getElementById('console').appendChild(document.createTextNode(msg +
'\n')); |
| 18 } |
| 19 |
| 20 function test() |
| 21 { |
| 22 if (window.testRunner) |
| 23 testDragAndMove(); |
| 24 else |
| 25 log("\n\nThis test needs window.testRunner and window.eventSender to wor
k. To manually test it, drag the textarea below. \nFor test to pass the width an
d height of textarea should not go below min-width and min-height\n\n"); |
| 26 } |
| 27 |
| 28 function testDragAndMove() |
| 29 { |
| 30 var startX = document.getElementById("textInputID").offsetLeft + 400; |
| 31 var startY = document.getElementById("textInputID").offsetTop + 400; |
| 32 |
| 33 eventSender.dragMode = false; |
| 34 eventSender.mouseMoveTo(startX,startY); |
| 35 eventSender.mouseDown(); |
| 36 // Then drag it. |
| 37 eventSender.mouseMoveTo(startX - 395, startY - 395); |
| 38 eventSender.mouseUp(); |
| 39 |
| 40 // The min-width/min-height includes padding and border and width/height doe
s not include padding and border. |
| 41 // So when we set say min-width = 200px it means actual minimum width of box
to be 194px (as 2px paddding and 1px border on all side). |
| 42 // Hence the condition check here for 9px as default minimum size for resizi
ng is 15x15. |
| 43 shouldBeEqualToString('document.getElementById("textInputID").style.width',
'9px'); |
| 44 shouldBeEqualToString('document.getElementById("textInputID").style.height;'
, '9px'); |
| 45 |
| 46 } |
| 47 </script> |
| 48 </body> |
| 49 </html> |
OLD | NEW |