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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 1480523002: DevTools: follow up to r361550, fix the color picker background and allow for themed stylesheet mar… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: same Created 5 years, 1 month 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/ui/UIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
index 82cee9f58ad5eb7a7afe181f50d44b7f073d3c47..1b99a6dc2507a07c57c2f5f854afd233d1af3dcf 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -1539,6 +1539,9 @@ WebInspector.ThemeSupport.prototype = {
if (!this._hasTheme())
return;
+ if (this._themeName === "dark" || this._themeName === "bw" || this._themeName === "nostalgie")
+ document.body.classList.add("-theme-with-dark-background");
+
var styleSheets = document.styleSheets;
var result = [];
for (var i = 0; i < styleSheets.length; ++i)
@@ -1630,8 +1633,10 @@ WebInspector.ThemeSupport.prototype = {
if (name === "background-image" && value.indexOf("gradient") === -1)
return;
+ if (selectorText.indexOf("-theme-") !== -1)
+ return;
+
var isSelection = selectorText.indexOf("select") !== -1 || selectorText.indexOf("execution") !== -1;
- var isSyntax = selectorText.indexOf("cm-") === -1 && selectorText.indexOf("webkit-") === -1;
var isBackground = name.indexOf("background") === 0 || name.indexOf("border") === 0;
var isForeground = name.indexOf("background") === -1;
@@ -1640,7 +1645,7 @@ WebInspector.ThemeSupport.prototype = {
output.push(":");
var items = value.replace(colorRegex, "\0$1\0").split("\0");
for (var i = 0; i < items.length; ++i)
- output.push(this._patchColor(items[i], isSelection, isSyntax, isBackground, isForeground));
+ output.push(this._patchColor(items[i], isSelection, isBackground, isForeground));
if (style.getPropertyPriority(name))
output.push(" !important");
output.push(";");
@@ -1649,12 +1654,11 @@ WebInspector.ThemeSupport.prototype = {
/**
* @param {string} text
* @param {boolean} isSelection
- * @param {boolean} isSyntax
* @param {boolean} isBackground
* @param {boolean} isForeground
* @return {string}
*/
- _patchColor: function(text, isSelection, isSyntax, isBackground, isForeground)
+ _patchColor: function(text, isSelection, isBackground, isForeground)
{
var color = WebInspector.Color.parse(text);
if (!color)
@@ -1662,7 +1666,7 @@ WebInspector.ThemeSupport.prototype = {
var hsla = color.hsla();
- this._patchHSLA(hsla, isSelection, isSyntax, isBackground, isForeground);
+ this._patchHSLA(hsla, isSelection, isBackground, isForeground);
var rgba = [];
WebInspector.Color.hsl2rgb(hsla, rgba);
@@ -1676,11 +1680,10 @@ WebInspector.ThemeSupport.prototype = {
/**
* @param {!Array<number>} hsla
* @param {boolean} isSelection
- * @param {boolean} isSyntax
* @param {boolean} isBackground
* @param {boolean} isForeground
*/
- _patchHSLA: function(hsla, isSelection, isSyntax, isBackground, isForeground)
+ _patchHSLA: function(hsla, isSelection, isBackground, isForeground)
{
var hue = hsla[0];
var sat = hsla[1];
@@ -1722,20 +1725,16 @@ WebInspector.ThemeSupport.prototype = {
}
break;
case "bw":
- if (isSelectionBlue)
- hue = 27 / 360;
-
lit = 1 - lit;
if (lit > 0.98 && isForeground)
lit = 0.98;
- if (!isSyntax) {
- if (lit > 0.8)
- lit = 1;
- if (lit < 0.2)
- lit = 0;
- sat = 0;
- }
+ if (lit > 0.8)
+ lit = 1;
+ if (lit < 0.2)
+ lit = 0;
+ sat = 0;
+
break;
case "nostalgie":
lit = 1 - lit;

Powered by Google App Engine
This is Rietveld 408576698