| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../../resources/accessibility-helper.js"></script> |
| <script src="../../resources/js-test.js"></script> |
| </head> |
| <body> |
| |
| <a href="http://www.webkit.org" id="link" accesskey="w">webkit</a><br> |
| <a href="http://www.webkit.org" id="link-display-contents" accesskey="z" style="display:contents">webkit</a><br> |
| <input type="text" id="input" accesskey="q"> |
| |
| <script> |
| var output = "This test makes sure that elements return their accesskeys.\n\n"; |
| |
| if (window.accessibilityController) { |
| window.jsTestIsAsync = true; |
| |
| var link = accessibilityController.accessibleElementById("link"); |
| output += expect("link.allAttributes().indexOf('AXAccessKey: w') !== -1", "true"); |
| |
| var linkDisplayContents = accessibilityController.accessibleElementById("link-display-contents"); |
| output += expect("linkDisplayContents.allAttributes().indexOf('AXAccessKey: z') !== -1", "true"); |
| |
| var input = accessibilityController.accessibleElementById("input"); |
| output += expect("input.allAttributes().indexOf('AXAccessKey: q') !== -1", "true"); |
| |
| output += "\nUpdating #link accesskey to 'u'.\n"; |
| document.getElementById("link").setAttribute("accesskey", "u"); |
| setTimeout(async function() { |
| await waitFor(() => link.allAttributes().indexOf("AXAccessKey: u") !== -1); |
| output += "PASS: accesskey AX attribute was updated correctly.\n"; |
| |
| debug(output); |
| finishJSTest(); |
| }, 0); |
| } |
| </script> |
| </body> |
| </html> |
| |