Index: Source/core/rendering/RenderTheme.cpp |
diff --git a/Source/core/rendering/RenderTheme.cpp b/Source/core/rendering/RenderTheme.cpp |
index 5f5a0e4994797e61db6de27fb76dcc8febd103e7..f91f5d6c50ea474a4e3d9bcec430fe8e4f8485a3 100644 |
--- a/Source/core/rendering/RenderTheme.cpp |
+++ b/Source/core/rendering/RenderTheme.cpp |
@@ -24,11 +24,17 @@ |
#include "CSSValueKeywords.h" |
#include "HTMLNames.h" |
+#include "RuntimeEnabledFeatures.h" |
#include "core/dom/Document.h" |
+#include "core/dom/shadow/ElementShadow.h" |
#include "core/editing/FrameSelection.h" |
#include "core/fileapi/FileList.h" |
+#include "core/html/HTMLCollection.h" |
+#include "core/html/HTMLDataListElement.h" |
#include "core/html/HTMLInputElement.h" |
#include "core/html/HTMLMeterElement.h" |
+#include "core/html/HTMLOptionElement.h" |
+#include "core/html/parser/HTMLParserIdioms.h" |
#include "core/html/shadow/MediaControlElements.h" |
#include "core/html/shadow/SpinButtonElement.h" |
#include "core/html/shadow/TextControlInnerElements.h" |
@@ -51,14 +57,6 @@ |
#include "core/rendering/RenderInputSpeech.h" |
#endif |
-#if ENABLE(DATALIST_ELEMENT) |
-#include "core/dom/shadow/ElementShadow.h" |
-#include "core/html/HTMLCollection.h" |
-#include "core/html/HTMLDataListElement.h" |
-#include "core/html/HTMLOptionElement.h" |
-#include "core/html/parser/HTMLParserIdioms.h" |
-#endif |
- |
// The methods in this file are shared by all themes on every platform. |
namespace WebCore { |
@@ -455,6 +453,24 @@ bool RenderTheme::paintDecorations(RenderObject* o, const PaintInfo& paintInfo, |
return false; |
} |
+String RenderTheme::extraDefaultStyleSheet() |
+{ |
+ if (!RuntimeEnabledFeature::dataListElementEnabled()) |
+ return String(); |
+ static String dataListElementCSS = (RuntimeEnabledFeatures::dataListElementEnabled()) ? ASCIILiteral("datalist {display: none ;}") : ASCIILiteral(""); |
tkent
2013/05/22 01:09:08
You don't need to check the runtime flag again.
|
+ |
+#if ENABLE(INPUT_TYPE_COLOR) |
+ StringBuilder inputTypeCSS; |
+ inputTypeCSS.appendLiteral("input[type=\"color\"][list] { -webkit-appearance: menulist; width: 88px; height: 23px;}"); |
+ inputTypeCSS.appendLiteral("input[type=\"color\"][list]::-webkit-color-swatch-wrapper { padding-left: 8px; padding-right: 24px;}"); |
+ inputTypeCSS.appendLiteral("input[type=\"color\"][list]::-webkit-color-swatch { border-color: #000000;}"); |
+ inputTypeCSS.append(dataListElementCSS); |
+ return inputTypeCSS.toString(); |
+#endif |
+ |
+ return dataListElementCSS; |
+} |
+ |
String RenderTheme::formatMediaControlsTime(float time) const |
{ |
if (!std::isfinite(time)) |
@@ -890,7 +906,6 @@ bool RenderTheme::paintMeter(RenderObject*, const PaintInfo&, const IntRect&) |
return true; |
} |
-#if ENABLE(DATALIST_ELEMENT) |
LayoutUnit RenderTheme::sliderTickSnappingThreshold() const |
{ |
return 0; |
@@ -977,7 +992,6 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo, |
paintInfo.context->fillRect(tickRect); |
} |
} |
-#endif |
double RenderTheme::animationRepeatIntervalForProgressBar(RenderProgress*) const |
{ |