зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset db927eedd355 (bug 1504766) for multiple failures e.g browser_ext_management_themes.js. CLOSED TREE
This commit is contained in:
Родитель
9c1af40b1a
Коммит
8cbfee3cf7
|
@ -70,15 +70,10 @@
|
|||
:root[sizemode=normal][tabsintitlebar] {
|
||||
border-top: 1px solid -moz-win-accentcolor;
|
||||
}
|
||||
:root[tabsintitlebar]:not(:-moz-window-inactive):not(:-moz-lwtheme),
|
||||
:root[tabsintitlebar]:not(:-moz-window-inactive)[lwt-default-theme-in-dark-mode] {
|
||||
:root[tabsintitlebar]:not(:-moz-window-inactive):not(:-moz-lwtheme) {
|
||||
background-color: -moz-win-accentcolor;
|
||||
color: -moz-win-accentcolortext;
|
||||
}
|
||||
:root[tabsintitlebar][lwt-default-theme-in-dark-mode] #titlebar {
|
||||
--lwt-toolbarbutton-icon-fill: currentColor;
|
||||
--toolbarbutton-icon-fill-opacity: .7;
|
||||
}
|
||||
}
|
||||
|
||||
:root[sizemode=normal][tabsintitlebar]:-moz-window-inactive {
|
||||
|
|
|
@ -4,6 +4,17 @@
|
|||
|
||||
%include ../shared/compacttheme.inc.css
|
||||
|
||||
@media (-moz-windows-default-theme) and (-moz-windows-accent-color-in-titlebar) {
|
||||
:root[tabsintitlebar]:not(:-moz-window-inactive) {
|
||||
background-color: -moz-win-accentcolor;
|
||||
color: -moz-win-accentcolortext;
|
||||
}
|
||||
:root[tabsintitlebar] #titlebar {
|
||||
--lwt-toolbarbutton-icon-fill: currentColor;
|
||||
--toolbarbutton-icon-fill-opacity: .7;
|
||||
}
|
||||
}
|
||||
|
||||
/* The window background is white due to no accentcolor in the lightweight
|
||||
theme. It can't be changed to transparent when there is no compositor
|
||||
(Win 7 in classic / basic theme), or else dragging and focus become
|
||||
|
|
|
@ -129,16 +129,16 @@ function LightweightThemeConsumer(aDocument) {
|
|||
|
||||
Services.obs.addObserver(this, "lightweight-theme-styling-update");
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/LightweightThemeManager.jsm", this);
|
||||
|
||||
this._darkThemeMediaQuery = this._win.matchMedia("(-moz-system-dark-theme)");
|
||||
this._darkThemeMediaQuery.addListener(this.LightweightThemeManager);
|
||||
this.LightweightThemeManager.systemThemeChanged(this._darkThemeMediaQuery);
|
||||
|
||||
this._update(this.LightweightThemeManager.currentThemeWithPersistedData);
|
||||
var temp = {};
|
||||
ChromeUtils.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
|
||||
this._update(temp.LightweightThemeManager.currentThemeWithPersistedData);
|
||||
|
||||
this._win.addEventListener("resolutionchange", this);
|
||||
this._win.addEventListener("unload", this, { once: true });
|
||||
|
||||
let darkThemeMediaQuery = this._win.matchMedia("(-moz-system-dark-theme)");
|
||||
darkThemeMediaQuery.addListener(temp.LightweightThemeManager);
|
||||
temp.LightweightThemeManager.systemThemeChanged(darkThemeMediaQuery);
|
||||
}
|
||||
|
||||
LightweightThemeConsumer.prototype = {
|
||||
|
@ -173,8 +173,7 @@ LightweightThemeConsumer.prototype = {
|
|||
Services.obs.removeObserver(this, "lightweight-theme-styling-update");
|
||||
Services.ppmm.sharedData.delete(`theme/${this._winId}`);
|
||||
this._win.removeEventListener("resolutionchange", this);
|
||||
this._darkThemeMediaQuery.removeListener(this.LightweightThemeManager);
|
||||
this._win = this._doc = this._darkThemeMediaQuery = null;
|
||||
this._win = this._doc = null;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
@ -184,22 +183,13 @@ LightweightThemeConsumer.prototype = {
|
|||
if (theme) {
|
||||
theme = LightweightThemeImageOptimizer.optimize(theme, this._win.screen);
|
||||
}
|
||||
|
||||
let active = this._active = theme && theme.id !== DEFAULT_THEME_ID;
|
||||
|
||||
if (!theme) {
|
||||
theme = {};
|
||||
}
|
||||
|
||||
let active = this._active = (theme.id != DEFAULT_THEME_ID);
|
||||
|
||||
// The theme we're switching to can be different from the user-selected
|
||||
// theme. E.g. if the default theme is selected and the OS is in dark mode,
|
||||
// we'd silently activate the dark theme if available. We set an attribute
|
||||
// in that case so stylesheets can differentiate this from the dark theme
|
||||
// being selected explicitly by the user.
|
||||
let isDefaultThemeInDarkMode =
|
||||
theme.id == this.LightweightThemeManager.defaultDarkThemeID &&
|
||||
this.LightweightThemeManager.selectedThemeID == DEFAULT_THEME_ID &&
|
||||
this._darkThemeMediaQuery.matches;
|
||||
|
||||
let root = this._doc.documentElement;
|
||||
|
||||
if (active && theme.headerURL) {
|
||||
|
@ -231,11 +221,6 @@ LightweightThemeConsumer.prototype = {
|
|||
root.removeAttribute("lwtheme");
|
||||
root.removeAttribute("lwthemetextcolor");
|
||||
}
|
||||
if (isDefaultThemeInDarkMode) {
|
||||
root.setAttribute("lwt-default-theme-in-dark-mode", "true");
|
||||
} else {
|
||||
root.removeAttribute("lwt-default-theme-in-dark-mode");
|
||||
}
|
||||
|
||||
let contentThemeData = _getContentProperties(this._doc, active, theme);
|
||||
Services.ppmm.sharedData.set(`theme/${this._winId}`, contentThemeData);
|
||||
|
|
|
@ -102,14 +102,6 @@ var LightweightThemeManager = {
|
|||
return this._builtInThemes.has(theme.id);
|
||||
},
|
||||
|
||||
get selectedThemeID() {
|
||||
return _prefs.getStringPref("selectedThemeID") || DEFAULT_THEME_ID;
|
||||
},
|
||||
|
||||
get defaultDarkThemeID() {
|
||||
return _defaultDarkThemeID;
|
||||
},
|
||||
|
||||
get usedThemes() {
|
||||
let themes = [];
|
||||
try {
|
||||
|
@ -128,8 +120,9 @@ var LightweightThemeManager = {
|
|||
* locally persisted resources.
|
||||
*/
|
||||
get currentTheme() {
|
||||
let selectedThemeID = _prefs.getStringPref("selectedThemeID", DEFAULT_THEME_ID);
|
||||
|
||||
let data = null;
|
||||
let selectedThemeID = this.selectedThemeID;
|
||||
if (selectedThemeID) {
|
||||
data = this.getUsedTheme(selectedThemeID);
|
||||
}
|
||||
|
@ -213,7 +206,7 @@ var LightweightThemeManager = {
|
|||
|
||||
this._builtInThemes.set(theme.id, theme);
|
||||
|
||||
if (this.selectedThemeID == theme.id) {
|
||||
if (_prefs.getStringPref("selectedThemeID", DEFAULT_THEME_ID) == theme.id) {
|
||||
this.currentTheme = theme;
|
||||
}
|
||||
|
||||
|
@ -375,7 +368,7 @@ var LightweightThemeManager = {
|
|||
return;
|
||||
}
|
||||
|
||||
let selectedID = this.selectedThemeID;
|
||||
let selectedID = _prefs.getStringPref("selectedThemeID", DEFAULT_THEME_ID);
|
||||
let newThemes = await Promise.all(allThemes.map(
|
||||
t => this._updateOneTheme(t, t.id == selectedID).catch(err => {})));
|
||||
newThemes = newThemes.filter(t => t);
|
||||
|
@ -508,7 +501,7 @@ var LightweightThemeManager = {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.selectedThemeID != DEFAULT_THEME_ID) {
|
||||
if (_prefs.getStringPref("selectedThemeID", "") != DEFAULT_THEME_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче