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

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

Issue 460343004: Fix update of validity cache value, so that it reflects the correct state of any FormControlElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP2 Created 6 years, 3 months 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
Index: Source/core/html/HTMLTextAreaElement.cpp
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp
index 8480199a6472428e6aefb13aeb91361ec073a5cf..efde5ee2ac29cc6dc207d99d44c96602bad08f5e 100644
--- a/Source/core/html/HTMLTextAreaElement.cpp
+++ b/Source/core/html/HTMLTextAreaElement.cpp
@@ -83,7 +83,6 @@ HTMLTextAreaElement::HTMLTextAreaElement(Document& document, HTMLFormElement* fo
, m_cols(defaultCols)
, m_wrap(SoftWrap)
, m_isDirty(false)
- , m_valueIsUpToDate(true)
{
ScriptWrappable::init(this);
}
@@ -268,7 +267,8 @@ void HTMLTextAreaElement::handleFocusEvent(Element*, FocusType)
void HTMLTextAreaElement::subtreeHasChanged()
{
setChangedSinceLastFormControlChangeEvent(true);
- m_valueIsUpToDate = false;
+ // Update Value to match the renderer
+ updateValue();
setNeedsValidityCheck();
setAutofilled(false);
@@ -317,12 +317,8 @@ String HTMLTextAreaElement::sanitizeUserInputValue(const String& proposedValue,
void HTMLTextAreaElement::updateValue() const
{
- if (m_valueIsUpToDate)
- return;
-
ASSERT(renderer());
m_value = innerEditorValue();
- const_cast<HTMLTextAreaElement*>(this)->m_valueIsUpToDate = true;
const_cast<HTMLTextAreaElement*>(this)->notifyFormStateChanged();
m_isDirty = true;
const_cast<HTMLTextAreaElement*>(this)->updatePlaceholderVisibility(false);
@@ -330,7 +326,6 @@ void HTMLTextAreaElement::updateValue() const
String HTMLTextAreaElement::value() const
{
- updateValue();
spartha 2014/09/02 14:09:55 Replaced by a call from subTreeChanged()
return m_value;
}
@@ -397,12 +392,6 @@ void HTMLTextAreaElement::setValueCommon(const String& newValue, TextFieldEventB
}
}
-void HTMLTextAreaElement::setInnerEditorValue(const String& value)
-{
- HTMLTextFormControlElement::setInnerEditorValue(value);
- m_valueIsUpToDate = true;
-}
-
String HTMLTextAreaElement::defaultValue() const
{
StringBuilder value;

Powered by Google App Engine
This is Rietveld 408576698