Index: LayoutTests/fast/forms/textarea-resize-below-min-intrinsic-size.html |
diff --git a/LayoutTests/fast/forms/textarea-resize-below-min-intrinsic-size.html b/LayoutTests/fast/forms/textarea-resize-below-min-intrinsic-size.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a01b0de84d26878335223911923797f72da29a75 |
--- /dev/null |
+++ b/LayoutTests/fast/forms/textarea-resize-below-min-intrinsic-size.html |
@@ -0,0 +1,49 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<pre id="console"></pre> |
+<textarea style="width:400px; height:400px" id="textInputID"> |
+Some text |
+</textarea> |
+<script> |
+description("<b>Test for resizing the Textarea below it's min intrinsic size.</b>"); |
+test(); |
+ |
+function log(msg) |
+{ |
+ document.getElementById('console').appendChild(document.createTextNode(msg + '\n')); |
+} |
+ |
+function test() |
+{ |
+ if (window.testRunner) |
+ testDragAndMove(); |
+ else |
+ log("\n\nThis test needs window.testRunner and window.eventSender to work. To manually test it, drag the textarea below. \nFor test to pass the width and height of textarea should not go below min-width and min-height\n\n"); |
+} |
+ |
+function testDragAndMove() |
+{ |
+ var startX = document.getElementById("textInputID").offsetLeft + 400; |
+ var startY = document.getElementById("textInputID").offsetTop + 400; |
+ |
+ eventSender.dragMode = false; |
+ eventSender.mouseMoveTo(startX,startY); |
+ eventSender.mouseDown(); |
+ // Then drag it. |
+ eventSender.mouseMoveTo(startX - 395, startY - 395); |
+ eventSender.mouseUp(); |
+ |
+ // The min-width/min-height includes padding and border and width/height does not include padding and border. |
+ // 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). |
+ // Hence the condition check here for 9px as default minimum size for resizing is 15x15. |
+ shouldBeEqualToString('document.getElementById("textInputID").style.width', '9px'); |
+ shouldBeEqualToString('document.getElementById("textInputID").style.height;', '9px'); |
+ |
+} |
+</script> |
+</body> |
+</html> |