3 <title>"readonly", :read-only and :read-write
</title>
5 input { background: red; }
6 #i1:read-write { background: lime; }
7 #i2 { background: lime; }
8 #i2:read-only { background: red; }
9 #i3:read-write { background: lime; }
10 #i4:read-only { background: lime; }
11 #i5:read-only { background: lime; }
12 #i6:read-write { background: lime; }
15 <link rel=
"help" href=
"http://whatwg.org/specs/web-forms/current-work/#readonly">
16 <link rel=
"help" href=
"http://whatwg.org/specs/web-forms/current-work/#relation">
17 <script language=
"JavaScript" type=
"text/javascript">
18 function log(message
) {
19 document
.getElementById("console").innerHTML
+= "<li>"+message
+"</li>";
23 if (window
.testRunner
)
24 testRunner
.dumpAsText();
26 document
.getElementById('i3').removeAttribute('readonly');
27 document
.getElementById('i4').readOnly
= true;
28 document
.getElementById('i5').setAttribute('readonly','readonly');
29 document
.getElementById('i6').readOnly
= false;
31 var i
= document
.getElementsByTagName("input");
32 for (c
= 0; c
< i
.length
; c
++) {
33 if (document
.defaultView
.getComputedStyle(i
[c
], null).getPropertyValue('background-color') == "rgb(0, 255, 0)")
41 <body onload=
"test()">
42 <p>This test checks for :read-only and :read-write right behavior along with readonly attribute. Fails if some FAILURE is shown below.
</p>
45 <input type=
"radio" readonly=
"readonly" id=
"i2"/>
46 <input readonly=
"readonly" id=
"i3"/>
49 <input readonly=
"readonly" id=
"i6"/>
51 <ol id=
"console"></ol>