cfleizach@apple.com | 96bd4a0 | 2010-03-15 22:07:20 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 | <html> |
| 3 | <head> |
ap@apple.com | fcade89 | 2017-05-19 23:37:59 +0000 | [diff] [blame] | 4 | <script src="../resources/js-test.js"></script> |
cfleizach@apple.com | 96bd4a0 | 2010-03-15 22:07:20 +0000 | [diff] [blame] | 5 | </head> |
| 6 | |
| 7 | <body id="body"> |
| 8 | |
ap@apple.com | fcade89 | 2017-05-19 23:37:59 +0000 | [diff] [blame] | 9 | <label tabindex=0 onclick="finishJSTest()" id="labelElement">label</label> |
cfleizach@apple.com | 96bd4a0 | 2010-03-15 22:07:20 +0000 | [diff] [blame] | 10 | |
| 11 | <p id="description"></p> |
| 12 | <div id="console"></div> |
| 13 | |
| 14 | <script> |
| 15 | |
| 16 | description("This tests that a label element without a corresponding control will perform a press action on itself instead of nothing."); |
ap@apple.com | fcade89 | 2017-05-19 23:37:59 +0000 | [diff] [blame] | 17 | jsTestIsAsync = true; |
cfleizach@apple.com | 96bd4a0 | 2010-03-15 22:07:20 +0000 | [diff] [blame] | 18 | |
| 19 | if (window.accessibilityController) { |
cfleizach@apple.com | 96bd4a0 | 2010-03-15 22:07:20 +0000 | [diff] [blame] | 20 | document.getElementById("body").focus(); |
| 21 | var body = accessibilityController.focusedElement; |
| 22 | var label = body.childAtIndex(0).childAtIndex(0); |
| 23 | |
| 24 | // if successful, performEvent() will be called and we'll successfully parse. |
| 25 | label.press(); |
| 26 | } |
| 27 | |
cfleizach@apple.com | 96bd4a0 | 2010-03-15 22:07:20 +0000 | [diff] [blame] | 28 | </script> |
cfleizach@apple.com | 96bd4a0 | 2010-03-15 22:07:20 +0000 | [diff] [blame] | 29 | </body> |
| 30 | </html> |