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

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

Issue 1797323003: DevTools: Hex colors aren't forced to uppercase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests Created 4 years, 9 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
Index: third_party/WebKit/Source/devtools/front_end/common/Color.js
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Color.js b/third_party/WebKit/Source/devtools/front_end/common/Color.js
index 9f8d9c40039bb7ae55ad60a517429e2ad34473cc..0de5370040f2a788018fa6af7b86aa1e450bdb7a 100644
--- a/third_party/WebKit/Source/devtools/front_end/common/Color.js
+++ b/third_party/WebKit/Source/devtools/front_end/common/Color.js
@@ -80,7 +80,7 @@ WebInspector.Color.parse = function(text)
var match = value.match(simple);
if (match) {
if (match[1]) { // hex
- var hex = match[1].toUpperCase();
+ var hex = match[1].toLowerCase();
var format;
if (hex.length === 3) {
format = WebInspector.Color.Format.ShortHEX;
@@ -327,11 +327,11 @@ WebInspector.Color.prototype = {
case WebInspector.Color.Format.HEX:
if (this.hasAlpha())
return null;
- return String.sprintf("#%s%s%s", toHexValue(this._rgba[0]), toHexValue(this._rgba[1]), toHexValue(this._rgba[2])).toUpperCase();
+ return String.sprintf("#%s%s%s", toHexValue(this._rgba[0]), toHexValue(this._rgba[1]), toHexValue(this._rgba[2])).toLowerCase();;
case WebInspector.Color.Format.ShortHEX:
if (!this.canBeShortHex())
return null;
- return String.sprintf("#%s%s%s", toShortHexValue(this._rgba[0]), toShortHexValue(this._rgba[1]), toShortHexValue(this._rgba[2])).toUpperCase();
+ return String.sprintf("#%s%s%s", toShortHexValue(this._rgba[0]), toShortHexValue(this._rgba[1]), toShortHexValue(this._rgba[2])).toLowerCase();;
case WebInspector.Color.Format.Nickname:
return this.nickname();
}

Powered by Google App Engine
This is Rietveld 408576698