[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:39:07 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 553e75debb102656a8decc9466d3d99a56dbc6d4
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 5 18:23:23 2009 +0000

    2009-10-05  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Eric Seidel.
    
            Tests to check if validation-related CSS selectors are applied immediately.
            https://bugs.webkit.org/show_bug.cgi?id=28868
    
            * fast/forms/input-live-pseudo-selectors-expected.txt: Added.
            * fast/forms/input-live-pseudo-selectors.html: Added.
            * fast/forms/resources/input-live-pseudo-selectors.js: Added.
            * fast/forms/resources/live-pseudo-selectors.css: Added.
            * fast/forms/resources/textarea-live-pseudo-selectors.js: Added.
            * fast/forms/textarea-live-pseudo-selectors-expected.txt: Added.
            * fast/forms/textarea-live-pseudo-selectors.html: Added.
    2009-10-05  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Eric Seidel.
    
            Update style immediately when validation-related values are updated.
            https://bugs.webkit.org/show_bug.cgi?id=28868
    
            In order to apply :valid, :invalid, :optional or :required lively,
              - call setNeedsStyleRecalc() when properties which can change
                willValidate state are updated, and
                 (Parent form element, name, disabled, readonly)
              - call updateValidity() when properties which can change validity
                state are updated. (value, pattern, required)
    
            Tests: fast/forms/input-live-pseudo-selectors.html
                   fast/forms/textarea-live-pseudo-selectors.html
    
            * html/HTMLFormControlElement.cpp:
            (WebCore::HTMLFormControlElement::HTMLFormControlElement):
            (WebCore::HTMLFormControlElement::parseMappedAttribute):
            (WebCore::HTMLFormControlElement::required):
            (WebCore::HTMLFormControlElement::updateValidity):
            * html/HTMLFormControlElement.h:
            * html/HTMLInputElement.cpp:
            (WebCore::HTMLInputElement::setInputType):
            (WebCore::HTMLInputElement::parseMappedAttribute):
            (WebCore::HTMLInputElement::setValue):
            (WebCore::HTMLInputElement::setValueFromRenderer):
            (WebCore::HTMLInputElement::setFileListFromRenderer):
            * html/HTMLTextAreaElement.cpp:
            (WebCore::HTMLTextAreaElement::setValue):
            * rendering/RenderTextControlMultiLine.cpp:
            (WebCore::RenderTextControlMultiLine::subtreeHasChanged):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4d2c607..189fcb7 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,20 @@
 2009-10-05  Kent Tamura  <tkent at chromium.org>
 
+        Reviewed by Eric Seidel.
+
+        Tests to check if validation-related CSS selectors are applied immediately.
+        https://bugs.webkit.org/show_bug.cgi?id=28868
+
+        * fast/forms/input-live-pseudo-selectors-expected.txt: Added.
+        * fast/forms/input-live-pseudo-selectors.html: Added.
+        * fast/forms/resources/input-live-pseudo-selectors.js: Added.
+        * fast/forms/resources/live-pseudo-selectors.css: Added.
+        * fast/forms/resources/textarea-live-pseudo-selectors.js: Added.
+        * fast/forms/textarea-live-pseudo-selectors-expected.txt: Added.
+        * fast/forms/textarea-live-pseudo-selectors.html: Added.
+
+2009-10-05  Kent Tamura  <tkent at chromium.org>
+
         Reviewed by Darin Adler.
 
         Implement min/max attributes, ValidityState.rangeUnderflow and
diff --git a/LayoutTests/fast/forms/input-live-pseudo-selectors-expected.txt b/LayoutTests/fast/forms/input-live-pseudo-selectors-expected.txt
new file mode 100644
index 0000000..00f8c29
--- /dev/null
+++ b/LayoutTests/fast/forms/input-live-pseudo-selectors-expected.txt
@@ -0,0 +1,37 @@
+This test performs a check that :valid/:invalid CSS psudo selectors are lively applied.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Chheck the initial state:
+PASS backgroundOf(el) is invalidColor
+Change name:
+PASS backgroundOf(el) is normalColor
+PASS backgroundOf(el) is invalidColor
+Change disabled:
+PASS backgroundOf(el) is disabledColor
+PASS backgroundOf(el) is invalidColor
+Change readOnly:
+PASS backgroundOf(el) is readOnlyColor
+PASS backgroundOf(el) is invalidColor
+Inside/outside of a form:
+PASS backgroundOf(el) is normalColor
+PASS backgroundOf(el) is invalidColor
+Change the value by DOM attribute:
+PASS backgroundOf(el) is validColor
+PASS backgroundOf(el) is invalidColor
+Change the value by key input:
+PASS backgroundOf(el) is validColor
+PASS backgroundOf(el) is invalidColor
+Change required:
+PASS backgroundOf(el) is validColor
+PASS backgroundOf(el) is invalidColor
+Change pattern:
+PASS backgroundOf(el) is validColor
+PASS backgroundOf(el) is invalidColor
+PASS backgroundOf(el) is validColor
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
diff --git a/LayoutTests/fast/forms/input-live-pseudo-selectors.html b/LayoutTests/fast/forms/input-live-pseudo-selectors.html
new file mode 100644
index 0000000..bd02ebc
--- /dev/null
+++ b/LayoutTests/fast/forms/input-live-pseudo-selectors.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<link rel="stylesheet" href="resources/live-pseudo-selectors.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/input-live-pseudo-selectors.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/resources/input-live-pseudo-selectors.js b/LayoutTests/fast/forms/resources/input-live-pseudo-selectors.js
new file mode 100644
index 0000000..a2b99ef
--- /dev/null
+++ b/LayoutTests/fast/forms/resources/input-live-pseudo-selectors.js
@@ -0,0 +1,102 @@
+description("This test performs a check that :valid/:invalid CSS psudo selectors are lively applied.");
+
+// Setup for static elements.
+var form = document.createElement('form');
+document.body.appendChild(form);
+var nonForm = document.createElement('div');
+document.body.appendChild(nonForm);
+
+function makeInvalid() {
+    var i = document.createElement('input');
+    i.name = 'foo';
+    i.required = true;
+    i.value = '';
+    form.appendChild(i);
+    return i;
+}
+
+function backgroundOf(el) {
+    return document.defaultView.getComputedStyle(el, null).getPropertyValue('background-color');
+}
+
+var elBackground = 'backgroundOf(el)';
+var invalidColor = 'rgb(255, 0, 0)';
+var normalColor = 'rgb(255, 255, 255)';
+var disabledColor = 'rgb(0, 0, 0)';
+var readOnlyColor = 'rgb(0, 255, 0)'
+var validColor = 'rgb(0, 0, 255)';
+
+// --------------------------------
+//     willValidate change
+// --------------------------------
+var el = makeInvalid();
+// Confirm this element is invalid.
+debug('Chheck the initial state:');
+shouldBe(elBackground, 'invalidColor');
+
+debug('Change name:');
+el.name = '';
+shouldBe(elBackground, 'normalColor');
+el.name = 'bar';
+shouldBe(elBackground, 'invalidColor');
+
+debug('Change disabled:');
+el = makeInvalid();
+el.disabled = true;
+shouldBe(elBackground, 'disabledColor');
+el.disabled = false;
+shouldBe(elBackground, 'invalidColor');
+
+debug('Change readOnly:');
+el = makeInvalid();
+el.readOnly = true;
+shouldBe(elBackground, 'readOnlyColor');
+el.readOnly = false;
+shouldBe(elBackground, 'invalidColor');
+
+debug('Inside/outside of a form:');
+el = makeInvalid();
+nonForm.appendChild(el);
+shouldBe(elBackground, 'normalColor');
+form.appendChild(el);
+shouldBe(elBackground, 'invalidColor');
+
+// --------------------------------
+//     value change
+// --------------------------------
+debug('Change the value by DOM attribute:');
+el = makeInvalid();
+el.value = 'abc';
+shouldBe(elBackground, 'validColor');
+el.value = '';
+shouldBe(elBackground, 'invalidColor');
+
+debug('Change the value by key input:');
+el = makeInvalid();
+el.focus();
+eventSender.keyDown('a');
+shouldBe(elBackground, 'validColor');
+eventSender.keyDown('delete', []);
+shouldBe(elBackground, 'invalidColor');
+
+// --------------------------------
+//     Constraints change
+// --------------------------------
+debug('Change required:');
+el = makeInvalid();
+el.required = false;
+shouldBe(elBackground, 'validColor');
+el.required = true;
+shouldBe(elBackground, 'invalidColor');
+
+debug('Change pattern:');
+el = makeInvalid();
+el.value = 'abc';
+shouldBe(elBackground, 'validColor');
+el.pattern = 'a..c';
+shouldBe(elBackground, 'invalidColor');
+el.pattern = 'a.c';
+shouldBe(elBackground, 'validColor');
+
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/forms/resources/live-pseudo-selectors.css b/LayoutTests/fast/forms/resources/live-pseudo-selectors.css
new file mode 100644
index 0000000..0b5736f
--- /dev/null
+++ b/LayoutTests/fast/forms/resources/live-pseudo-selectors.css
@@ -0,0 +1,6 @@
+:invalid { background: rgb(255, 0, 0); }
+:valid { background: rgb(0, 0, 255); }
+:disabled { background: black; }
+:read-only { background: rgb(0, 255, 0); }
+input { background: white; }
+textarea { background: white; }
diff --git a/LayoutTests/fast/forms/resources/textarea-live-pseudo-selectors.js b/LayoutTests/fast/forms/resources/textarea-live-pseudo-selectors.js
new file mode 100644
index 0000000..9488367
--- /dev/null
+++ b/LayoutTests/fast/forms/resources/textarea-live-pseudo-selectors.js
@@ -0,0 +1,93 @@
+description("This test performs a check that :valid/:invalid CSS psudo selectors are lively applied.");
+
+// Setup for static elements.
+var form = document.createElement('form');
+document.body.appendChild(form);
+var nonForm = document.createElement('div');
+document.body.appendChild(nonForm);
+
+function makeInvalid() {
+    var i = document.createElement('textarea');
+    i.name = 'foo';
+    i.required = true;
+    i.value = '';
+    form.appendChild(i);
+    return i;
+}
+
+function backgroundOf(el) {
+    return document.defaultView.getComputedStyle(el, null).getPropertyValue('background-color');
+}
+
+var elBackground = 'backgroundOf(el)';
+var invalidColor = 'rgb(255, 0, 0)';
+var normalColor = 'rgb(255, 255, 255)';
+var disabledColor = 'rgb(0, 0, 0)';
+var readOnlyColor = 'rgb(0, 255, 0)'
+var validColor = 'rgb(0, 0, 255)';
+
+// --------------------------------
+//     willValidate change
+// --------------------------------
+var el = makeInvalid();
+// Confirm this element is invalid.
+debug('Chheck the initial state:');
+shouldBe(elBackground, 'invalidColor');
+
+debug('Change name:');
+el.name = '';
+shouldBe(elBackground, 'normalColor');
+el.name = 'bar';
+shouldBe(elBackground, 'invalidColor');
+
+debug('Change disabled:');
+el = makeInvalid();
+el.disabled = true;
+shouldBe(elBackground, 'disabledColor');
+el.disabled = false;
+shouldBe(elBackground, 'invalidColor');
+
+debug('Change readOnly:');
+el = makeInvalid();
+el.readOnly = true;
+shouldBe(elBackground, 'readOnlyColor');
+el.readOnly = false;
+shouldBe(elBackground, 'invalidColor');
+
+debug('Inside/outside of a form:');
+el = makeInvalid();
+nonForm.appendChild(el);
+shouldBe(elBackground, 'normalColor');
+form.appendChild(el);
+shouldBe(elBackground, 'invalidColor');
+
+// --------------------------------
+//     value change
+// --------------------------------
+debug('Change the value by DOM attribute:');
+el = makeInvalid();
+el.value = 'abc';
+shouldBe(elBackground, 'validColor');
+el.value = '';
+shouldBe(elBackground, 'invalidColor');
+
+debug('Change the value by key input:');
+el = makeInvalid();
+el.focus();
+eventSender.keyDown('a');
+shouldBe(elBackground, 'validColor');
+eventSender.keyDown('delete', []);
+shouldBe(elBackground, 'invalidColor');
+
+// --------------------------------
+//     Constraints change
+// --------------------------------
+debug('Change required:');
+el = makeInvalid();
+el.required = false;
+shouldBe(elBackground, 'validColor');
+el.required = true;
+shouldBe(elBackground, 'invalidColor');
+
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/forms/textarea-live-pseudo-selectors-expected.txt b/LayoutTests/fast/forms/textarea-live-pseudo-selectors-expected.txt
new file mode 100644
index 0000000..d6e1b00
--- /dev/null
+++ b/LayoutTests/fast/forms/textarea-live-pseudo-selectors-expected.txt
@@ -0,0 +1,33 @@
+This test performs a check that :valid/:invalid CSS psudo selectors are lively applied.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Chheck the initial state:
+PASS backgroundOf(el) is invalidColor
+Change name:
+PASS backgroundOf(el) is normalColor
+PASS backgroundOf(el) is invalidColor
+Change disabled:
+PASS backgroundOf(el) is disabledColor
+PASS backgroundOf(el) is invalidColor
+Change readOnly:
+PASS backgroundOf(el) is readOnlyColor
+PASS backgroundOf(el) is invalidColor
+Inside/outside of a form:
+PASS backgroundOf(el) is normalColor
+PASS backgroundOf(el) is invalidColor
+Change the value by DOM attribute:
+PASS backgroundOf(el) is validColor
+PASS backgroundOf(el) is invalidColor
+Change the value by key input:
+PASS backgroundOf(el) is validColor
+PASS backgroundOf(el) is invalidColor
+Change required:
+PASS backgroundOf(el) is validColor
+PASS backgroundOf(el) is invalidColor
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
diff --git a/LayoutTests/fast/forms/textarea-live-pseudo-selectors.html b/LayoutTests/fast/forms/textarea-live-pseudo-selectors.html
new file mode 100644
index 0000000..d532c01
--- /dev/null
+++ b/LayoutTests/fast/forms/textarea-live-pseudo-selectors.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<link rel="stylesheet" href="resources/live-pseudo-selectors.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/textarea-live-pseudo-selectors.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7e71391..55f1521 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,39 @@
 2009-10-05  Kent Tamura  <tkent at chromium.org>
 
+        Reviewed by Eric Seidel.
+
+        Update style immediately when validation-related values are updated.
+        https://bugs.webkit.org/show_bug.cgi?id=28868
+
+        In order to apply :valid, :invalid, :optional or :required lively,
+          - call setNeedsStyleRecalc() when properties which can change
+            willValidate state are updated, and
+             (Parent form element, name, disabled, readonly)
+          - call updateValidity() when properties which can change validity
+            state are updated. (value, pattern, required)
+
+        Tests: fast/forms/input-live-pseudo-selectors.html
+               fast/forms/textarea-live-pseudo-selectors.html
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
+        (WebCore::HTMLFormControlElement::parseMappedAttribute):
+        (WebCore::HTMLFormControlElement::required):
+        (WebCore::HTMLFormControlElement::updateValidity):
+        * html/HTMLFormControlElement.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setInputType):
+        (WebCore::HTMLInputElement::parseMappedAttribute):
+        (WebCore::HTMLInputElement::setValue):
+        (WebCore::HTMLInputElement::setValueFromRenderer):
+        (WebCore::HTMLInputElement::setFileListFromRenderer):
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::setValue):
+        * rendering/RenderTextControlMultiLine.cpp:
+        (WebCore::RenderTextControlMultiLine::subtreeHasChanged):
+
+2009-10-05  Kent Tamura  <tkent at chromium.org>
+
         Reviewed by Darin Adler.
 
         Implement min/max attributes, ValidityState.rangeUnderflow and
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp
index 1094d0b..ea46980 100644
--- a/WebCore/html/HTMLFormControlElement.cpp
+++ b/WebCore/html/HTMLFormControlElement.cpp
@@ -53,6 +53,7 @@ HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Doc
     , m_form(f)
     , m_disabled(false)
     , m_readOnly(false)
+    , m_required(false)
     , m_valueMatchesRenderer(false)
 {
     if (!m_form)
@@ -87,9 +88,9 @@ ValidityState* HTMLFormControlElement::validity()
 
 void HTMLFormControlElement::parseMappedAttribute(MappedAttribute *attr)
 {
-    if (attr->name() == nameAttr) {
-        // Do nothing.
-    } else if (attr->name() == disabledAttr) {
+    if (attr->name() == nameAttr)
+        setNeedsStyleRecalc();
+    else if (attr->name() == disabledAttr) {
         bool oldDisabled = m_disabled;
         m_disabled = !attr->isNull();
         if (oldDisabled != m_disabled) {
@@ -105,6 +106,11 @@ void HTMLFormControlElement::parseMappedAttribute(MappedAttribute *attr)
             if (renderer() && renderer()->style()->hasAppearance())
                 renderer()->theme()->stateChanged(renderer(), ReadOnlyState);
         }
+    } else if (attr->name() == requiredAttr) {
+        bool oldRequired = m_required;
+        m_required = !attr->isNull();
+        if (oldRequired != m_required)
+            setNeedsStyleRecalc();
     } else
         HTMLElement::parseMappedAttribute(attr);
 }
@@ -219,7 +225,7 @@ void HTMLFormControlElement::setAutofocus(bool b)
 
 bool HTMLFormControlElement::required() const
 {
-    return hasAttribute(requiredAttr);
+    return m_required;
 }
 
 void HTMLFormControlElement::setRequired(bool b)
@@ -292,6 +298,14 @@ bool HTMLFormControlElement::checkValidity()
     return true;
 }
 
+void HTMLFormControlElement::updateValidity()
+{
+    if (willValidate()) {
+        // Update style for pseudo classes such as :valid :invalid.
+        setNeedsStyleRecalc();
+    }
+}
+
 void HTMLFormControlElement::setCustomValidity(const String& error)
 {
     validity()->setCustomErrorMessage(error);
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index 567e167..b5dc7ce 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -108,8 +108,8 @@ public:
 
     virtual bool willValidate() const;
     bool checkValidity();
+    void updateValidity();
     void setCustomValidity(const String&);
-
     virtual bool valueMissing() const { return false; }
     virtual bool patternMismatch() const { return false; }
     virtual bool tooLong() const { return false; }
@@ -129,9 +129,10 @@ private:
 
     HTMLFormElement* m_form;
     RefPtr<ValidityState> m_validityState;
-    bool m_disabled;
-    bool m_readOnly;
-    bool m_valueMatchesRenderer;
+    bool m_disabled : 1;
+    bool m_readOnly : 1;
+    bool m_required : 1;
+    bool m_valueMatchesRenderer : 1;
 };
 
 class HTMLFormControlElementWithState : public HTMLFormControlElement {
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 34877c7..fa0e343 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -474,6 +474,7 @@ void HTMLInputElement::setInputType(const String& t)
         }
 
         InputElement::notifyFormStateChanged(this);
+        updateValidity();
     }
     m_haveType = true;
 
@@ -694,6 +695,7 @@ void HTMLInputElement::parseMappedAttribute(MappedAttribute *attr)
         checkedRadioButtons(this).removeButton(this);
         m_data.setName(attr->value());
         checkedRadioButtons(this).addButton(this);
+        HTMLFormControlElementWithState::parseMappedAttribute(attr);
     } else if (attr->name() == autocompleteAttr) {
         if (equalIgnoringCase(attr->value(), "off")) {
             m_autocomplete = Off;
@@ -713,12 +715,14 @@ void HTMLInputElement::parseMappedAttribute(MappedAttribute *attr)
         if (m_data.value().isNull())
             setNeedsStyleRecalc();
         setFormControlValueMatchesRenderer(false);
+        updateValidity();
     } else if (attr->name() == checkedAttr) {
         m_defaultChecked = !attr->isNull();
         if (m_useDefaultChecked) {
             setChecked(m_defaultChecked);
             m_useDefaultChecked = true;
         }
+        updateValidity();
     } else if (attr->name() == maxlengthAttr)
         InputElement::parseMaxLengthAttribute(m_data, this, this, attr);
     else if (attr->name() == sizeAttr)
@@ -772,6 +776,8 @@ void HTMLInputElement::parseMappedAttribute(MappedAttribute *attr)
              attr->name() == multipleAttr ||
              attr->name() == precisionAttr)
         setNeedsStyleRecalc();
+    else if (attr->name() == patternAttr)
+        updateValidity();
 #if ENABLE(DATALIST)
     else if (attr->name() == listAttr)
         m_hasNonEmptyList = !attr->isEmpty();
@@ -1152,6 +1158,7 @@ void HTMLInputElement::setValue(const String& value)
             cacheSelection(max, max);
     }
     InputElement::notifyFormStateChanged(this);
+    updateValidity();
 }
 
 String HTMLInputElement::placeholder() const
@@ -1175,6 +1182,7 @@ void HTMLInputElement::setValueFromRenderer(const String& value)
     ASSERT(inputType() != FILE);
     updatePlaceholderVisibility(false);
     InputElement::setValueFromRenderer(m_data, this, this, value);
+    updateValidity();
 }
 
 void HTMLInputElement::setFileListFromRenderer(const Vector<String>& paths)
@@ -1186,6 +1194,7 @@ void HTMLInputElement::setFileListFromRenderer(const Vector<String>& paths)
 
     setFormControlValueMatchesRenderer(true);
     InputElement::notifyFormStateChanged(this);
+    updateValidity();
 }
 
 bool HTMLInputElement::storesValueSeparateFromAttribute() const
diff --git a/WebCore/html/HTMLTextAreaElement.cpp b/WebCore/html/HTMLTextAreaElement.cpp
index 1ca887d..3030018 100644
--- a/WebCore/html/HTMLTextAreaElement.cpp
+++ b/WebCore/html/HTMLTextAreaElement.cpp
@@ -298,6 +298,7 @@ void HTMLTextAreaElement::setValue(const String& value)
 
     setNeedsStyleRecalc();
     notifyFormStateChanged(this);
+    updateValidity();
 }
 
 String HTMLTextAreaElement::defaultValue() const
diff --git a/WebCore/rendering/RenderTextControlMultiLine.cpp b/WebCore/rendering/RenderTextControlMultiLine.cpp
index 8478432..a49e092 100644
--- a/WebCore/rendering/RenderTextControlMultiLine.cpp
+++ b/WebCore/rendering/RenderTextControlMultiLine.cpp
@@ -45,7 +45,9 @@ RenderTextControlMultiLine::~RenderTextControlMultiLine()
 void RenderTextControlMultiLine::subtreeHasChanged()
 {
     RenderTextControl::subtreeHasChanged();
-    static_cast<Element*>(node())->setFormControlValueMatchesRenderer(false);
+    HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(node());
+    textArea->setFormControlValueMatchesRenderer(false);
+    textArea->updateValidity();
 
     if (!node()->focused())
         return;
@@ -53,7 +55,7 @@ void RenderTextControlMultiLine::subtreeHasChanged()
     node()->dispatchEvent(Event::create(eventNames().inputEvent, true, false));
 
     if (Frame* frame = document()->frame())
-        frame->textDidChangeInTextArea(static_cast<Element*>(node()));
+        frame->textDidChangeInTextArea(textArea);
 }
 
 bool RenderTextControlMultiLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list