Chromium Code Reviews| 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 test() | |
| 11 { | |
| 12 if (window.testRunner) { | |
| 13 testRunner.dumpAsText(); | |
| 14 testDragAndMove(); | |
| 15 } else | |
| 16 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"); | |
| 17 } | |
| 18 | |
| 19 function testDragAndMove() | |
| 20 { | |
| 21 var draggable = document.getElementById("textInputID"); | |
| 22 var startX = draggable.offsetLeft + 400; | |
| 23 var startY = draggable.offsetTop + 400; | |
| 24 | |
| 25 eventSender.dragMode = false; | |
| 26 eventSender.mouseMoveTo(startX,startY); | |
| 27 eventSender.mouseDown(); | |
| 28 // Then drag it. | |
| 29 eventSender.mouseMoveTo(startX - 395, startY - 395); | |
| 30 eventSender.mouseUp(); | |
| 31 | |
| 32 // The min-width/min-height includes padding and border and width/height doe s not include padding and border. | |
| 33 // So when we set say min-width = 200px it means actual minimum width of box to be 194px (as 2px | |
| 34 // paddding and 1px border on all side). | |
| 35 // Also the containing block is orthogonal to the textarea so min-width will be 10% of height of containing block | |
| 36 // and min-height is 10% of width of containing block | |
| 37 if ((draggable.style.width == "64px") && (draggable.style.height == "74px")) | |
| 38 log("PASS textAreaElement width is " + draggable.style.width + " and hei ght is " + draggable.style.height); | |
| 39 else | |
| 40 log("FAIL textAreaElement width is " + draggable.style.width + " and hei ght is " + draggable.style.height); | |
| 41 } | |
| 42 </script> | |
| 43 </head> | |
| 44 <body onload="test()"> | |
| 45 <div id="res" style="-webkit-writing-mode: vertical-lr; width:800px; height:700p x"> | |
| 46 <textarea style="width:400px; height:400px; min-width:10%; min-height:10%" id="t extInputID"> | |
|
Julien - ping for review
2014/04/29 22:13:54
Writing mode is inherited so the textarea and the
harpreet.sk
2014/04/30 10:12:53
Done.
| |
| 47 Some text | |
| 48 </textarea> | |
| 49 </div> | |
| 50 <pre id="console"></pre> | |
| 51 </body> | |
| 52 </html> | |
| OLD | NEW |