Bug 1096469 - Make devedition theme work with custom devtools themes;r=Gijs

This commit is contained in:
Brian Grinstead 2014-11-11 17:33:18 -08:00
Родитель 8a1e12656a
Коммит 3a75421f43
2 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -53,8 +53,11 @@ let DevEdition = {
_updateDevtoolsThemeAttribute: function() {
// Set an attribute on root element to make it possible
// to change colors based on the selected devtools theme.
document.documentElement.setAttribute("devtoolstheme",
Services.prefs.getCharPref(this._devtoolsThemePrefName));
let devtoolsTheme = Services.prefs.getCharPref(this._devtoolsThemePrefName);
if (devtoolsTheme != "dark") {
devtoolsTheme = "light";
}
document.documentElement.setAttribute("devtoolstheme", devtoolsTheme);
ToolbarIconColor.inferFromText();
this._updateStyleSheetFromPrefs();
},

Просмотреть файл

@ -65,6 +65,11 @@ function testDevtoolsTheme() {
is (document.documentElement.getAttribute("devtoolstheme"), "dark",
"The documentElement has an attribute based on devtools theme.");
ok (DevEdition.styleSheet, "The devedition stylesheet is still there with the dark devtools theme.");
Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "foobar");
is (document.documentElement.getAttribute("devtoolstheme"), "light",
"The documentElement has 'light' as a default for the devtoolstheme attribute");
ok (DevEdition.styleSheet, "The devedition stylesheet is still there with the foobar devtools theme.");
}
function dummyLightweightTheme(id) {