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

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

Issue 14859003: Remove the compile time flag for DATALIST Element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tkent's comments (Part 2) Created 7 years, 7 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/BaseMultipleFieldsDateAndTimeInputType.cpp
diff --git a/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp b/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
index 8df813983ed666d81ca16e8220aedf0685bee701..2fa034201fef819857bad3b7f2af255431d001b2 100644
--- a/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
+++ b/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
@@ -33,6 +33,7 @@
#include "core/html/BaseMultipleFieldsDateAndTimeInputType.h"
#include "CSSValueKeywords.h"
+#include "RuntimeEnabledFeatures.h"
#include "core/dom/KeyboardEvent.h"
#include "core/dom/NodeTraversal.h"
#include "core/dom/shadow/ElementShadow.h"
@@ -307,10 +308,8 @@ void BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree()
container->appendChild(spinButton);
bool shouldAddPickerIndicator = false;
-#if ENABLE(DATALIST_ELEMENT)
if (InputType::themeSupportsDataListUI(this))
shouldAddPickerIndicator = true;
-#endif
RefPtr<RenderTheme> theme = document->page() ? document->page()->theme() : RenderTheme::defaultTheme();
if (theme->supportsCalendarPicker(formControlType())) {
shouldAddPickerIndicator = true;
@@ -502,12 +501,10 @@ void BaseMultipleFieldsDateAndTimeInputType::valueAttributeChanged()
updateInnerTextValue();
}
-#if ENABLE(DATALIST_ELEMENT)
void BaseMultipleFieldsDateAndTimeInputType::listAttributeTargetChanged()
{
updatePickerIndicatorVisibility();
}
-#endif
void BaseMultipleFieldsDateAndTimeInputType::updatePickerIndicatorVisibility()
{
@@ -515,18 +512,18 @@ void BaseMultipleFieldsDateAndTimeInputType::updatePickerIndicatorVisibility()
showPickerIndicator();
return;
}
-#if ENABLE(DATALIST_ELEMENT)
- if (HTMLDataListElement* dataList = element()->dataList()) {
- RefPtr<HTMLCollection> options = dataList->options();
- for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); ++i) {
- if (element()->isValidValue(option->value())) {
- showPickerIndicator();
- return;
+ if (RuntimeEnabledFeatures::dataListElementEnabled()) {
+ if (HTMLDataListElement* dataList = element()->dataList()) {
+ RefPtr<HTMLCollection> options = dataList->options();
+ for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); ++i) {
+ if (element()->isValidValue(option->value())) {
+ showPickerIndicator();
+ return;
+ }
}
}
+ hidePickerIndicator();
}
- hidePickerIndicator();
-#endif
}
void BaseMultipleFieldsDateAndTimeInputType::hidePickerIndicator()

Powered by Google App Engine
This is Rietveld 408576698