LayoutTests:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jan 2007 00:44:31 +0000 (00:44 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jan 2007 00:44:31 +0000 (00:44 +0000)
        Reviewed by Maciej.

        - test for http://bugs.webkit.org/show_bug.cgi?id=11115
          REGRESSION: Crash on Flickr after hitting cancel from adding a note

        * fast/forms/text-set-value-crash-expected.txt: Added.
        * fast/forms/text-set-value-crash.html: Added.

WebCore:

        Reviewed by Maciej.

        - fix http://bugs.webkit.org/show_bug.cgi?id=11115
          REGRESSION: Crash on Flickr after hitting cancel from adding a note

        Test: fast/forms/text-set-value-crash.html

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::setValue): Added a call to Document::updateRendering().
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::setValue): Ditto.

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/text-set-value-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/text-set-value-crash.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLTextAreaElement.cpp

index 12707f7..1570936 100644 (file)
@@ -1,5 +1,15 @@
 2007-01-20  Mitz Pettel  <mitz@webkit.org>
 
+        Reviewed by Maciej.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=11115
+          REGRESSION: Crash on Flickr after hitting cancel from adding a note
+
+        * fast/forms/text-set-value-crash-expected.txt: Added.
+        * fast/forms/text-set-value-crash.html: Added.
+
+2007-01-20  Mitz Pettel  <mitz@webkit.org>
+
         Reviewed by Darin.
 
         - test for http://bugs.webkit.org/show_bug.cgi?id=8360
diff --git a/LayoutTests/fast/forms/text-set-value-crash-expected.txt b/LayoutTests/fast/forms/text-set-value-crash-expected.txt
new file mode 100644 (file)
index 0000000..96e558d
--- /dev/null
@@ -0,0 +1,5 @@
+Test for http://bugs.webkit.org/show_bug.cgi?id=11115 REGRESSION: Crash on Flickr after hitting cancel from adding a note.
+
+No crash means test PASS.
+
+
diff --git a/LayoutTests/fast/forms/text-set-value-crash.html b/LayoutTests/fast/forms/text-set-value-crash.html
new file mode 100644 (file)
index 0000000..d378521
--- /dev/null
@@ -0,0 +1,36 @@
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+    <p>
+        Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=11115">http://bugs.webkit.org/show_bug.cgi?id=11115</a>
+        REGRESSION: Crash on Flickr after hitting cancel from adding a note</i>.
+    </p>
+    <p>
+        No crash means test PASS.
+    </p>
+    <div id="q">
+        <textarea id="t">Lorem ipsum</textarea>
+    </div>
+    <div id="r">
+        <input id="u" value="Lorem ipsum">
+    </div>
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+    
+        var t = document.getElementById("t");
+        var q = document.getElementById("q");
+        t.focus();
+        q.style.display='none';
+        t.value='';
+
+        var u = document.getElementById("u");
+        var r = document.getElementById("r");
+        u.focus();
+        r.style.display='none';
+        u.value='';
+    </script>
+</body>
+</html>
index 8cd5c8f..89d442c 100644 (file)
@@ -1,5 +1,19 @@
 2007-01-20  Mitz Pettel  <mitz@webkit.org>
 
+        Reviewed by Maciej.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=11115
+          REGRESSION: Crash on Flickr after hitting cancel from adding a note
+
+        Test: fast/forms/text-set-value-crash.html
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setValue): Added a call to Document::updateRendering().
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::setValue): Ditto.
+
+2007-01-20  Mitz Pettel  <mitz@webkit.org>
+
         Reviewed by Darin.
 
         - fix http://bugs.webkit.org/show_bug.cgi?id=8360
index 7d64a45..ea1cf80 100644 (file)
@@ -1082,6 +1082,8 @@ void HTMLInputElement::setValue(const String& value)
     setValueMatchesRenderer(false);
     if (storesValueSeparateFromAttribute()) {
         m_value = constrainValue(value);
+        if (isTextField() && inDocument())
+            document()->updateRendering();
         if (renderer())
             renderer()->updateFromElement();
         // Changes to hidden values don't require re-rendering.
index d6b471e..0a0cfcf 100644 (file)
@@ -270,6 +270,8 @@ void HTMLTextAreaElement::setValue(const String& value)
     
     m_value = valueWithNormalizedLineEndings;
     setValueMatchesRenderer();
+    if (inDocument())
+        document()->updateRendering();
     if (renderer())
         renderer()->updateFromElement();