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

Unified Diff: Source/devtools/front_end/common/Color.js

Issue 1313863003: Devtools Color: Support decimal values which omit 0 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update expectations Created 5 years, 4 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 | « LayoutTests/inspector/elements/styles-4/styles-invalid-color-values-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/common/Color.js
diff --git a/Source/devtools/front_end/common/Color.js b/Source/devtools/front_end/common/Color.js
index 06e80e41211bedcfddff7d78386a7771a31bfa80..2be3c2589303442c4f6b555f40d7ed3f5edc4338 100644
--- a/Source/devtools/front_end/common/Color.js
+++ b/Source/devtools/front_end/common/Color.js
@@ -127,7 +127,7 @@ WebInspector.Color.parse = function(text)
}
// Advanced - rgba(), hsla()
- var advanced = /^(?:rgba\(((?:-?\d+%?,){3}-?\d+(?:\.\d+)?)\)|hsla\((-?\d+\.?\d*(?:,-?\d+\.?\d*%){2},-?\d+(?:\.\d+)?)\))$/;
+ var advanced = /^(?:rgba\(((?:-?\d+%?,){3}-?(?:\d+|\d*\.\d+))\)|hsla\((-?(?:\d+|\d*\.\d+)(?:,-?(?:\d+|\d*\.\d+)*%){2},-?(?:\d+|\d*\.\d+))\))$/;
match = value.match(advanced);
if (match) {
if (match[1]) { // rgba
« no previous file with comments | « LayoutTests/inspector/elements/styles-4/styles-invalid-color-values-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698