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

Unified Diff: third_party/WebKit/Source/platform/graphics/Color.cpp

Issue 2086433003: Disable 4 and 8 digit hex CSS colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 | « third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/Color.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Color.cpp b/third_party/WebKit/Source/platform/graphics/Color.cpp
index aefac181936d30089ca11d4d0cc5cde04c203ad2..fe2475d7cfc48af07be5669499b26fbe07b2c433 100644
--- a/third_party/WebKit/Source/platform/graphics/Color.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Color.cpp
@@ -26,6 +26,7 @@
#include "platform/graphics/Color.h"
#include "platform/Decimal.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "wtf/Assertions.h"
#include "wtf/HexNumber.h"
#include "wtf/MathExtras.h"
@@ -121,6 +122,8 @@ static inline bool parseHexColorInternal(const CharacterType* name, unsigned len
{
if (length != 3 && length != 4 && length != 6 && length != 8)
return false;
+ if ((length == 8 || length == 4) && !RuntimeEnabledFeatures::cssHexAlphaColorEnabled())
+ return false;
unsigned value = 0;
for (unsigned i = 0; i < length; ++i) {
if (!isASCIIHexDigit(name[i]))
« no previous file with comments | « third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698