1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
6 output, meter, progress {
12 <p id=
"description"></p>
13 <div id=
"console"></div>
15 description('This test ensures that <output>, <meter> and <progress> are not focused.');
17 function moveFocus(element
) {
18 if (window
.testRunner
)
19 eventSender
.keyDown('\t');
24 function checkFocus() {
25 var active
= document
.activeElement
.nodeName
;
26 if (active
== "OUTPUT" || active
== "METER" || active
== "PROGRESS") {
27 debug(active
+ ' should not have focus.');
33 var input
= document
.createElement('input');
34 var output
= document
.createElement('output');
35 var progress
= document
.createElement('progress');
36 var meter
= document
.createElement('meter');
38 // Set a placeholder text to the output element to display the element.
39 output
.innerHTML
= 'Text in output element';
41 document
.body
.appendChild(input
);
42 document
.body
.appendChild(output
);
43 document
.body
.appendChild(progress
);
44 document
.body
.appendChild(meter
);
46 debug('- Moves the focus by using keyDown() in DRT, otherwise using element.focus().');
47 debug('- checkFocus() returns true when <output>, <meter> and <progress> do not have focus.');
50 shouldBeTrue('checkFocus()');
52 shouldBeTrue('checkFocus()');
54 shouldBeTrue('checkFocus()');
56 shouldBeTrue('checkFocus()');