| <title>Mutating accesskey attribute</title> |
| <script src="../../resources/js-test.js"></script> |
| description('Access key should work after accesskey attribute is mutated. To test this manually, press <alt>+a, <alt>+b and <alt>+c keys in this order (on Mac OS X, press <Ctrl>+<Opt> instead of <alt>).'); |
| window.jsTestIsAsync = true; |
| if (navigator.userAgent.search(/\bMac OS X\b/) !== -1) |
| modifiers = ["ctrlKey", "altKey"]; |
| eventSender.keyDown(key, modifiers); |
| document.addEventListener("DOMContentLoaded", function () { |
| var input = document.createElement('input'); |
| input.onfocus = function () { |
| testPassed('Pressing the "a" access key triggered a focus event.'); |
| input.onfocus = function () { |
| testPassed('Pressing the "b" access key triggered a focus event.'); |
| input.setAttribute('accesskey', 'c'); |
| input.onfocus = function () { |
| testPassed('Pressing the "c" access key triggered a focus event.'); |
| document.body.removeChild(input); |
| document.body.appendChild(input); |