Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / label / label-contains-other-interactive-content.html
blob55d2fb48aac248ae654923f63a8221cc6cfbee3e
1 <!DOCTYPE html>
2 <body id="body">
3 <script src="../../../resources/js-test.js"></script>
4 <script src="../resources/common.js"></script>
5 <script>
6 var interactiveElements1 = ['button', 'details', 'embed', 'iframe', 'keygen', 'label', 'select', 'textarea'];
7 var interactiveElements2 = [
8 ['a', 'href'],
9 ['audio', 'controls'],
10 ['video', 'controls'],
11 ['img', 'usemap'],
12 ['object', 'usemap'],
15 var label = document.createElement('label');
16 document.body.appendChild(label);
17 var control = document.createElement('input');
18 control.id = 'control';
19 label.appendChild(control);
21 interactiveElements1.forEach(function(tag) {
22 var element = document.createElement(tag);
23 element.id = tag;
24 element.style.display = 'block';
25 element.style.width = '100px';
26 element.style.height = '100px';
27 label.appendChild(element);
28 clickElement(element);
29 debug(tag);
30 shouldNotBe('document.activeElement.id', '"control"');
31 document.activeElement.blur();
32 label.removeChild(element);
33 });
34 debug('');
36 interactiveElements2.forEach(function(entry) {
37 var element = document.createElement(entry[0]);
38 element.id = entry[0];
39 element.style.display = 'block';
40 element.style.width = '100px';
41 element.style.height = '100px';
42 label.appendChild(element);
43 // Audio elements without controls attribute is always invisible.
44 if (entry[0] != 'audio') {
45 clickElement(element);
46 debug(entry[0]);
47 shouldBeEqualToString('document.activeElement.id', 'control');
49 document.activeElement.blur();
51 element.setAttribute(entry[1], entry[1]);
52 // Prevents page transition.
53 if (entry[0] == 'a')
54 element.addEventListener('click', function(e) { e.preventDefault(); }, false);
55 clickElement(element);
56 debug(entry[0] + '[' + entry[1] + ']');
57 shouldNotBe('document.activeElement.id', '"control"');
58 document.activeElement.blur();
59 label.removeChild(element);
60 });
62 var element = document.createElement('input');
63 element.id = 'input';
64 element.type = 'text';
65 element.style.display = 'block';
66 element.style.width = '100px';
67 element.style.height = '100px';
68 label.appendChild(element);
69 clickElement(element);
70 debug('input');
71 shouldNotBe('document.activeElement.id', '"control"');
72 document.activeElement.blur();
74 // Note: It's impossible to click on input[type=hidden].
76 label.remove();
77 </script>
78 </body>