diff --git a/package.json b/package.json index b214661f..d5c2dcdb 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "prettier": "3.9.6", "tailwind-csstree": "^0.4.0", "typescript": "^7.0.2", - "web-features": "^3.37.0", + "web-features": "^3.38.0", "yorkie": "^2.0.0" }, "engines": { diff --git a/src/data/baseline-data.js b/src/data/baseline-data.js index dccb005a..c8ff3955 100644 --- a/src/data/baseline-data.js +++ b/src/data/baseline-data.js @@ -252,6 +252,7 @@ export const properties = new Map([ ["line-break", "10:2020"], ["line-clamp", "0:"], ["line-height", "10:2015"], + ["link-parameters", "0:"], ["list-style", "10:2015"], ["list-style-image", "10:2015"], ["list-style-position", "10:2015"], @@ -466,8 +467,8 @@ export const properties = new Map([ ["marker-mid", "10:2017"], ["marker-start", "10:2017"], ["r", "10:2020"], - ["rx", "5:2024"], - ["ry", "5:2024"], + ["rx", "10:2024"], + ["ry", "10:2024"], ["shape-rendering", "10:2020"], ["stop-color", "10:2017"], ["stop-opacity", "10:2017"], @@ -526,7 +527,7 @@ export const properties = new Map([ ["text-transform", "10:2015"], ["text-underline-offset", "10:2020"], ["text-underline-position", "10:2020"], - ["text-wrap", "5:2024"], + ["text-wrap", "10:2024"], ["text-wrap-mode", "5:2024"], ["text-wrap-style", "5:2024"], ["touch-action", "10:2019"], @@ -636,7 +637,6 @@ export const functions = new Map([ ["attr", "10:2015"], ["calc", "10:2015"], ["calc-size", "0:"], - ["shape", "5:2026"], ["rect", "10:2024"], ["color", "10:2023"], ["color-mix", "10:2023"], @@ -683,6 +683,7 @@ export const functions = new Map([ ["lab", "10:2023"], ["lch", "10:2023"], ["light-dark", "5:2024"], + ["param", "0:"], ["clamp", "10:2020"], ["max", "10:2020"], ["min", "10:2020"], @@ -698,6 +699,7 @@ export const functions = new Map([ ["mod", "5:2024"], ["rem", "5:2024"], ["env", "10:2020"], + ["shape", "5:2026"], ["circle", "10:2020"], ["ellipse", "10:2020"], ["inset", "10:2020"], @@ -2818,6 +2820,7 @@ export const propertyValues = new Map([ ], ["line-clamp", new Map([["none", "0:"]])], ["line-height", new Map([["normal", "10:2015"]])], + ["link-parameters", new Map([["none", "0:"]])], ["list-style-image", new Map([["none", "10:2015"]])], [ "list-style-position", @@ -3938,7 +3941,7 @@ export const propertyValues = new Map([ new Map([ ["auto", "10:2021"], ["from-font", "10:2021"], - ["percentage", "5:2024"], + ["percentage", "10:2024"], ]), ], [ diff --git a/tools/generate-baseline.js b/tools/generate-baseline.js index 45bf0c62..d6bcccec 100644 --- a/tools/generate-baseline.js +++ b/tools/generate-baseline.js @@ -61,9 +61,15 @@ const groupedUnitMappings = { /* * Some bare `css.types.` compat keys refer to CSS data types * instead of functions. For example, `css.types.image` refers to ``, - * not `image()`. + * not `image()`, and `css.types.shape` refers to the deprecated `` + * type used by `clip`, not `shape()`. */ -const UNGROUPED_NON_FUNCTION_TYPES = new Set(["color", "image", "string"]); +const UNGROUPED_NON_FUNCTION_TYPES = new Set([ + "color", + "image", + "shape", + "string", +]); const BASELINE_HIGH = 10; const BASELINE_LOW = 5; @@ -172,10 +178,24 @@ function extractCSSFeatures(features) { units: {}, }; + /* + * Functions whose status came from their own bare `css.types.` + * compat key. That key is the compat entry for the function itself, so it + * takes precedence over a feature name match and over grouped + * `css.types..` keys, which describe a sub-feature of + * `` that merely shares the name. For example, + * `css.types.param.url` describes `param()` inside `url()`, not `url()`. + */ + const functionsFromBareKeys = new Set(); + for (const feature of Object.values(features)) { // Check if the feature name itself represents a function const nameMatch = PATTERNS.functionName.exec(feature.name); - if (nameMatch && isKnownCSSFunction(nameMatch.groups.name)) { + if ( + nameMatch && + isKnownCSSFunction(nameMatch.groups.name) && + !functionsFromBareKeys.has(nameMatch.groups.name) + ) { output.functions[nameMatch.groups.name] = mapFeatureStatus( feature.status, ); @@ -258,7 +278,12 @@ function extractCSSFeatures(features) { else if ((match = PATTERNS.type.exec(key))) { const { group, type } = match.groups; if (isCompatTypeAFunction(group, type)) { - output.functions[type] = mapFeatureStatus(status); + if (!group) { + functionsFromBareKeys.add(type); + output.functions[type] = mapFeatureStatus(status); + } else if (!functionsFromBareKeys.has(type)) { + output.functions[type] = mapFeatureStatus(status); + } } } // selectors