WebCore:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Apr 2006 16:43:35 +0000 (16:43 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Apr 2006 16:43:35 +0000 (16:43 +0000)
        Reviewed by Darin.

        Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8407
        REGRESSION (NativeTextField): Leading and trailing spaces trimmed from text field value attribute

        * rendering/RenderTextField.cpp: (WebCore::RenderTextField::createDivStyle):
        Use white-space:pre for the inner div to avoid collapsing spaces in the text field.

LayoutTests:
        Test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8407
        REGRESSION (NativeTextField): Leading and trailing spaces trimmed from text field value attribute

        * fast/forms/input-spaces-expected.checksum: Added.
        * fast/forms/input-spaces-expected.png: Added.
        * fast/forms/input-spaces-expected.txt: Added.
        * fast/forms/input-spaces.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13956 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/input-spaces-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/input-spaces-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/input-spaces-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/input-spaces.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderTextField.cpp

index 22a3090a620a3ab570e2b4a47d43c59d41260fca..0f591cd90b51a24c6363fe45259248345dca4a64 100644 (file)
@@ -1,3 +1,13 @@
+2006-04-17  Adele Peterson  <adele@apple.com>
+
+        Test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8407
+        REGRESSION (NativeTextField): Leading and trailing spaces trimmed from text field value attribute
+
+        * fast/forms/input-spaces-expected.checksum: Added.
+        * fast/forms/input-spaces-expected.png: Added.
+        * fast/forms/input-spaces-expected.txt: Added.
+        * fast/forms/input-spaces.html: Added.
+
 2006-04-17  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Geoff.
diff --git a/LayoutTests/fast/forms/input-spaces-expected.checksum b/LayoutTests/fast/forms/input-spaces-expected.checksum
new file mode 100644 (file)
index 0000000..1e0cae1
--- /dev/null
@@ -0,0 +1 @@
+52d133f9d7a2c94d90326f6f04a87580
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/input-spaces-expected.png b/LayoutTests/fast/forms/input-spaces-expected.png
new file mode 100644 (file)
index 0000000..00acac8
Binary files /dev/null and b/LayoutTests/fast/forms/input-spaces-expected.png differ
diff --git a/LayoutTests/fast/forms/input-spaces-expected.txt b/LayoutTests/fast/forms/input-spaces-expected.txt
new file mode 100644 (file)
index 0000000..b959896
--- /dev/null
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderText {#text} at (0,0) size 776x36
+        text run at (0,0) width 776: "This tests that leading and trailing spaces in a text field don't get lost. There should be 3 spaces before and 3 spaces after the"
+        text run at (0,18) width 102: "text in the field. "
+      RenderBR {BR} at (102,32) size 0x0
+      RenderTextField {INPUT} at (2,38) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+layer at (13,49) size 142x13
+  RenderBlock {DIV} at (3,3) size 142x13
+    RenderText {#text} at (1,0) size 57x13
+      text run at (1,0) width 57: "   foo bar   "
diff --git a/LayoutTests/fast/forms/input-spaces.html b/LayoutTests/fast/forms/input-spaces.html
new file mode 100644 (file)
index 0000000..437ce65
--- /dev/null
@@ -0,0 +1,7 @@
+<html>
+<body>
+This tests that leading and trailing spaces in a text field don't get lost.
+There should be 3 spaces before and 3 spaces after the text in the field.
+<br><input id="tf" value="   foo bar   ">
+</body>
+</html>
\ No newline at end of file
index 01edb555ab48ea3210c097b791b07629a5ca53aa..fb18f042b881097b3ce4569742737dd63125fb6d 100644 (file)
@@ -1,3 +1,15 @@
+2006-04-17  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8407
+        REGRESSION (NativeTextField): Leading and trailing spaces trimmed from text field value attribute
+
+        Test: fast/forms/input-spaces.html
+
+        * rendering/RenderTextField.cpp: (WebCore::RenderTextField::createDivStyle): 
+        Use white-space:pre for the inner div to avoid collapsing spaces in the text field.
+
 2006-04-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by Darin.
index 202345bd4998be4249a10d449619e825716f651e..f861480ac512a169990e18537e4926c9aeed48e2 100644 (file)
@@ -72,7 +72,7 @@ RenderStyle* RenderTextField::createDivStyle(RenderStyle* startStyle)
     divStyle->inheritFrom(startStyle);
     divStyle->setDisplay(BLOCK);
     divStyle->setOverflow(OHIDDEN);
-    divStyle->setWhiteSpace(NOWRAP);
+    divStyle->setWhiteSpace(PRE);
 
     divStyle->setUserModify(input->readOnly() ? READ_ONLY : READ_WRITE_PLAINTEXT_ONLY);