The function used to parse the variables.css file and do some regex matching
on the light/dark theme rules to extract the declaration value of a variable.
This patch makes the function simpler by getting the computed value of the
CSS variable, which automatically adapt to the current theme since we do set
`color-scheme` value properly when setting a theme.
In order for this to work properly, the variables that might be used in this
function need to be registered so the engine know they are colors.
We take this as an opportunity to rename the function to `getCssVariableColor`,
which is more explicit, and also make it take the actual CSS variable name,
and not only the suffix part that comes after `--theme-` for better grep-ability.
The test in browser_theme.js is adapted to reflect those changes.
Differential Revision: https://phabricator.services.mozilla.com/D220718
This adds a `forced-colors-active` attribute on documentElements when:
- `devtools.high-contrast-mode-support` is set to true
- the selected theme is "auto"
- and high contrast mode is enabled.
This way we can style specifically for HCM with `:root[forced-colors-active]`.
`browser_theme_switching.js` is extended to run assertion on this attribute.
Differential Revision: https://phabricator.services.mozilla.com/D214937
This will help transition to ES Modules as this symbol is exposed to them.
$ sed -ie "/require(.Services.)/d" $(git grep -l 'require("Services")' devtools/)
$ sed -ie "/loader.lazyRequireGetter(this, .Services./d" $(git grep -l 'loader.lazyRequireGetter(this, "Services"' devtools/)
+ the edition of builtin-modules.js + eslintrc.js
+ manual eslint fixes
+ removal of devtools-services in the debugger, except for jest tests
Differential Revision: https://phabricator.services.mozilla.com/D156401
The toolbar pref change triggers eventually a look-and-feel-changed
notification, so no need to observe that directly.
Depends on D128674
Differential Revision: https://phabricator.services.mozilla.com/D128675
Added gDevTools.getTheme() to provide the theme name, and a gDevTools "theme-changed"
event to provide a notification when the theme is changed.
MozReview-Commit-ID: EeUAmtyPpUy
For simple rules like function spacing, we can auto-fix these across the code
base so they are followed in a consistent way.
To generate this patch, I ran:
./mach eslint devtools --no-ignore --fix
After this, I reverted any changes to third party files that we really do want
to ignore.
MozReview-Commit-ID: 6Q8BApkAW20
Break DevTools theme files out of browser.jar and move to a new DevTools
specific jar. Update all paths of the form:
chrome://browser/skin/devtools/<X>
to
chrome://devtools/skin/<Y>
where <Y> is the source tree path that comes after /devtools/client.
In a following patch, all DevTools moz.build files will use DevToolsModules to
install JS modules at a path that corresponds directly to their source tree
location. Here we rewrite all require and import calls to match the new
location that these files are installed to.
Move major DevTools files to new directories using the following steps:
hg mv browser/devtools devtools/client
hg mv toolkit/devtools/server devtools/server
hg mv toolkit/devtools devtools/shared
No other changes are made.