diff options
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); } |