This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree 2 files changed +25
-1
lines changed
2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 538
538
// ClassSelector
539
539
// IDSelector
540
540
// AttributeSelector
541
- var selectorStartCharRe = / ^ [ * . # [ a - z A - Z _ | ] / ;
541
+ // negation
542
+ var selectorStartCharRe = / ^ ( : n o t \( ) ? [ * . # [ a - z A - Z _ | ] / ;
542
543
543
544
function matches ( node , contentElement ) {
544
545
var select = contentElement . getAttribute ( 'select' ) ;
Original file line number Diff line number Diff line change @@ -193,6 +193,29 @@ suite('Shadow DOM', function() {
193
193
'<a data-test="a b c"></a>' ) ;
194
194
} ) ;
195
195
196
+ suite ( 'Not selector' , function ( ) {
197
+ testRender ( 'Type' ,
198
+ '<a></a><b></b>' ,
199
+ '<content select=":not(a)"></content>' ,
200
+ '<b></b>' ) ;
201
+ testRender ( 'ID' ,
202
+ '<a id="a"></a><a id="b"></a>' ,
203
+ '<content select=":not(#a)"></content>' ,
204
+ '<a id="b"></a>' ) ;
205
+ testRender ( 'Class' ,
206
+ '<a class="a"></a><a class="b"></a>' ,
207
+ '<content select=":not(.a)"></content>' ,
208
+ '<a class="b"></a>' ) ;
209
+ testRender ( 'Attribute' ,
210
+ '<a a="a"></a><a b="b"></a>' ,
211
+ '<content select=":not([a])"></content>' ,
212
+ '<a b="b"></a>' ) ;
213
+ testRender ( 'Attribute Value' ,
214
+ '<a x="a"></a><a x="b"></a>' ,
215
+ '<content select=":not([x=a])"></content>' ,
216
+ '<a x="b"></a>' ) ;
217
+ } ) ;
218
+
196
219
} ) ;
197
220
198
221
suite ( 'Nested shadow hosts' , function ( ) {
You can’t perform that action at this time.
0 commit comments