5 var c
= document
.getElementById('console')
6 c
.innerHTML
+= (str
+ "<br>")
10 if (window
.testRunner
)
11 testRunner
.dumpAsText();
13 var input1
= document
.getElementById('input1');
14 input1
.value
= 'Test';
16 var input1clone
= input1
.cloneNode(true);
17 if (input1clone
.value
!= input1
.value
) {
18 debug('FAILURE: input1clone.value was "' + input1clone
.value
+ '", expected "' + input1
.value
+ '"')
22 var input1imported
= document
.importNode(input1
, true);
23 if (input1imported
.value
!= input1
.value
) {
24 debug('FAILURE: input1imported.value was "' + input1imported
.value
+ '", expected "' + input1
.value
+ '"')
28 var input2
= document
.getElementById('input2');
29 input2
.checked
= true;
30 var input2clone
= input2
.cloneNode(true);
31 if (input2clone
.checked
!= input2
.checked
) {
32 debug('FAILURE: input2clone.checked was "' + input2clone
.checked
+ '", expected "' + input2
.checked
+ '"')
36 var input2imported
= document
.importNode(input2
, true);
37 if (input2imported
.checked
!= input2
.checked
) {
38 debug('FAILURE: input2imported.checked was "' + input2imported
.checked
+ '", expected "' + input2
.checked
+ '"')
47 <body onload=
"runTests();">
48 <input id=
"input1" type=
"text">
49 <input id=
"input2" type=
"checkbox" checked=
"checked">
51 This tests that cloneNode and importNode copy the form element properties that aren't stored in values, such as 'value', and 'checked'.
52 If this test is successful, the text SUCCESS should be shown below.
53 This is a variation on the base test that has the checked attribute already set, which at one point
54 caused a crash (see
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=6617">Bugzilla bug
6617</a>).
56 <pre id=
"console"></pre>