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

Unified Diff: Source/core/rendering/RenderTheme.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/rendering/RenderTheme.h ('k') | Source/core/rendering/RenderThemeChromiumDefault.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderTheme.cpp
diff --git a/Source/core/rendering/RenderTheme.cpp b/Source/core/rendering/RenderTheme.cpp
index 61723c43088b2c2d90501cfc662adaf6811234ab..65fd69a48795bdae702e38b8b3a25bbdad111865 100644
--- a/Source/core/rendering/RenderTheme.cpp
+++ b/Source/core/rendering/RenderTheme.cpp
@@ -24,12 +24,18 @@
#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/InputTypeNames.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"
@@ -52,14 +58,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 {
@@ -456,6 +454,24 @@ bool RenderTheme::paintDecorations(RenderObject* o, const PaintInfo& paintInfo,
return false;
}
+String RenderTheme::extraDefaultStyleSheet()
+{
+ if (!RuntimeEnabledFeatures::dataListElementEnabled())
+ return String();
+ DEFINE_STATIC_LOCAL(String, dataListElementCSS, (ASCIILiteral("datalist {display: none ;}")));
+
+#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))
@@ -891,7 +907,6 @@ bool RenderTheme::paintMeter(RenderObject*, const PaintInfo&, const IntRect&)
return true;
}
-#if ENABLE(DATALIST_ELEMENT)
LayoutUnit RenderTheme::sliderTickSnappingThreshold() const
{
return 5;
@@ -978,7 +993,6 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo,
paintInfo.context->fillRect(tickRect);
}
}
-#endif
double RenderTheme::animationRepeatIntervalForProgressBar(RenderProgress*) const
{
« no previous file with comments | « Source/core/rendering/RenderTheme.h ('k') | Source/core/rendering/RenderThemeChromiumDefault.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698