-rolled in patch by Anders Carlsson <andersca@mac.com> for
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jul 2005 02:04:43 +0000 (02:04 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jul 2005 02:04:43 +0000 (02:04 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=3751
        REGRESSION: affects Blogger, GMail & Wikipedia: empty textarea's which should have content

        Reviewed by mjs.

        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLTextAreaElementImpl::defaultValue):
        (DOM::HTMLTextAreaElementImpl::attach):
        * khtml/html/html_formimpl.h:

        Test cases added:
        * manual-tests/textarea-after-stylesheet-link.html: Added.
        Test is manual because the result doesn't show up in DumpRenderTree

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/html/html_formimpl.cpp
WebCore/khtml/html/html_formimpl.h
WebCore/manual-tests/textarea-after-stylesheet-link.html [new file with mode: 0644]

index 2635003f2fdcda4cd04268a82a105a03cd7c9827..dab9940dba375c7b5c4eb7ba01940a844af71a39 100644 (file)
@@ -1,3 +1,20 @@
+2005-07-19  Geoffrey Garen  <ggaren@apple.com>
+
+        -rolled in patch by Anders Carlsson <andersca@mac.com> for
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=3751
+        REGRESSION: affects Blogger, GMail & Wikipedia: empty textarea's which should have content
+        
+        Reviewed by mjs.
+
+        * khtml/html/html_formimpl.cpp:
+        (DOM::HTMLTextAreaElementImpl::defaultValue):
+        (DOM::HTMLTextAreaElementImpl::attach):
+        * khtml/html/html_formimpl.h:
+
+        Test cases added:
+        * manual-tests/textarea-after-stylesheet-link.html: Added.
+        Test is manual because the result doesn't show up in DumpRenderTree
+
 2005-07-19  Justin Garcia  <justin.garcia@apple.com>
         
         Added a virtual deconstructor to fix gcc4 build warning
index ecabf0ec4c37bceedb455eeb82b087476b3c5261..0fdd18f1e15f6254cde0b973f27429c032e05f09 100644 (file)
@@ -3520,13 +3520,13 @@ DOMString HTMLTextAreaElementImpl::defaultValue()
     for (n = firstChild(); n; n = n->nextSibling())
         if (n->isTextNode())
             val += static_cast<TextImpl*>(n)->data();
+    
     if (val[0] == '\r' && val[1] == '\n') {
-       val = val.copy();
-       val.remove(0,2);
-    }
-    else if (val[0] == '\r' || val[0] == '\n') {
-       val = val.copy();
-       val.remove(0,1);
+        val = val.copy();
+        val.remove(0,2);
+    } else if (val[0] == '\r' || val[0] == '\n') {
+        val = val.copy();
+        val.remove(0,1);
     }
 
     return val;
@@ -3570,6 +3570,13 @@ void HTMLTextAreaElementImpl::accessKeyAction(bool sendToAnyElement)
     focus();
 }
 
+void HTMLTextAreaElementImpl::attach()
+{
+    m_valueIsValid = true;
+    HTMLGenericFormElementImpl::attach();
+    updateValue();
+}
+
 void HTMLTextAreaElementImpl::detach()
 {
     HTMLGenericFormElementImpl::detach();
index e23e8d39c5f72cd6bcaca210c037e85ad983dbaf..36f32063ae5817c3489f6f0cea605005f4b76ca9 100644 (file)
@@ -752,6 +752,7 @@ public:
     virtual void childrenChanged();
     virtual void parseMappedAttribute(MappedAttributeImpl *attr);
     virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
+    virtual void attach();
     virtual void detach();
     virtual bool appendFormData(FormDataList&, bool);
     virtual void reset();
diff --git a/WebCore/manual-tests/textarea-after-stylesheet-link.html b/WebCore/manual-tests/textarea-after-stylesheet-link.html
new file mode 100644 (file)
index 0000000..90467a0
--- /dev/null
@@ -0,0 +1,18 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    window.layoutTestController.dumpAsText();
+}
+</script>
+<link rel="stylesheet" />
+</head>
+<body>
+<p>Tests: whether &lt;link rel="stylesheet"/&gt; disturbs the display of text in textareas</p>
+<p>Related bug: <a href = "http://bugzilla.opendarwin.org/show_bug.cgi?id=3751">3751: REGRESSION: affects Blogger, GMail & Wikipedia: empty textarea's which should have content</a></p>
+<p>Success: You will see "passed" inside the texarea below</p>
+<hr>
+<textarea>passed</textarea>
+</form>
+</body>
+</html>
\ No newline at end of file