@@ -1130,6 +1130,67 @@ test('select.matches()', function(t) {
11301130 sst . end ( )
11311131 } )
11321132
1133+ st . test ( ':scope' , function ( sst ) {
1134+ sst . ok ( matches ( ':scope' , h ( 'html' ) ) , 'always true for elements' )
1135+ sst . ok ( matches ( ':scope' , h ( 'p' ) ) , 'always true for elements' )
1136+ sst . notOk ( matches ( ':scope' , u ( 'text' ) , '!' ) , 'always true for elements' )
1137+ sst . end ( )
1138+ } )
1139+
1140+ st . test ( ':read-write' , function ( sst ) {
1141+ sst . ok ( matches ( ':read-write' , h ( 'input' ) ) , 'true on input' )
1142+ sst . ok ( matches ( ':read-write' , h ( 'input' ) ) , 'true on textarea' )
1143+ sst . notOk (
1144+ matches ( ':read-write' , h ( 'input' , { readOnly : true } ) ) ,
1145+ 'false on input w/ readonly'
1146+ )
1147+ sst . notOk (
1148+ matches ( ':read-write' , h ( 'textarea' , { readOnly : true } ) ) ,
1149+ 'false on textarea w/ readonly'
1150+ )
1151+ sst . notOk (
1152+ matches ( ':read-write' , h ( 'input' , { disabled : true } ) ) ,
1153+ 'false on input w/ disabled'
1154+ )
1155+ sst . notOk (
1156+ matches ( ':read-write' , h ( 'textarea' , { disabled : true } ) ) ,
1157+ 'false on textarea w/ disabled'
1158+ )
1159+ sst . ok (
1160+ matches ( ':read-write' , h ( 'div' , { contentEditable : 'true' } ) ) ,
1161+ 'true on element w/ contenteditable'
1162+ )
1163+
1164+ sst . end ( )
1165+ } )
1166+
1167+ st . test ( ':read-only' , function ( sst ) {
1168+ sst . notOk ( matches ( ':read-only' , h ( 'input' ) ) , 'false on input' )
1169+ sst . notOk ( matches ( ':read-only' , h ( 'input' ) ) , 'false on textarea' )
1170+ sst . ok (
1171+ matches ( ':read-only' , h ( 'input' , { readOnly : true } ) ) ,
1172+ 'true on input w/ readonly'
1173+ )
1174+ sst . ok (
1175+ matches ( ':read-only' , h ( 'textarea' , { readOnly : true } ) ) ,
1176+ 'true on textarea w/ readonly'
1177+ )
1178+ sst . ok (
1179+ matches ( ':read-only' , h ( 'input' , { disabled : true } ) ) ,
1180+ 'true on input w/ disabled'
1181+ )
1182+ sst . ok (
1183+ matches ( ':read-only' , h ( 'textarea' , { disabled : true } ) ) ,
1184+ 'true on textarea w/ disabled'
1185+ )
1186+ sst . notOk (
1187+ matches ( ':read-only' , h ( 'div' , { contentEditable : 'true' } ) ) ,
1188+ 'false on element w/ contenteditable'
1189+ )
1190+
1191+ sst . end ( )
1192+ } )
1193+
11331194 st . end ( )
11341195 } )
11351196
0 commit comments