зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 69c0d6c48015 (bug 1423626) on request for filled regressions on a CLOSED TREE
This commit is contained in:
Родитель
1bdfa1c2a6
Коммит
d0ef95540b
|
@ -3,7 +3,6 @@ support-files =
|
|||
head.js
|
||||
|
||||
[browser_ext_management_themes.js]
|
||||
[browser_ext_themes_alpha_accentcolor.js]
|
||||
[browser_ext_themes_chromeparity.js]
|
||||
[browser_ext_themes_dynamic_getCurrent.js]
|
||||
[browser_ext_themes_dynamic_onUpdated.js]
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
add_task(async function test_alpha_accentcolor() {
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": "rgba(230, 128, 0, 0.1)",
|
||||
"textcolor": TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
files: {
|
||||
"image1.png": BACKGROUND,
|
||||
},
|
||||
});
|
||||
|
||||
await extension.startup();
|
||||
|
||||
let docEl = window.document.documentElement;
|
||||
let style = window.getComputedStyle(docEl);
|
||||
|
||||
Assert.equal(style.backgroundColor, "rgb(230, 128, 0)",
|
||||
"Window background color should be opaque");
|
||||
|
||||
await extension.unload();
|
||||
});
|
|
@ -127,10 +127,9 @@ LightweightThemeConsumer.prototype = {
|
|||
// so if we don't reset first, it'll keep the old value.
|
||||
root.style.removeProperty("--lwt-text-color");
|
||||
root.style.removeProperty("--lwt-accent-color");
|
||||
let textcolor = aData.textcolor || "black";
|
||||
let textcolor = this._sanitizeCSSColor(aData.textcolor) || "black";
|
||||
_setProperty(root, active, "--lwt-text-color", textcolor);
|
||||
_setProperty(root, active, "--lwt-accent-color", this._sanitizeCSSColor(aData.accentcolor) || "white");
|
||||
|
||||
if (active) {
|
||||
let dummy = this._doc.createElement("dummy");
|
||||
dummy.style.color = textcolor;
|
||||
|
@ -176,12 +175,10 @@ LightweightThemeConsumer.prototype = {
|
|||
span.style.color = cssColor;
|
||||
cssColor = span.style.color;
|
||||
if (cssColor == "transparent" ||
|
||||
cssColor == "rgba(0, 0, 0, 0)" ||
|
||||
!cssColor) {
|
||||
cssColor == "rgba(0, 0, 0, 0)") {
|
||||
return "";
|
||||
}
|
||||
// Remove alpha channel from color
|
||||
return `rgb(${_parseRGB(cssColor).join(", ")})`;
|
||||
return cssColor;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче