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

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

Issue 2047413003: Disable 4 and 8 digit hex CSS colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 15506ea9067002c0c8c563e09b1d9904b19a9fe3..39cfb207752d0d7e92121e34e654c88f9d839228 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