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

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

Issue 2803483005: Remove lazy evaluation of HTMLTextAreaElement::value. (Closed)
Patch Set: Created 3 years, 8 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: third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
index 72ed028b4cbeeedb8b11a70ee2b477c549fddd10..5b436119ae4ca7c02e7181b50541c2853528dd11 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
@@ -76,7 +76,6 @@ HTMLTextAreaElement::HTMLTextAreaElement(Document& document)
m_cols(defaultCols),
m_wrap(SoftWrap),
m_isDirty(false),
- m_valueIsUpToDate(true),
m_isPlaceholderVisible(false) {}
HTMLTextAreaElement* HTMLTextAreaElement::create(Document& document) {
@@ -287,7 +286,7 @@ void HTMLTextAreaElement::subtreeHasChanged() {
#endif
addPlaceholderBreakElementIfNecessary();
setChangedSinceLastFormControlChangeEvent(true);
- m_valueIsUpToDate = false;
+ updateValue();
setNeedsValidityCheck();
setAutofilled(false);
updatePlaceholderVisibility();
@@ -360,19 +359,14 @@ String HTMLTextAreaElement::sanitizeUserInputValue(const String& proposedValue,
return proposedValue.left(i);
}
-void HTMLTextAreaElement::updateValue() const {
- if (m_valueIsUpToDate)
- return;
-
+void HTMLTextAreaElement::updateValue() {
m_value = innerEditorValue();
- const_cast<HTMLTextAreaElement*>(this)->m_valueIsUpToDate = true;
- const_cast<HTMLTextAreaElement*>(this)->notifyFormStateChanged();
+ notifyFormStateChanged();
m_isDirty = true;
- const_cast<HTMLTextAreaElement*>(this)->updatePlaceholderVisibility();
+ updatePlaceholderVisibility();
}
String HTMLTextAreaElement::value() const {
- updateValue();
return m_value;
}
@@ -443,11 +437,6 @@ void HTMLTextAreaElement::setValueCommon(
}
}
-void HTMLTextAreaElement::setInnerEditorValue(const String& value) {
- TextControlElement::setInnerEditorValue(value);
- m_valueIsUpToDate = true;
-}
-
String HTMLTextAreaElement::defaultValue() const {
StringBuilder value;
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextAreaElement.h ('k') | third_party/WebKit/Source/core/html/TextControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698