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

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

Issue 2424983004: Introduce enum InputType::ValueMode. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/BaseButtonInputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLInputElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
index 7acf9f402fdb1a966113b2b3a293182c44865dd9..312c7f4dbbb63cb2a8c9c8fb46630cd82524b30f 100644
--- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -78,6 +78,7 @@
namespace blink {
+using ValueMode = InputType::ValueMode;
using namespace HTMLNames;
class ListAttributeTargetObserver : public IdTargetObserver {
@@ -415,7 +416,8 @@ void HTMLInputElement::updateType() {
InputType* newType = InputType::create(*this, newTypeName);
removeFromRadioButtonGroup();
- bool didStoreValue = m_inputType->storesValueSeparateFromAttribute();
+ bool didStoreValue = m_inputType->valueMode() == ValueMode::kValue ||
+ m_inputType->valueMode() == ValueMode::kFilename;
bool didRespectHeightAndWidth =
m_inputType->shouldRespectHeightAndWidthAttributes();
bool couldBeSuccessfulSubmitButton = canBeSuccessfulSubmitButton();
@@ -429,7 +431,8 @@ void HTMLInputElement::updateType() {
setNeedsWillValidateCheck();
- bool willStoreValue = m_inputType->storesValueSeparateFromAttribute();
+ bool willStoreValue = m_inputType->valueMode() == ValueMode::kValue ||
+ m_inputType->valueMode() == ValueMode::kFilename;
// https://html.spec.whatwg.org/multipage/forms.html#input-type-change
//
@@ -874,7 +877,8 @@ String HTMLInputElement::resultForDialogSubmit() {
}
void HTMLInputElement::resetImpl() {
- if (m_inputType->storesValueSeparateFromAttribute()) {
+ if (m_inputType->valueMode() == ValueMode::kValue ||
+ m_inputType->valueMode() == ValueMode::kFilename) {
setValue(String());
setNeedsValidityCheck();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/BaseButtonInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698