4 files changed
@@ -137,6 +137,9 @@ function matchFreeFormValue(node, match) { | |||
| 137 | 137 | } | |
| 138 | 138 | return error(node) | |
| 139 | 139 | } | |
| 140 | + if (isProducedBy(node, '<if-args-branch>')) { | ||
| 141 | + return match(node, [',', '{', ':']) | ||
| 142 | + } | ||
| 140 | 143 | return match(node, [',', '{']) | |
| 141 | 144 | } | |
| 142 | 145 | return match(node) | |
@@ -245,7 +245,7 @@ export default { | |||
| 245 | 245 | '<ident-arg>': '<string> | <integer> | <ident>', | |
| 246 | 246 | '<ident>': '<ident-token>', | |
| 247 | 247 | '<if()>': 'if([<if-branch> ;]* <if-branch> ;?)', | |
| 248 | - '<if-args-branch>': '<declaration-value> [: <declaration-value>?]?', | ||
| 248 | + '<if-args-branch>': '<declaration-value> : <declaration-value>?', | ||
| 249 | 249 | '<if-args>': 'if([<if-args-branch> ;]* <if-args-branch> ;?)', | |
| 250 | 250 | '<if-branch>': '<if-condition> : <declaration-value>?', | |
| 251 | 251 | '<if-condition>': '<boolean-expr[<if-test> ]> | else', | |
@@ -201,8 +201,6 @@ const replaced = { | |||
| 201 | 201 | '<feature-index>': '<integer>', | |
| 202 | 202 | // https://github.com/w3c/csswg-drafts/issues/13010 | |
| 203 | 203 | '<event-trigger-event>': 'activate | click | touch | dblclick | keypress(<string>)', | |
| 204 | - // https://github.com/w3c/csswg-drafts/issues/12487 | ||
| 205 | - '<if-args-branch>': '<declaration-value> [: <declaration-value>?]?', | ||
| 206 | 204 | // https://github.com/w3c/fxtf-drafts/issues/532 | |
| 207 | 205 | '<mask-reference>': 'none | <image>', | |
| 208 | 206 | // TODO: fix `value` of `<pseudo-page>` | |
@@ -656,7 +656,7 @@ describe('arbitrary substitution', () => { | |||
| 656 | 656 | ['--custom(--custom(!))'], | |
| 657 | 657 | ['attr(name, attr())'], | |
| 658 | 658 | ['env(name, env())'], | |
| 659 | - ['if(if())', 'if(if())'], | ||
| 659 | + ['if(if():)'], | ||
| 660 | 660 | ['inherit(--custom, inherit())'], | |
| 661 | 661 | ['random-item(--key, random-item())'], | |
| 662 | 662 | ['var(--custom, var())'], | |
0 commit comments