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

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

Issue 23623017: Prepare for date/time input datalist support (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
Index: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index cf8ff23e6d3f33d0beaf50c0b7278d4f12b00381..8e19987bce428357cf4d2349b2622a4a4276b0ec 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -1831,7 +1831,7 @@ bool HTMLInputElement::setupDateTimeChooserParameters(DateTimeChooserParameters&
}
parameters.anchorRectInRootView = document().view()->contentsToRootView(pixelSnappedBoundingBox());
- parameters.currentValue = value();
+ parameters.currentValue = m_inputType->valueAsDouble();
parameters.isAnchorElementRTL = computedStyle()->direction() == RTL;
if (RuntimeEnabledFeatures::dataListElementEnabled()) {
if (HTMLDataListElement* dataList = this->dataList()) {
@@ -1839,9 +1839,11 @@ bool HTMLInputElement::setupDateTimeChooserParameters(DateTimeChooserParameters&
for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); ++i) {
if (!isValidValue(option->value()))
continue;
- parameters.suggestionValues.append(sanitizeValue(option->value()));
- parameters.localizedSuggestionValues.append(localizeValue(option->value()));
- parameters.suggestionLabels.append(option->value() == option->label() ? String() : option->label());
+ DateTimeSuggestion suggestion;
+ suggestion.value = m_inputType->parseToNumber(option->value(), -1).toDouble();
+ suggestion.localizedValue = localizeValue(option->value());
+ suggestion.label = option->value() == option->label() ? String() : option->label();
+ parameters.suggestions.append(suggestion);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698