OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body id="body"> | 2 <body id="body"> |
3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
4 <script src="../resources/common.js"></script> | 4 <script src="../resources/common.js"></script> |
5 <script> | 5 <script> |
6 var interactiveElements1 = ['button', 'details', 'embed', 'iframe', 'keygen', 'l
abel', 'select', 'textarea']; | 6 var interactiveElements1 = ['button', 'details', 'embed', 'iframe', 'keygen', 'l
abel', 'select', 'textarea']; |
7 var interactiveElements2 = [ | 7 var interactiveElements2 = [ |
8 ['a', 'href'], | 8 ['a', 'href'], |
9 ['audio', 'controls'], | 9 ['audio', 'controls'], |
10 ['video', 'controls'], | 10 ['video', 'controls'], |
(...skipping 22 matching lines...) Expand all Loading... |
33 }); | 33 }); |
34 debug(''); | 34 debug(''); |
35 | 35 |
36 interactiveElements2.forEach(function(entry) { | 36 interactiveElements2.forEach(function(entry) { |
37 var element = document.createElement(entry[0]); | 37 var element = document.createElement(entry[0]); |
38 element.id = entry[0]; | 38 element.id = entry[0]; |
39 element.style.display = 'block'; | 39 element.style.display = 'block'; |
40 element.style.width = '100px'; | 40 element.style.width = '100px'; |
41 element.style.height = '100px'; | 41 element.style.height = '100px'; |
42 label.appendChild(element); | 42 label.appendChild(element); |
43 clickElement(element); | |
44 // Audio elements without controls attribute is always invisible. | 43 // Audio elements without controls attribute is always invisible. |
45 if (entry[0] != 'audio') { | 44 if (entry[0] != 'audio') { |
| 45 clickElement(element); |
46 debug(entry[0]); | 46 debug(entry[0]); |
47 shouldBeEqualToString('document.activeElement.id', 'control'); | 47 shouldBeEqualToString('document.activeElement.id', 'control'); |
48 } | 48 } |
49 document.activeElement.blur(); | 49 document.activeElement.blur(); |
50 | 50 |
51 element.setAttribute(entry[1], entry[1]); | 51 element.setAttribute(entry[1], entry[1]); |
52 // Prevents page transition. | 52 // Prevents page transition. |
53 if (entry[0] == 'a') | 53 if (entry[0] == 'a') |
54 element.addEventListener('click', function(e) { e.preventDefault(); }, f
alse); | 54 element.addEventListener('click', function(e) { e.preventDefault(); }, f
alse); |
55 clickElement(element); | 55 clickElement(element); |
(...skipping 13 matching lines...) Expand all Loading... |
69 clickElement(element); | 69 clickElement(element); |
70 debug('input'); | 70 debug('input'); |
71 shouldNotBe('document.activeElement.id', '"control"'); | 71 shouldNotBe('document.activeElement.id', '"control"'); |
72 document.activeElement.blur(); | 72 document.activeElement.blur(); |
73 | 73 |
74 // Note: It's impossible to click on input[type=hidden]. | 74 // Note: It's impossible to click on input[type=hidden]. |
75 | 75 |
76 label.remove(); | 76 label.remove(); |
77 </script> | 77 </script> |
78 </body> | 78 </body> |
OLD | NEW |