Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / label-element-press.html
blobc9e50acab1f26c767196ddde5dd6bfbad41efa7b
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 </head>
7 <body id="body">
9 <label tabindex=0 onclick="performEvent();" id="labelElement">label</label>
11 <p id="description"></p>
12 <div id="console"></div>
14 <script>
16 description("This tests that a label element without a corresponding control will perform a press action on itself instead of nothing.");
18 function performEvent() {
19 testRunner.notifyDone();
22 if (window.accessibilityController) {
24 testRunner.waitUntilDone();
25 document.getElementById("body").focus();
26 var body = accessibilityController.focusedElement;
27 var label = body.childAtIndex(0).childAtIndex(0);
29 // if successful, performEvent() will be called and we'll successfully parse.
30 label.press();
33 </script>
35 </body>
36 </html>