From dcb3b8799fbd7a2d81155fe3f5108a1b7eac65bc Mon Sep 17 00:00:00 2001 From: Roman Dvornov Date: Sun, 24 Sep 2023 02:46:59 +0200 Subject: [PATCH] Bump mdn/data to 2.1.0 and fix missed syntaxes --- CHANGELOG.md | 1 + data/patch.json | 63 +++++++++++++++++++++++++++++++++++++++-------- lib/data.js | 6 ++++- package-lock.json | 14 +++++------ package.json | 2 +- 5 files changed, 67 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8555545c..86642577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## next +- Bumped `mdn/data` to `2.1.0` - Added `TokenStream#lookupTypeNonSC()` method - Added `` to generic types - Changed parsing rules of `Ratio`: diff --git a/data/patch.json b/data/patch.json index adfce72c..5108e5ce 100644 --- a/data/patch.json +++ b/data/patch.json @@ -16,7 +16,8 @@ }, "nest": { "prelude": "" - } + }, + "scroll-timeline": null }, "properties": { "-moz-background-clip": { @@ -181,14 +182,6 @@ ], "syntax": "nonzero | evenodd" }, - "container": { - "comment": "https://www.w3.org/TR/css-contain-3/#propdef-container", - "syntax": "<'container-name'> [ / <'container-type'> ]?" - }, - "container-name": { - "comment": "https://www.w3.org/TR/css-contain-3/#propdef-container-name", - "syntax": "none | +" - }, "container-type": { "comment": "https://www.w3.org/TR/css-contain-3/#propdef-container-type", "syntax": "normal || [ size | inline-size ]" @@ -597,6 +590,14 @@ "-ms-filter": { "syntax": "" }, + "absolute-color-base": { + "comment": "https://www.w3.org/TR/css-color-4/#color-syntax", + "syntax": " | | | transparent" + }, + "absolute-color-function": { + "comment": "https://www.w3.org/TR/css-color-4/#color-syntax", + "syntax": "rgb()> | | | | | | | | | " + }, "age": { "comment": "https://www.w3.org/TR/css3-speech/#voice-family", "syntax": "child | young | old" @@ -627,6 +628,9 @@ "comment": "missed, https://drafts.csswg.org/css-contain-3/#container-rule", "syntax": "not | [ [ and ]* | [ or ]* ]" }, + "coord-box": { + "syntax": "content-box | padding-box | border-box | fill-box | stroke-box | view-box" + }, "element()": { "comment": "https://drafts.csswg.org/css-gcpm/#element-syntax & https://drafts.csswg.org/css-images-4/#element-notation", "syntax": "element( , [ first | start | last | first-except ]? ) | element( )" @@ -666,6 +670,10 @@ "comment": "used by SVG https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint", "syntax": "none | | [ none | ]? | context-fill | context-stroke" }, + "palette-identifier": { + "comment": " is parsed as a (https://drafts.csswg.org/css-fonts/#typedef-font-palette-palette-identifier)", + "syntax": "" + }, "right": { "comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect", "syntax": " | auto" @@ -741,7 +749,42 @@ "number-one-or-greater": { "syntax": "" }, - "query-in-parens":{ + "color()": { + "syntax": "color( [ / [ | none ] ]? )" + }, + "colorspace-params": { + "syntax": "[ | ]" + }, + "predefined-rgb-params": { + "syntax": " [ | | none ]{3}" + }, + "predefined-rgb": { + "syntax": "srgb | srgb-linear | display-p3 | a98-rgb | prophoto-rgb | rec2020" + }, + "xyz-params": { + "syntax": " [ | | none ]{3}" + }, + "xyz-space": { + "syntax": "xyz | xyz-d50 | xyz-d65" + }, + "oklab()": { + "comment": "https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch", + "syntax": "oklab( [ | | none] [ | | none] [ | | none] [ / [ | none] ]? )" + }, + "oklch()": { + "comment": "https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch", + "syntax": "oklch( [ | | none] [ | | none] [ | none] [ / [ | none] ]? )" + }, + "offset-path": { + "syntax": " | | " + }, + "ray()": { + "syntax": "ray( && ? && contain? && [at ]? )" + }, + "ray-size": { + "syntax": "closest-side | closest-corner | farthest-side | farthest-corner | sides" + }, + "query-in-parens": { "comment": "missed, https://drafts.csswg.org/css-contain-3/#container-rule", "syntax": "( ) | ( ) | style( ) | " }, diff --git a/lib/data.js b/lib/data.js index 756e19a2..0302b18c 100755 --- a/lib/data.js +++ b/lib/data.js @@ -65,6 +65,10 @@ function patchAtrules(dict, patchDict) { // copy all syntaxes for an original dict for (const key in dict) { + if (patchDict[key] === null) { + continue; + } + const atrulePatch = patchDict[key] || {}; result[key] = { @@ -77,7 +81,7 @@ function patchAtrules(dict, patchDict) { // apply a patch for (const key in patchDict) { - if (!hasOwnProperty.call(dict, key)) { + if (patchDict[key] && !hasOwnProperty.call(dict, key)) { const atrulePatch = patchDict[key] || {}; result[key] = { diff --git a/package-lock.json b/package-lock.json index 6f4000e2..4e3ba8cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.3.1", "license": "MIT", "dependencies": { - "mdn-data": "2.0.30", + "mdn-data": "2.1.0", "source-map-js": "^1.0.1" }, "devDependencies": { @@ -1591,9 +1591,9 @@ } }, "node_modules/mdn-data": { - "version": "2.0.30", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.1.0.tgz", + "integrity": "sha512-dbAWH6A+2NGuVJlQFrTKHJc07Vqn5frnhyTOGz+7BsK7V2hHdoBcwoiyV3QVhLHYpM/zqe2OSUn5ZWbVXLBB8A==" }, "node_modules/minimatch": { "version": "3.1.2", @@ -3348,9 +3348,9 @@ } }, "mdn-data": { - "version": "2.0.30", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.1.0.tgz", + "integrity": "sha512-dbAWH6A+2NGuVJlQFrTKHJc07Vqn5frnhyTOGz+7BsK7V2hHdoBcwoiyV3QVhLHYpM/zqe2OSUn5ZWbVXLBB8A==" }, "minimatch": { "version": "3.1.2", diff --git a/package.json b/package.json index 934e699f..cd75943f 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "hydrogen": "node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/parse --stat -o /dev/null" }, "dependencies": { - "mdn-data": "2.0.30", + "mdn-data": "2.1.0", "source-map-js": "^1.0.1" }, "devDependencies": {