Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / access-key-case-insensitive.html
blobf4cbb71043caf09ba20b8188eb09ff6bdd5b7e02
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Case insensitiveness of accesskey attribute</title>
5 <script src="../../resources/js-test.js"></script>
6 </head>
7 </head>
8 <body>
9 <script>
10 description('Access key should work case-insensitively. To test this manually, press &lt;alt&gt;+a, &lt;alt&gt;+&lt;shift&gt;+b and &lt;alt&gt;+&lt;shift&gt;+c keys in this order (on Mac OS X, press &lt;ctrl&gt;+&lt;opt&gt; instead of &lt;alt&gt;).');
12 window.jsTestIsAsync = true;
14 function isUpperCase(string)
16 return string === string.toUpperCase();
19 function pressKey(key)
21 var modifiers;
22 if (navigator.userAgent.search(/\bMac OS X\b/) !== -1)
23 modifiers = ["ctrlKey", "altKey"];
24 else
25 modifiers = ["altKey"];
27 if (isUpperCase(key)) {
28 modifiers.push("shiftKey");
29 key = key.toLowerCase();
32 if (window.eventSender)
33 eventSender.keyDown(key, modifiers);
36 document.addEventListener("DOMContentLoaded", function () {
37 var input = document.createElement('input');
38 input.accessKey = 'A';
39 input.onfocus = function () {
40 testPassed('Pressing the "a" access key triggered a focus event.');
41 input.blur();
42 input.accessKey = 'b';
43 input.onfocus = function () {
44 testPassed('Pressing the "B" access key triggered a focus event.');
45 input.blur();
46 input.setAttribute('accesskey', 'C');
47 input.onfocus = function () {
48 testPassed('Pressing the "C" access key triggered a focus event.');
49 document.body.removeChild(input);
50 finishJSTest();
52 pressKey('C');
54 pressKey('B');
56 document.body.appendChild(input);
57 pressKey('a');
58 });
59 </script>
60 </body>
61 </html>