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

Unified Diff: Source/core/html/HTMLTextAreaElement.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/HTMLTextAreaElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTextAreaElement.cpp
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp
index cd8c6eff88ee2e2287020cd402bed0eb14caed60..5afd82c8323cd93d4e9542beb484e6de9de23105 100644
--- a/Source/core/html/HTMLTextAreaElement.cpp
+++ b/Source/core/html/HTMLTextAreaElement.cpp
@@ -81,7 +81,6 @@ HTMLTextAreaElement::HTMLTextAreaElement(Document& document, HTMLFormElement* fo
, m_cols(defaultCols)
, m_wrap(SoftWrap)
, m_isDirty(false)
- , m_wasModifiedByUser(false)
{
setFormControlValueMatchesRenderer(true);
ScriptWrappable::init(this);
@@ -328,7 +327,6 @@ void HTMLTextAreaElement::updateValue() const
const_cast<HTMLTextAreaElement*>(this)->setFormControlValueMatchesRenderer(true);
const_cast<HTMLTextAreaElement*>(this)->notifyFormStateChanged();
m_isDirty = true;
- m_wasModifiedByUser = true;
const_cast<HTMLTextAreaElement*>(this)->updatePlaceholderVisibility(false);
}
@@ -354,7 +352,6 @@ void HTMLTextAreaElement::setNonDirtyValue(const String& value)
void HTMLTextAreaElement::setValueCommon(const String& newValue)
{
- m_wasModifiedByUser = false;
// Code elsewhere normalizes line endings added by the user via the keyboard or pasting.
// We normalize line endings coming from JavaScript here.
String normalizedValue = newValue.isNull() ? "" : newValue;
@@ -467,7 +464,7 @@ bool HTMLTextAreaElement::tooLong(const String& value, NeedsToCheckDirtyFlag che
{
// Return false for the default value or value set by script even if it is
// longer than maxLength.
- if (check == CheckDirtyFlag && !m_wasModifiedByUser)
+ if (check == CheckDirtyFlag && !lastChangeWasUserEdit())
return false;
int max = maxLength();
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698