Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Unified Diff: Source/core/html/HTMLInputElement.cpp

Issue 85513002: Refactoring: Removing an extra boolean 'm_wasModifiedByUser' from (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLInputElement.h ('k') | Source/core/html/HTMLTextAreaElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index 8ac7944bfbb02101b1bde149798faae64f38749e..67a2115689802a2c80437a9328f44b51beb6df3d 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -117,7 +117,6 @@ HTMLInputElement::HTMLInputElement(Document& document, HTMLFormElement* form, bo
, m_stateRestored(false)
, m_parsingInProgress(createdByParser)
, m_valueAttributeWasUpdatedAfterParsing(false)
- , m_wasModifiedByUser(false)
, m_canReceiveDroppedFiles(false)
, m_hasTouchEventHandler(false)
, m_inputType(InputType::createText(*this))
@@ -244,7 +243,7 @@ bool HTMLInputElement::tooLong(const String& value, NeedsToCheckDirtyFlag check)
if (check == CheckDirtyFlag) {
// Return false for the default value or a value set by a script even if
// it is longer than maxLength.
- if (!hasDirtyValue() || !m_wasModifiedByUser)
+ if (!hasDirtyValue() || !lastChangeWasUserEdit())
return false;
}
return value.length() > static_cast<unsigned>(max);
@@ -456,8 +455,6 @@ void HTMLInputElement::updateType()
setFormControlValueMatchesRenderer(false);
m_inputTypeView->updateView();
- m_wasModifiedByUser = false;
-
if (didRespectHeightAndWidth != m_inputType->shouldRespectHeightAndWidthAttributes()) {
ASSERT(elementData());
if (const Attribute* height = getAttributeItem(heightAttr))
@@ -923,7 +920,6 @@ void HTMLInputElement::copyNonAttributePropertiesFromElement(const Element& sour
const HTMLInputElement& sourceElement = static_cast<const HTMLInputElement&>(source);
m_valueIfDirty = sourceElement.m_valueIfDirty;
- m_wasModifiedByUser = false;
setChecked(sourceElement.m_isChecked);
m_reflectsCheckedAttribute = sourceElement.m_reflectsCheckedAttribute;
m_isIndeterminate = sourceElement.m_isIndeterminate;
@@ -1035,7 +1031,6 @@ void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even
void HTMLInputElement::setValueInternal(const String& sanitizedValue, TextFieldEventBehavior eventBehavior)
{
m_valueIfDirty = sanitizedValue;
- m_wasModifiedByUser = eventBehavior != DispatchNoEvent;
setNeedsValidityCheck();
}
@@ -1076,7 +1071,6 @@ void HTMLInputElement::setValueFromRenderer(const String& value)
m_valueIfDirty = value;
setFormControlValueMatchesRenderer(true);
- m_wasModifiedByUser = true;
// Input event is fired by the Node::defaultEventHandler for editable controls.
if (!isTextField())
« no previous file with comments | « Source/core/html/HTMLInputElement.h ('k') | Source/core/html/HTMLTextAreaElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698