@@ -735,50 +735,48 @@ export default {
735
735
}
736
736
} ,
737
737
738
- Selector ( node ) {
739
- for ( const child of node . children ) {
740
- const selector = child . name ;
738
+ "PseudoClassSelector,PseudoElementSelector" ( node ) {
739
+ const selector = node . name ;
741
740
742
- if ( ! selectors . has ( selector ) ) {
743
- continue ;
744
- }
741
+ if ( ! selectors . has ( selector ) ) {
742
+ return ;
743
+ }
745
744
746
- // if the selector has been tested in a @supports rule, don't check it
747
- if ( supportsRules . hasSelector ( selector ) ) {
748
- continue ;
749
- }
745
+ // if the selector has been tested in a @supports rule, don't check it
746
+ if ( supportsRules . hasSelector ( selector ) ) {
747
+ return ;
748
+ }
750
749
751
- const featureStatus = selectors . get ( selector ) ;
750
+ const featureStatus = selectors . get ( selector ) ;
752
751
753
- if ( ! baselineAvailability . isSupported ( featureStatus ) ) {
754
- const loc = child . loc ;
752
+ if ( ! baselineAvailability . isSupported ( featureStatus ) ) {
753
+ const loc = node . loc ;
755
754
756
- // some selectors are prefixed with the : or :: symbols
757
- let prefixSymbolLength = 0 ;
758
- if ( child . type === "PseudoClassSelector" ) {
759
- prefixSymbolLength = 1 ;
760
- } else if ( child . type === "PseudoElementSelector" ) {
761
- prefixSymbolLength = 2 ;
762
- }
755
+ // some selectors are prefixed with the : or :: symbols
756
+ let prefixSymbolLength = 0 ;
757
+ if ( node . type . startsWith ( "PseudoClass" ) ) {
758
+ prefixSymbolLength = 1 ;
759
+ } else if ( node . type . startsWith ( "PseudoElement" ) ) {
760
+ prefixSymbolLength = 2 ;
761
+ }
763
762
764
- context . report ( {
765
- loc : {
766
- start : loc . start ,
767
- end : {
768
- line : loc . start . line ,
769
- column :
770
- loc . start . column +
771
- selector . length +
772
- prefixSymbolLength ,
773
- } ,
774
- } ,
775
- messageId : "notBaselineSelector" ,
776
- data : {
777
- selector,
778
- availability : baselineAvailability . availability ,
763
+ context . report ( {
764
+ loc : {
765
+ start : loc . start ,
766
+ end : {
767
+ line : loc . start . line ,
768
+ column :
769
+ loc . start . column +
770
+ selector . length +
771
+ prefixSymbolLength ,
779
772
} ,
780
- } ) ;
781
- }
773
+ } ,
774
+ messageId : "notBaselineSelector" ,
775
+ data : {
776
+ selector,
777
+ availability : baselineAvailability . availability ,
778
+ } ,
779
+ } ) ;
782
780
}
783
781
} ,
784
782
0 commit comments