File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
html/semantics/forms/the-input-element Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < title > Test showPicker() disabled/readonly requirement</ title >
3
+ < script src ="/resources/testharness.js "> </ script >
4
+ < script src ="/resources/testharnessreport.js "> </ script >
5
+ < script src ="/resources/testdriver.js "> </ script >
6
+ < script src ="/resources/testdriver-vendor.js "> </ script >
7
+ < body > </ body >
8
+ < script type =module >
9
+ import inputTypes from "./input-types.js" ;
10
+
11
+ for ( const inputType of inputTypes ) {
12
+ test ( ( ) => {
13
+ const input = document . createElement ( "input" ) ;
14
+ input . setAttribute ( "type" , inputType ) ;
15
+ input . setAttribute ( "disabled" , "" ) ;
16
+
17
+ assert_throws_dom ( 'InvalidStateError' , ( ) => { input . showPicker ( ) ; } ) ;
18
+ } , `input[type=${ inputType } ] showPicker() throws when disabled` ) ;
19
+ }
20
+
21
+ for ( const inputType of inputTypes ) {
22
+ test ( ( ) => {
23
+ const input = document . createElement ( "input" ) ;
24
+ input . setAttribute ( "type" , inputType ) ;
25
+ input . setAttribute ( "readonly" , "" ) ;
26
+
27
+ assert_throws_dom ( 'InvalidStateError' , ( ) => { input . showPicker ( ) ; } ) ;
28
+ } , `input[type=${ inputType } ] showPicker() throws when readonly` ) ;
29
+ }
30
+ </ script >
File renamed without changes.
You can’t perform that action at this time.
0 commit comments