Skip to content

Commit 2174c4e

Browse files
committed
:current() takes a list of compound selectors
1 parent 6d4b410 commit 2174c4e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

__tests__/value.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4391,6 +4391,8 @@ describe('<selector-list>', () => {
43914391
'::before:not(:hover > type)',
43924392
// Invalid functional pseudo argument
43934393
':has(:not(:has(type)))',
4394+
':current(:not(type > type))',
4395+
':current(:not(:has(type)))',
43944396
':host(:not(type > type))',
43954397
':host(:not(:has(type)))',
43964398
':host-context(:not(type > type))',

lib/parse/preprocess.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ function preParseCalcValue(node) {
6969
* @see {@link https://drafts.csswg.org/selectors-4/#typedef-combinator}
7070
* @see {@link https://drafts.csswg.org/selectors-4/#pseudo-element-structure}
7171
*
72-
* It aborts parsing a combinator when the context only allows a compound
73-
* selector.
72+
* It aborts parsing a combinator when the context only allows compound
73+
* selectors.
7474
*
7575
* It aborts parsing when the input is at the back of a pseudo-element with no
7676
* internal structure but is still not at the end of the selector.
@@ -96,7 +96,7 @@ function preParseCombinator(node) {
9696
}
9797
}
9898
const { context: { trees } } = node
99-
if (trees.findLast(tree => tree.definition.name === '<compound-selector>')) {
99+
if (trees.findLast(tree => tree.definition.name?.startsWith('<compound-selector'))) {
100100
return trees.at(-1).definition.name?.startsWith('<relative') ? error(node) : null
101101
}
102102
}

lib/values/pseudos.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const structural = {
140140
*/
141141
const time = {
142142
functions: {
143-
'current': '<selector-list>',
143+
'current': '<compound-selector-list>',
144144
},
145145
identifiers: [
146146
'current',

0 commit comments

Comments
 (0)