mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-04 07:40:42 +00:00
Bug 1464801 - Assign writer methods to each axis defined in font-variation-settings during editor setup. r=pbro
MozReview-Commit-ID: 2L3etSyDBPR --HG-- extra : rebase_source : 0f0a0df9a42125bf76cdea78e73e501817038791
This commit is contained in:
parent
c80923498e
commit
476e494dab
@ -22,6 +22,7 @@ const INSPECTOR_L10N =
|
||||
new LocalizationHelper("devtools/client/locales/inspector.properties");
|
||||
|
||||
const { getStr } = require("./utils/l10n");
|
||||
const { parseFontVariationAxes } = require("./utils/font-utils");
|
||||
const { updateFonts } = require("./actions/fonts");
|
||||
const {
|
||||
applyInstance,
|
||||
@ -580,6 +581,12 @@ class FontInspector {
|
||||
font.used = declaredFontNames.includes(font.CSSFamilyName);
|
||||
}
|
||||
|
||||
// Assign writer methods to each axis defined in font-variation-settings.
|
||||
const axes = parseFontVariationAxes(properties["font-variation-settings"]);
|
||||
Object.keys(axes).map(axis => {
|
||||
this.writers.set(axis, this.getWriterForAxis(axis));
|
||||
});
|
||||
|
||||
// Update the font editor state only if property values differ from the ones in store.
|
||||
// This can happen when a user makes manual changes in the Rule view.
|
||||
if (JSON.stringify(properties) !== JSON.stringify(fontEditor.properties)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user