[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tkent at chromium.org tkent at chromium.org
Wed Dec 22 13:50:59 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 59669cdcbd0ca997284571ac80fdc3c594676ab7
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 28 07:09:56 2010 +0000

    Fix assertion failure in a case that the dirty flag of a textarea element is changed
    https://bugs.webkit.org/show_bug.cgi?id=45681
    
    Reviewed by Alexey Proskuryakov.
    
    WebCore:
    
    We need to call setNeedsValidityCheck() after updating m_isDirty.
    
    Test: fast/forms/textarea-checkValidity-crash.html
    
    * html/HTMLTextAreaElement.cpp:
    (WebCore::HTMLTextAreaElement::setValue):
    (WebCore::HTMLTextAreaElement::setNonDirtyValue):
    (WebCore::HTMLTextAreaElement::setValueCommon):
    * html/HTMLTextAreaElement.h:
    
    LayoutTests:
    
    * fast/forms/textarea-checkValidity-crash-expected.txt: Added.
    * fast/forms/textarea-checkValidity-crash.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68494 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ba05131..b9e8cb9 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-27  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Fix assertion failure in a case that the dirty flag of a textarea element is changed
+        https://bugs.webkit.org/show_bug.cgi?id=45681
+
+        * fast/forms/textarea-checkValidity-crash-expected.txt: Added.
+        * fast/forms/textarea-checkValidity-crash.html: Added.
+
 2010-09-27  Csaba Osztrogonác  <ossy at webkit.org>
 
         Unreviewed fix after r68460.
diff --git a/LayoutTests/fast/forms/textarea-checkValidity-crash-expected.txt b/LayoutTests/fast/forms/textarea-checkValidity-crash-expected.txt
new file mode 100644
index 0000000..cbb43d7
--- /dev/null
+++ b/LayoutTests/fast/forms/textarea-checkValidity-crash-expected.txt
@@ -0,0 +1,8 @@
+Bug 45681: Assertion failure about dirty flag changes of textarea elements.
+
+PASS Not crashed.
+PASS Not crashed.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/textarea-checkValidity-crash.html b/LayoutTests/fast/forms/textarea-checkValidity-crash.html
new file mode 100644
index 0000000..5dd9cbd
--- /dev/null
+++ b/LayoutTests/fast/forms/textarea-checkValidity-crash.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description">Bug 45681: Assertion failure about dirty flag changes of textarea elements.</p>
+<div id="console"></div>
+<script>
+var ta = document.createElement('textarea');
+ta.setAttribute('maxlength', '1');
+ta.value = 'abc'; // Make it dirty && invalid.
+ta.checkValidity(); // This made an assertion failure.
+testPassed('Not crashed.');
+
+ta.value = 'a'; // Make it dirty && valid.
+ta.defaultValue = 'abc'; // Make it non-dirty && invalid.
+ta.checkValidity(); // This made an assertion fail.
+testPassed('Not crashed.');
+
+var successfullyParsed = true;
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 19b8c37..d134e3f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-27  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Fix assertion failure in a case that the dirty flag of a textarea element is changed
+        https://bugs.webkit.org/show_bug.cgi?id=45681
+
+        We need to call setNeedsValidityCheck() after updating m_isDirty.
+
+        Test: fast/forms/textarea-checkValidity-crash.html
+
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::setValue):
+        (WebCore::HTMLTextAreaElement::setNonDirtyValue):
+        (WebCore::HTMLTextAreaElement::setValueCommon):
+        * html/HTMLTextAreaElement.h:
+
 2010-09-27  Abhishek Arya  <inferno at chromium.org>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/html/HTMLTextAreaElement.cpp b/WebCore/html/HTMLTextAreaElement.cpp
index 80e130d..ea1f62b 100644
--- a/WebCore/html/HTMLTextAreaElement.cpp
+++ b/WebCore/html/HTMLTextAreaElement.cpp
@@ -287,12 +287,20 @@ String HTMLTextAreaElement::value() const
 
 void HTMLTextAreaElement::setValue(const String& value)
 {
-    setNonDirtyValue(value);
+    setValueCommon(value);
     m_isDirty = true;
+    setNeedsValidityCheck();
 }
 
 void HTMLTextAreaElement::setNonDirtyValue(const String& value)
 {
+    setValueCommon(value);
+    m_isDirty = false;
+    setNeedsValidityCheck();
+}
+
+void HTMLTextAreaElement::setValueCommon(const String& value)
+{
     // Code elsewhere normalizes line endings added by the user via the keyboard or pasting.
     // We normalize line endings coming from JavaScript here.
     String normalizedValue = value.isNull() ? "" : value;
@@ -307,8 +315,6 @@ void HTMLTextAreaElement::setNonDirtyValue(const String& value)
     m_value = normalizedValue;
     updatePlaceholderVisibility(false);
     setNeedsStyleRecalc();
-    setNeedsValidityCheck();
-    m_isDirty = false;
     setFormControlValueMatchesRenderer(true);
 
     // Set the caret to the end of the text value.
diff --git a/WebCore/html/HTMLTextAreaElement.h b/WebCore/html/HTMLTextAreaElement.h
index 28d0b61..d951c02 100644
--- a/WebCore/html/HTMLTextAreaElement.h
+++ b/WebCore/html/HTMLTextAreaElement.h
@@ -67,6 +67,7 @@ private:
     static String sanitizeUserInputValue(const String&, unsigned maxLength);
     void updateValue() const;
     void setNonDirtyValue(const String&);
+    void setValueCommon(const String&);
 
     virtual bool supportsPlaceholder() const { return true; }
     virtual bool isEmptyValue() const { return value().isEmpty(); }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list