| 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;
|
| }
|
|
|
|
|