Index: LayoutTests/fast/forms/textarea-resize-below-min-size-set.html |
diff --git a/LayoutTests/fast/forms/textarea-resize-below-min-size-set.html b/LayoutTests/fast/forms/textarea-resize-below-min-size-set.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bab86a3e1acfe13df2f7d2358153917fe6f0fe14 |
--- /dev/null |
+++ b/LayoutTests/fast/forms/textarea-resize-below-min-size-set.html |
@@ -0,0 +1,80 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script> |
+function log(msg) |
+{ |
+ document.getElementById('console').appendChild(document.createTextNode(msg + '\n')); |
+} |
+ |
+function updateSize() |
+{ |
+ if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ |
+ var textAreaElement = document.getElementById("textInputID"); |
+ |
+ textAreaElement.style.width = "400px"; |
+ textAreaElement.style.height = "400px"; |
+ textAreaElement.style.minWidth="200px"; |
+ textAreaElement.style.minHeight="200px"; |
+ testDragAndMove("fixed"); |
+ |
+ textAreaElement.style.width = "400px"; |
+ textAreaElement.style.height = "400px"; |
+ textAreaElement.style.minWidth="15vw"; |
+ textAreaElement.style.minHeight="15vh"; |
+ testDragAndMove("relative-viewport"); |
+ |
+ textAreaElement.style.width = "400px"; |
+ textAreaElement.style.height = "400px"; |
+ textAreaElement.style.minWidth="10%"; |
+ textAreaElement.style.minHeight="10%"; |
+ testDragAndMove("percentage"); |
+ |
+ } else |
+ log("This test needs window.testRunner and window.eventSender to work. To manually test it, drag the textarea above. \nFor test to pass the width and height of textarea should not go below min-width and min-height"); |
+} |
+ |
+function testDragAndMove(type) |
+{ |
+ var draggable = document.getElementById("textInputID"); |
+ var startX = draggable.offsetLeft + 400; |
+ var startY = draggable.offsetTop + 400; |
+ |
+ eventSender.dragMode = false; |
+ eventSender.mouseMoveTo(startX,startY); |
+ eventSender.mouseDown(); |
+ // Then drag it. |
+ eventSender.mouseMoveTo(startX - 350, startY - 350); |
+ eventSender.mouseUp(); |
+ |
+ if (type == "fixed") { |
+ if ((draggable.style.width == "194px") && (draggable.style.height == "194px")) |
harpreet.sk
2014/04/24 15:28:27
The condition check here for 194px and not 200px a
Julien - ping for review
2014/04/24 21:49:05
I expect that we need the borders to delimit the t
harpreet.sk
2014/04/25 13:33:48
Comment added.
|
+ log("PASS textAreaElement width is " + draggable.style.width + " and height is " + draggable.style.height); |
+ else |
+ log("FAIL textAreaElement width is " + draggable.style.width + " and height is " + draggable.style.height); |
+ } else if (type == "relative-viewport") { |
+ if ((draggable.style.width == "114px") && (draggable.style.height == "84px")) |
harpreet.sk
2014/04/24 15:28:27
Ideally for this case (viewport-length) the width
|
+ log("PASS textAreaElement width is " + draggable.style.width + " and height is " + draggable.style.height); |
+ else |
+ log("FAIL textAreaElement width is " + draggable.style.width + " and height is " + draggable.style.height); |
+ } else { |
+ if ((draggable.style.width == "74px") && (draggable.style.height == "74px")) |
harpreet.sk
2014/04/24 15:28:27
min-width/min-height includes padding and border s
|
+ log("PASS textAreaElement width is " + draggable.style.width + " and height is " + draggable.style.height); |
+ else |
+ log("FAIL textAreaElement width is " + draggable.style.width + " and height is " + draggable.style.height); |
+ } |
+ |
+} |
+</script> |
+</head> |
+<body onload="updateSize()"> |
+<div style="width:800px; height:800px"> |
+<textarea id="textInputID"> |
+Some text |
+</textarea> |
+</div> |
+<pre id="console"></pre> |
+</body> |
+</html> |