REGRESSION(r184899): Crash when focusing an input element styled with a web font
[WebKit-https.git] / LayoutTests / accessibility / mac / radio-button-checkbox-size.html
1 <html>
2 <script>
3     if (window.testRunner)
4         testRunner.dumpAsText();
5 </script>
6 <body>
7     
8     <div id="result"></div>
9     
10     <!-- Test radio/checkbox without labels -->
11     <input type="radio" name="r1" id="r1">Test<br>
12     <input type="checkbox" name="cb1" id="cb1">Test<br>
13     
14     <!-- Test radio/checkbox with labels -->
15     <input type="radio" name="r2" id="r2"><label for="r2">This is a long test label that should be included in the size of this object</label><br>
16     <input type="checkbox" name="cb2" id="cb2"><label for="cb2">This is a long test label that should be included in the size of this object</label><br>
17
18      
19     <script>
20         if (window.accessibilityController) {
21             var result = document.getElementById("result");
22
23             // radio button 1
24             var r1 = document.getElementById("r1");
25             r1.focus();
26             var focusedElement = accessibilityController.focusedElement;
27             var width = focusedElement.width;
28             var height = focusedElement.height;
29
30             result.innerText += "Radio1: ";
31             if (width <= 0 || height <= 0) {
32                 result.innerText += "Fail";
33             } else {
34                 result.innerText += "Pass";            
35             }
36             result.innerText += "\n";
37
38             // check box 1
39             var cb1 = document.getElementById("cb1");
40             cb1.focus();
41             focusedElement = accessibilityController.focusedElement;
42             width = focusedElement.width;
43             height = focusedElement.height;
44
45             result.innerText += "Checkbox1: ";
46             if (width <= 0 || height <= 0) {
47                 result.innerText += "Fail";
48             } else {
49                 result.innerText += "Pass";            
50             }
51             result.innerText += "\n";
52
53             // radio button with label (width should be more than 100 px)
54             var cb1 = document.getElementById("r2");
55             cb1.focus();
56             focusedElement = accessibilityController.focusedElement;
57             width = focusedElement.width;
58             height = focusedElement.height;
59
60             result.innerText += "Radio2: ";
61             if (width <= 100 || height <= 0) {
62                 result.innerText += "Fail";
63             } else {
64                 result.innerText += "Pass";            
65             }
66             result.innerText += "\n";
67
68             // checkbox with label (width should be more than 100 px)
69             var cb1 = document.getElementById("cb2");
70             cb1.focus();
71             focusedElement = accessibilityController.focusedElement;
72             width = focusedElement.width;
73             height = focusedElement.height;
74
75             result.innerText += "Checkbox2: ";
76             if (width <= 100 || height <= 0) {
77                 result.innerText += "Fail";
78             } else {
79                 result.innerText += "Pass";            
80             }
81             result.innerText += "\n";
82
83         }
84     </script>
85 </body>
86 </html>