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

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

Issue 14859003: Remove the compile time flag for DATALIST Element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebasing after r150849 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
« no previous file with comments | « Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp ('k') | Source/core/html/HTMLDataListElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/ColorInputType.cpp
diff --git a/Source/core/html/ColorInputType.cpp b/Source/core/html/ColorInputType.cpp
index 7cb6070c8aa176d87f8323982f3f529e2bfbea87..a8b7f60d374f93080ed5c949c471ce46b2390b46 100644
--- a/Source/core/html/ColorInputType.cpp
+++ b/Source/core/html/ColorInputType.cpp
@@ -33,6 +33,7 @@
#include "core/html/ColorInputType.h"
#include "CSSPropertyNames.h"
+#include "RuntimeEnabledFeatures.h"
#include "bindings/v8/ScriptController.h"
#include "core/dom/MouseEvent.h"
#include "core/dom/shadow/ElementShadow.h"
@@ -219,30 +220,29 @@ Color ColorInputType::currentColor()
bool ColorInputType::shouldShowSuggestions() const
{
-#if ENABLE(DATALIST_ELEMENT)
- return element()->fastHasAttribute(listAttr);
-#else
+ if (RuntimeEnabledFeatures::dataListElementEnabled())
+ return element()->fastHasAttribute(listAttr);
+
return false;
-#endif
}
Vector<Color> ColorInputType::suggestions() const
{
Vector<Color> suggestions;
-#if ENABLE(DATALIST_ELEMENT)
- HTMLDataListElement* dataList = element()->dataList();
- if (dataList) {
- RefPtr<HTMLCollection> options = dataList->options();
- for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); i++) {
- if (!element()->isValidValue(option->value()))
- continue;
- Color color(option->value());
- if (!color.isValid())
- continue;
- suggestions.append(color);
+ if (RuntimeEnabledFeatures::dataListElementEnabled()) {
+ HTMLDataListElement* dataList = element()->dataList();
+ if (dataList) {
+ RefPtr<HTMLCollection> options = dataList->options();
+ for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); i++) {
+ if (!element()->isValidValue(option->value()))
+ continue;
+ Color color(option->value());
+ if (!color.isValid())
+ continue;
+ suggestions.append(color);
+ }
}
}
-#endif
return suggestions;
}
« no previous file with comments | « Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp ('k') | Source/core/html/HTMLDataListElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698