Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: LayoutTests/fast/forms/text-area-resize-orthogonal-containingBlock.html

Issue 239983004: Textarea resize-able only to larger; min-height and min-width properly set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing the changes asked in patch set 4 Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698