зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset aa3d66cd3c40 (bug 1415872) for ES failure in toolkit/components/extensions/test/browser/head.js:37:7 r=backout on a CLOSED TREE
--HG-- extra : amend_source : f07f736626fd98258d126f5d63a614297695ab4a
This commit is contained in:
Родитель
5c136a9918
Коммит
e515bbaf88
|
@ -463,7 +463,7 @@ tabbrowser {
|
|||
}
|
||||
|
||||
.tabbrowser-tab[visuallyselected=true]:-moz-lwtheme {
|
||||
color: var(--theme-tab-text, var(--toolbar-color, inherit));
|
||||
color: var(--toolbar-color, inherit);
|
||||
}
|
||||
|
||||
.tab-line {
|
||||
|
|
|
@ -130,7 +130,7 @@ class Theme {
|
|||
this.lwtStyles.accentcolor = cssColor;
|
||||
break;
|
||||
case "textcolor":
|
||||
case "background_tab_text":
|
||||
case "tab_text":
|
||||
this.lwtStyles.textcolor = cssColor;
|
||||
break;
|
||||
case "toolbar":
|
||||
|
@ -140,7 +140,6 @@ class Theme {
|
|||
case "bookmark_text":
|
||||
this.lwtStyles.toolbar_text = cssColor;
|
||||
break;
|
||||
case "tab_text":
|
||||
case "toolbar_field":
|
||||
case "toolbar_field_text":
|
||||
case "toolbar_top_separator":
|
||||
|
|
|
@ -54,18 +54,14 @@
|
|||
},
|
||||
"optional": true
|
||||
},
|
||||
"textcolor": {
|
||||
"type": "string",
|
||||
"optional": true
|
||||
},
|
||||
"background_tab_text": {
|
||||
"tab_text": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
},
|
||||
"optional": true
|
||||
},
|
||||
"tab_text": {
|
||||
"textcolor": {
|
||||
"type": "string",
|
||||
"optional": true
|
||||
},
|
||||
|
|
|
@ -13,6 +13,5 @@ support-files =
|
|||
[browser_ext_themes_persistence.js]
|
||||
[browser_ext_themes_separators.js]
|
||||
[browser_ext_themes_static_onUpdated.js]
|
||||
[browser_ext_themes_tab_text.js]
|
||||
[browser_ext_themes_toolbar_fields.js]
|
||||
[browser_ext_themes_toolbars.js]
|
||||
|
|
|
@ -17,7 +17,7 @@ add_task(async function test_support_theme_frame() {
|
|||
},
|
||||
"colors": {
|
||||
"frame": FRAME_COLOR,
|
||||
"background_tab_text": TAB_TEXT_COLOR,
|
||||
"tab_text": TAB_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@ add_task(async function test_support_backgrounds_position() {
|
|||
},
|
||||
"colors": {
|
||||
"accentcolor": `rgb(${FRAME_COLOR.join(",")})`,
|
||||
"textcolor": `rgb(${BACKGROUND_TAB_TEXT_COLOR.join(",")})`,
|
||||
"textcolor": `rgb(${TAB_TEXT_COLOR.join(",")})`,
|
||||
},
|
||||
"properties": {
|
||||
"additional_backgrounds_alignment": ["left top", "center top", "right bottom"],
|
||||
|
@ -67,7 +67,7 @@ add_task(async function test_support_backgrounds_repeat() {
|
|||
},
|
||||
"colors": {
|
||||
"frame": FRAME_COLOR,
|
||||
"background_tab_text": BACKGROUND_TAB_TEXT_COLOR,
|
||||
"tab_text": TAB_TEXT_COLOR,
|
||||
},
|
||||
"properties": {
|
||||
"additional_backgrounds_tiling": ["repeat-x", "repeat-y", "repeat"],
|
||||
|
@ -115,7 +115,7 @@ add_task(async function test_additional_images_check() {
|
|||
},
|
||||
"colors": {
|
||||
"frame": FRAME_COLOR,
|
||||
"background_tab_text": BACKGROUND_TAB_TEXT_COLOR,
|
||||
"tab_text": TAB_TEXT_COLOR,
|
||||
},
|
||||
"properties": {
|
||||
"additional_backgrounds_tiling": ["repeat-x", "repeat-y", "repeat"],
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
// This test checks whether applied WebExtension themes that attempt to change
|
||||
// the background color of toolbars are applied properly.
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_support_toolbar_property() {
|
||||
const TAB_TEXT_COLOR = "#9400ff";
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"tab_text": TAB_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
files: {
|
||||
"image1.png": BACKGROUND,
|
||||
},
|
||||
});
|
||||
|
||||
await extension.startup();
|
||||
|
||||
info("Checking selected tab colors");
|
||||
let selectedTab = document.querySelector(".tabbrowser-tab[selected]");
|
||||
Assert.equal(window.getComputedStyle(selectedTab).color,
|
||||
"rgb(" + hexToRGB(TAB_TEXT_COLOR).join(", ") + ")", "Selected tab text color should be set.");
|
||||
|
||||
await extension.unload();
|
||||
});
|
|
@ -34,7 +34,7 @@ const ACCENT_COLOR = "#a14040";
|
|||
const TEXT_COLOR = "#fac96e";
|
||||
// For testing aliases of the colors above:
|
||||
const FRAME_COLOR = [71, 105, 91];
|
||||
const BACKGROUND_TAB_TEXT_COLOR = [207, 221, 192, .9];
|
||||
const TAB_TEXT_COLOR = [207, 221, 192, .9];
|
||||
|
||||
function hexToRGB(hex) {
|
||||
hex = parseInt((hex.indexOf("#") > -1 ? hex.substring(1) : hex), 16);
|
||||
|
|
|
@ -16,7 +16,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
|
|||
const kCSSVarsMap = new Map([
|
||||
["--lwt-background-alignment", "backgroundsAlignment"],
|
||||
["--lwt-background-tiling", "backgroundsTiling"],
|
||||
["--theme-tab-text", "tab_text"],
|
||||
["--toolbar-bgcolor", "toolbarColor"],
|
||||
["--toolbar-color", "toolbar_text"],
|
||||
["--url-and-searchbar-background-color", "toolbar_field"],
|
||||
|
|
Загрузка…
Ссылка в новой задаче