File tree Expand file tree Collapse file tree 2 files changed +4
-47
lines changed Expand file tree Collapse file tree 2 files changed +4
-47
lines changed Original file line number Diff line number Diff line change @@ -493,31 +493,7 @@ describe('SFC style preprocessors', () => {
493
493
}"
494
494
` )
495
495
expect ( compileScoped ( `.foo * { color: red; }` ) ) . toMatchInlineSnapshot ( `
496
- ".foo[data-v-test] [data-v-test] { color: red;
497
- }"
498
- ` )
499
- expect ( compileScoped ( `.foo :active { color: red; }` ) )
500
- . toMatchInlineSnapshot ( `
501
- ".foo[data-v-test] :active { color: red;
502
- }"
503
- ` )
504
- expect ( compileScoped ( `.foo *:active { color: red; }` ) )
505
- . toMatchInlineSnapshot ( `
506
- ".foo[data-v-test] [data-v-test]:active { color: red;
507
- }"
508
- ` )
509
- expect ( compileScoped ( `.foo * .bar { color: red; }` ) ) . toMatchInlineSnapshot ( `
510
- ".foo * .bar[data-v-test] { color: red;
511
- }"
512
- ` )
513
- expect ( compileScoped ( `:last-child * { color: red; }` ) )
514
- . toMatchInlineSnapshot ( `
515
- "[data-v-test]:last-child [data-v-test] { color: red;
516
- }"
517
- ` )
518
- expect ( compileScoped ( `:last-child *:active { color: red; }` ) )
519
- . toMatchInlineSnapshot ( `
520
- "[data-v-test]:last-child [data-v-test]:active { color: red;
496
+ ".foo[data-v-test] * { color: red;
521
497
}"
522
498
` )
523
499
} )
Original file line number Diff line number Diff line change @@ -102,7 +102,6 @@ function rewriteSelector(
102
102
slotted = false ,
103
103
) {
104
104
let node : selectorParser . Node | null = null
105
- let starNode : selectorParser . Node | null = null
106
105
let shouldInject = ! deep
107
106
// find the last child node to insert attribute selector
108
107
selector . each ( n => {
@@ -217,21 +216,17 @@ function rewriteSelector(
217
216
return false
218
217
}
219
218
}
220
- // store the universal selector so it can be rewritten later
221
- // .foo * -> .foo[xxxxxxx] [xxxxxxx]
222
- starNode = n
219
+ // .foo * -> .foo[xxxxxxx] *
220
+ if ( node ) return
223
221
}
224
222
225
223
if (
226
- ( n . type !== 'pseudo' &&
227
- n . type !== 'combinator' &&
228
- n . type !== 'universal' ) ||
224
+ ( n . type !== 'pseudo' && n . type !== 'combinator' ) ||
229
225
( n . type === 'pseudo' &&
230
226
( n . value === ':is' || n . value === ':where' ) &&
231
227
! node )
232
228
) {
233
229
node = n
234
- starNode = null
235
230
}
236
231
} )
237
232
@@ -279,20 +274,6 @@ function rewriteSelector(
279
274
quoteMark : `"` ,
280
275
} ) ,
281
276
)
282
- // Used for trailing universal selectors (#12906)
283
- // `.foo * {}` -> `.foo[xxxxxxx] [xxxxxxx] {}`
284
- if ( starNode ) {
285
- selector . insertBefore (
286
- starNode ,
287
- selectorParser . attribute ( {
288
- attribute : idToAdd ,
289
- value : idToAdd ,
290
- raws : { } ,
291
- quoteMark : `"` ,
292
- } ) ,
293
- )
294
- selector . removeChild ( starNode )
295
- }
296
277
}
297
278
}
298
279
You can’t perform that action at this time.
0 commit comments