-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add detection for env functions (#921)
- Loading branch information
1 parent
51b3bc6
commit 571f800
Showing
17 changed files
with
515 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
187 changes: 187 additions & 0 deletions
187
packages/media-query-list-parser/test/cases/mf-plain/0009.expect.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
[ | ||
{ | ||
"type": "media-query-without-type", | ||
"string": "(min-width: env(safe-area-inset-top))", | ||
"media": { | ||
"type": "media-condition", | ||
"media": { | ||
"type": "media-in-parens", | ||
"media": { | ||
"type": "media-feature", | ||
"feature": { | ||
"type": "mf-plain", | ||
"name": { | ||
"type": "mf-name", | ||
"name": "min-width", | ||
"tokens": [ | ||
[ | ||
"ident-token", | ||
"min-width", | ||
1, | ||
9, | ||
{ | ||
"value": "min-width" | ||
} | ||
] | ||
] | ||
}, | ||
"value": { | ||
"type": "mf-value", | ||
"value": { | ||
"type": "function", | ||
"name": "env", | ||
"tokens": [ | ||
[ | ||
"function-token", | ||
"env(", | ||
12, | ||
15, | ||
{ | ||
"value": "env" | ||
} | ||
], | ||
[ | ||
"ident-token", | ||
"safe-area-inset-top", | ||
16, | ||
34, | ||
{ | ||
"value": "safe-area-inset-top" | ||
} | ||
], | ||
[ | ||
")-token", | ||
")", | ||
35, | ||
35, | ||
null | ||
] | ||
], | ||
"value": [ | ||
{ | ||
"type": "token", | ||
"tokens": [ | ||
[ | ||
"ident-token", | ||
"safe-area-inset-top", | ||
16, | ||
34, | ||
{ | ||
"value": "safe-area-inset-top" | ||
} | ||
] | ||
] | ||
} | ||
] | ||
}, | ||
"tokens": [ | ||
[ | ||
"whitespace-token", | ||
" ", | ||
11, | ||
11, | ||
null | ||
], | ||
[ | ||
"function-token", | ||
"env(", | ||
12, | ||
15, | ||
{ | ||
"value": "env" | ||
} | ||
], | ||
[ | ||
"ident-token", | ||
"safe-area-inset-top", | ||
16, | ||
34, | ||
{ | ||
"value": "safe-area-inset-top" | ||
} | ||
], | ||
[ | ||
")-token", | ||
")", | ||
35, | ||
35, | ||
null | ||
] | ||
] | ||
}, | ||
"tokens": [ | ||
[ | ||
"ident-token", | ||
"min-width", | ||
1, | ||
9, | ||
{ | ||
"value": "min-width" | ||
} | ||
], | ||
[ | ||
"colon-token", | ||
":", | ||
10, | ||
10, | ||
null | ||
], | ||
[ | ||
"whitespace-token", | ||
" ", | ||
11, | ||
11, | ||
null | ||
], | ||
[ | ||
"function-token", | ||
"env(", | ||
12, | ||
15, | ||
{ | ||
"value": "env" | ||
} | ||
], | ||
[ | ||
"ident-token", | ||
"safe-area-inset-top", | ||
16, | ||
34, | ||
{ | ||
"value": "safe-area-inset-top" | ||
} | ||
], | ||
[ | ||
")-token", | ||
")", | ||
35, | ||
35, | ||
null | ||
] | ||
] | ||
}, | ||
"before": [ | ||
[ | ||
"(-token", | ||
"(", | ||
0, | ||
0, | ||
null | ||
] | ||
], | ||
"after": [ | ||
[ | ||
")-token", | ||
")", | ||
36, | ||
36, | ||
null | ||
] | ||
] | ||
}, | ||
"before": [], | ||
"after": [] | ||
} | ||
} | ||
} | ||
] |
13 changes: 13 additions & 0 deletions
13
packages/media-query-list-parser/test/cases/mf-plain/0009.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import assert from 'assert'; | ||
import { runTest } from '../../util/run-test.mjs'; | ||
|
||
runTest( | ||
'(min-width: env(safe-area-inset-top))', | ||
'mf-plain/0009', | ||
(actual, expected) => { | ||
assert.deepStrictEqual( | ||
actual, | ||
expected, | ||
); | ||
}, | ||
); |
Oops, something went wrong.