diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebCore/html/HTMLInputElement.cpp | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebCore/html/HTMLInputElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLInputElement.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp index c5f1ebc..7ae6ad9 100644 --- a/Source/WebCore/html/HTMLInputElement.cpp +++ b/Source/WebCore/html/HTMLInputElement.cpp @@ -154,6 +154,17 @@ void HTMLInputElement::updateCheckedRadioButtons() renderer()->theme()->stateChanged(renderer(), CheckedState); } +bool HTMLInputElement::lastChangeWasUserEdit() const +{ + if (!isTextField()) + return false; + + if (!renderer()) + return false; + + return toRenderTextControl(renderer())->lastChangeWasUserEdit(); +} + bool HTMLInputElement::isValidValue(const String& value) const { if (!m_inputType->canSetStringValue()) { @@ -751,6 +762,7 @@ void HTMLInputElement::reset() if (m_inputType->storesValueSeparateFromAttribute()) setValue(String()); + setAutofilled(false); setChecked(hasAttribute(checkedAttr)); m_reflectsCheckedAttribute = true; } @@ -790,8 +802,10 @@ void HTMLInputElement::setChecked(bool nowChecked, bool sendChangeEvent) // unchecked to match other browsers. DOM is not a useful standard for this // because it says only to fire change events at "lose focus" time, which is // definitely wrong in practice for these types of elements. - if (sendChangeEvent && inDocument() && m_inputType->shouldSendChangeEventAfterCheckedChanged()) + if (sendChangeEvent && inDocument() && m_inputType->shouldSendChangeEventAfterCheckedChanged()) { + setTextAsOfLastFormControlChangeEvent(String()); dispatchFormControlChangeEvent(); + } } void HTMLInputElement::setIndeterminate(bool newValue) @@ -916,6 +930,9 @@ void HTMLInputElement::setValue(const String& value, bool sendChangeEvent) dispatchFormControlChangeEvent(); } + if (isText() && (!focused() || !sendChangeEvent)) + setTextAsOfLastFormControlChangeEvent(value); + InputElement::notifyFormStateChanged(this); } |