Bug 1815877 - [devtools] Don't include CSS property preferences in devtools/shared/css/generated/properties-db.js. r=ochameau.

This was only used in a XPCShell test, where we can
directly use InspectorUtils.getCSSPropertyPrefs() instead.

Differential Revision: https://phabricator.services.mozilla.com/D169338
This commit is contained in:
Nicolas Chevobbe 2023-02-13 12:38:29 +00:00
parent 6c1ef05bb8
commit c76f6f7fa5
5 changed files with 4 additions and 375 deletions

View file

@ -24,7 +24,6 @@ dump("DEVTOOLS_CSS_DB_DELIMITER");
dump(
JSON.stringify({
cssProperties: cssProperties(),
preferences: preferences(),
pseudoElements: pseudoElements(),
})
);
@ -52,18 +51,6 @@ function cssProperties() {
return properties;
}
/**
* A list of preferences of CSS properties.
*/
function preferences() {
const prefs = InspectorUtils.getCSSPropertyPrefs();
const result = [];
for (const { name, pref } of prefs) {
result.push([name, pref]);
}
return result;
}
/**
* The list of all CSS Pseudo Elements.
*/

View file

@ -51,7 +51,6 @@ def generate_css_db(command_context):
output_template(
command_context,
{
"preferences": stringify(db["preferences"]),
"cssProperties": stringify(db["cssProperties"]),
"pseudoElements": stringify(db["pseudoElements"]),
},

View file

@ -11982,346 +11982,3 @@ exports.PSEUDO_ELEMENTS = [
"::-moz-color-swatch",
"::file-selector-button"
];
/**
* A list of the preferences keys for whether a CSS property is enabled or not. This is
* exposed for testing purposes.
*/
exports.PREFERENCES = [
[
"container-type",
"layout.css.container-queries.enabled"
],
[
"content-visibility",
"layout.css.content-visibility.enabled"
],
[
"font-optical-sizing",
"layout.css.font-variations.enabled"
],
[
"font-variant-emoji",
"layout.css.font-variant-emoji.enabled"
],
[
"initial-letter",
"layout.css.initial-letter.enabled"
],
[
"masonry-auto-flow",
"layout.css.grid-template-masonry-value.enabled"
],
[
"math-depth",
"layout.css.math-depth.enabled"
],
[
"math-style",
"layout.css.math-style.enabled"
],
[
"-moz-control-character-visibility",
"layout.css.moz-control-character-visibility.enabled"
],
[
"-moz-osx-font-smoothing",
"layout.css.osx-font-smoothing.enabled"
],
[
"offset-rotate",
"layout.css.motion-path.enabled"
],
[
"overflow-anchor",
"layout.css.scroll-anchoring.enabled"
],
[
"page-orientation",
"layout.css.page-orientation.enabled"
],
[
"scrollbar-gutter",
"layout.css.scrollbar-gutter.enabled"
],
[
"overflow-clip-box-block",
"layout.css.overflow-clip-box.enabled"
],
[
"overflow-clip-box-inline",
"layout.css.overflow-clip-box.enabled"
],
[
"overflow-block",
"layout.css.overflow-logical.enabled"
],
[
"overflow-inline",
"layout.css.overflow-logical.enabled"
],
[
"overscroll-behavior-block",
"layout.css.overscroll-behavior.enabled"
],
[
"overscroll-behavior-inline",
"layout.css.overscroll-behavior.enabled"
],
[
"overscroll-behavior-x",
"layout.css.overscroll-behavior.enabled"
],
[
"overscroll-behavior-y",
"layout.css.overscroll-behavior.enabled"
],
[
"accent-color",
"layout.css.accent-color.enabled"
],
[
"align-tracks",
"layout.css.grid-template-masonry-value.enabled"
],
[
"animation-composition",
"layout.css.animation-composition.enabled"
],
[
"animation-timeline",
"layout.css.scroll-driven-animations.enabled"
],
[
"backdrop-filter",
"layout.css.backdrop-filter.enabled"
],
[
"color-scheme",
"layout.css.color-scheme.enabled"
],
[
"container-name",
"layout.css.container-queries.enabled"
],
[
"d",
"layout.css.d-property.enabled"
],
[
"font-palette",
"layout.css.font-palette.enabled"
],
[
"font-variation-settings",
"layout.css.font-variations.enabled"
],
[
"hyphenate-character",
"layout.css.hyphenate-character.enabled"
],
[
"justify-tracks",
"layout.css.grid-template-masonry-value.enabled"
],
[
"-moz-context-properties",
"svg.context-properties.content.enabled"
],
[
"offset-anchor",
"layout.css.motion-path.enabled"
],
[
"offset-path",
"layout.css.motion-path.enabled"
],
[
"page",
"layout.css.named-pages.enabled"
],
[
"rotate",
"layout.css.individual-transform.enabled"
],
[
"scale",
"layout.css.individual-transform.enabled"
],
[
"scroll-timeline-axis",
"layout.css.scroll-driven-animations.enabled"
],
[
"scroll-timeline-name",
"layout.css.scroll-driven-animations.enabled"
],
[
"size",
"layout.css.page-size.enabled"
],
[
"translate",
"layout.css.individual-transform.enabled"
],
[
"view-timeline-axis",
"layout.css.scroll-driven-animations.enabled"
],
[
"view-timeline-inset",
"layout.css.scroll-driven-animations.enabled"
],
[
"view-timeline-name",
"layout.css.scroll-driven-animations.enabled"
],
[
"contain-intrinsic-block-size",
"layout.css.contain-intrinsic-size.enabled"
],
[
"contain-intrinsic-height",
"layout.css.contain-intrinsic-size.enabled"
],
[
"contain-intrinsic-inline-size",
"layout.css.contain-intrinsic-size.enabled"
],
[
"contain-intrinsic-width",
"layout.css.contain-intrinsic-size.enabled"
],
[
"offset-distance",
"layout.css.motion-path.enabled"
],
[
"overflow-clip-box",
"layout.css.overflow-clip-box.enabled"
],
[
"overscroll-behavior",
"layout.css.overscroll-behavior.enabled"
],
[
"container",
"layout.css.container-queries.enabled"
],
[
"offset",
"layout.css.motion-path.enabled"
],
[
"zoom",
"layout.css.zoom-transform-hack.enabled"
],
[
"contain-intrinsic-size",
"layout.css.contain-intrinsic-size.enabled"
],
[
"scroll-timeline",
"layout.css.scroll-driven-animations.enabled"
],
[
"view-timeline",
"layout.css.scroll-driven-animations.enabled"
],
[
"-moz-transform",
"layout.css.prefixes.transforms"
],
[
"-moz-perspective",
"layout.css.prefixes.transforms"
],
[
"-moz-perspective-origin",
"layout.css.prefixes.transforms"
],
[
"-moz-backface-visibility",
"layout.css.prefixes.transforms"
],
[
"-moz-transform-style",
"layout.css.prefixes.transforms"
],
[
"-moz-transform-origin",
"layout.css.prefixes.transforms"
],
[
"-moz-font-feature-settings",
"layout.css.prefixes.font-features"
],
[
"-moz-font-language-override",
"layout.css.prefixes.font-features"
],
[
"-moz-box-sizing",
"layout.css.prefixes.box-sizing"
],
[
"-moz-transition-duration",
"layout.css.prefixes.transitions"
],
[
"-moz-transition-timing-function",
"layout.css.prefixes.transitions"
],
[
"-moz-transition-property",
"layout.css.prefixes.transitions"
],
[
"-moz-transition-delay",
"layout.css.prefixes.transitions"
],
[
"-moz-animation-name",
"layout.css.prefixes.animations"
],
[
"-moz-animation-duration",
"layout.css.prefixes.animations"
],
[
"-moz-animation-timing-function",
"layout.css.prefixes.animations"
],
[
"-moz-animation-iteration-count",
"layout.css.prefixes.animations"
],
[
"-moz-animation-direction",
"layout.css.prefixes.animations"
],
[
"-moz-animation-play-state",
"layout.css.prefixes.animations"
],
[
"-moz-animation-fill-mode",
"layout.css.prefixes.animations"
],
[
"-moz-animation-delay",
"layout.css.prefixes.animations"
],
[
"-moz-border-image",
"layout.css.prefixes.border-image"
],
[
"-moz-transition",
"layout.css.prefixes.transitions"
],
[
"-moz-animation",
"layout.css.prefixes.animations"
]
];

View file

@ -19,9 +19,3 @@ exports.CSS_PROPERTIES = ${cssProperties};
* A list of the pseudo elements.
*/
exports.PSEUDO_ELEMENTS = ${pseudoElements};
/**
* A list of the preferences keys for whether a CSS property is enabled or not. This is
* exposed for testing purposes.
*/
exports.PREFERENCES = ${preferences};

View file

@ -22,8 +22,8 @@
const {
PSEUDO_ELEMENTS,
CSS_PROPERTIES,
PREFERENCES,
} = require("resource://devtools/shared/css/generated/properties-db.js");
const PREFERENCES = InspectorUtils.getCSSPropertyPrefs();
const {
generateCssProperties,
} = require("resource://devtools/server/actors/css-properties.js");
@ -47,14 +47,6 @@ function run_test() {
propertiesErrorMessage
);
const prefs = InspectorUtils.getCSSPropertyPrefs();
deepEqual(
PREFERENCES,
prefs.map(({ name, pref }) => [name, pref]),
"The preferences match on the client and platform. " +
propertiesErrorMessage
);
/**
* Check that the platform and client match for the details on their CSS properties.
* Enumerate each property to aid in debugging. Sometimes these properties don't
@ -177,12 +169,12 @@ function getKeyMismatches(a, b) {
* @return {Boolean|undefined}
*/
function getPreference(propertyName) {
const preference = PREFERENCES.find(([prefPropertyName, preferenceKey]) => {
return prefPropertyName === propertyName && !!preferenceKey;
const preference = PREFERENCES.find(({ name, pref }) => {
return name === propertyName && !!pref;
});
if (preference) {
return Preferences.get(preference[1]);
return Preferences.get(preference.pref);
}
return undefined;
}