Skip to content

Commit

Permalink
Bump mdn/data to 2.1.0 and fix missed syntaxes
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Sep 24, 2023
1 parent 06a0291 commit dcb3b87
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
## next

- Bumped `mdn/data` to `2.1.0`
- Added `TokenStream#lookupTypeNonSC()` method
- Added `<dashed-ident>` to generic types
- Changed parsing rules of `Ratio`:
Expand Down
63 changes: 53 additions & 10 deletions data/patch.json
Expand Up @@ -16,7 +16,8 @@
},
"nest": {
"prelude": "<complex-selector-list>"
}
},
"scroll-timeline": null
},
"properties": {
"-moz-background-clip": {
Expand Down Expand Up @@ -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 | <custom-ident>+"
},
"container-type": {
"comment": "https://www.w3.org/TR/css-contain-3/#propdef-container-type",
"syntax": "normal || [ size | inline-size ]"
Expand Down Expand Up @@ -597,6 +590,14 @@
"-ms-filter": {
"syntax": "<string>"
},
"absolute-color-base": {
"comment": "https://www.w3.org/TR/css-color-4/#color-syntax",
"syntax": "<hex-color> | <absolute-color-function> | <named-color> | transparent"
},
"absolute-color-function": {
"comment": "https://www.w3.org/TR/css-color-4/#color-syntax",
"syntax": "rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <lab()> | <lch()> | <oklab()> | <oklch()> | <color()>"
},
"age": {
"comment": "https://www.w3.org/TR/css3-speech/#voice-family",
"syntax": "child | young | old"
Expand Down Expand Up @@ -627,6 +628,9 @@
"comment": "missed, https://drafts.csswg.org/css-contain-3/#container-rule",
"syntax": "not <query-in-parens> | <query-in-parens> [ [ and <query-in-parens> ]* | [ or <query-in-parens> ]* ]"
},
"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( <custom-ident> , [ first | start | last | first-except ]? ) | element( <id-selector> )"
Expand Down Expand Up @@ -666,6 +670,10 @@
"comment": "used by SVG https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint",
"syntax": "none | <color> | <url> [ none | <color> ]? | context-fill | context-stroke"
},
"palette-identifier": {
"comment": "<palette-identifier> is parsed as a <dashed-ident> (https://drafts.csswg.org/css-fonts/#typedef-font-palette-palette-identifier)",
"syntax": "<dashed-ident>"
},
"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": "<length> | auto"
Expand Down Expand Up @@ -741,7 +749,42 @@
"number-one-or-greater": {
"syntax": "<number [1,∞]>"
},
"query-in-parens":{
"color()": {
"syntax": "color( <colorspace-params> [ / [ <alpha-value> | none ] ]? )"
},
"colorspace-params": {
"syntax": "[ <predefined-rgb-params> | <xyz-params>]"
},
"predefined-rgb-params": {
"syntax": "<predefined-rgb> [ <number> | <percentage> | none ]{3}"
},
"predefined-rgb": {
"syntax": "srgb | srgb-linear | display-p3 | a98-rgb | prophoto-rgb | rec2020"
},
"xyz-params": {
"syntax": "<xyz-space> [ <number> | <percentage> | 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( [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ / [<alpha-value> | none] ]? )"
},
"oklch()": {
"comment": "https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch",
"syntax": "oklch( [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )"
},
"offset-path": {
"syntax": "<ray()> | <url> | <basic-shape>"
},
"ray()": {
"syntax": "ray( <angle> && <ray-size>? && contain? && [at <position>]? )"
},
"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": "( <container-condition> ) | ( <size-feature> ) | style( <style-query> ) | <general-enclosed>"
},
Expand Down
6 changes: 5 additions & 1 deletion lib/data.js
Expand Up @@ -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] = {
Expand All @@ -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] = {
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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": {
Expand Down

0 comments on commit dcb3b87

Please sign in to comment.