|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <title>Accessible boundaries when page is zoomed</title> |
|
5 <link rel="stylesheet" type="text/css" |
|
6 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
7 |
|
8 <script type="application/javascript" |
|
9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <script type="application/javascript" |
|
11 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
|
12 |
|
13 <script type="application/javascript" |
|
14 src="../common.js"></script> |
|
15 <script type="application/javascript" |
|
16 src="../role.js"></script> |
|
17 <script type="application/javascript" |
|
18 src="../layout.js"></script> |
|
19 <script type="application/javascript" |
|
20 src="../events.js"></script> |
|
21 |
|
22 <script type="application/javascript"> |
|
23 function openComboboxNCheckBounds(aID) |
|
24 { |
|
25 this.combobox = getAccessible(aID); |
|
26 this.comboboxList = this.combobox.firstChild; |
|
27 this.comboboxOption = this.comboboxList.firstChild; |
|
28 |
|
29 this.eventSeq = [ |
|
30 new invokerChecker(EVENT_FOCUS, this.comboboxOption) |
|
31 ]; |
|
32 |
|
33 this.invoke = function openComboboxNCheckBounds_invoke() |
|
34 { |
|
35 getNode(aID).focus(); |
|
36 synthesizeKey("VK_DOWN", { altKey: true }); |
|
37 } |
|
38 |
|
39 this.finalCheck = function openComboboxNCheckBounds_invoke() |
|
40 { |
|
41 testBounds(this.comboboxOption); |
|
42 } |
|
43 |
|
44 this.getID = function openComboboxNCheckBounds_getID() |
|
45 { |
|
46 return "open combobox and test boundaries"; |
|
47 } |
|
48 } |
|
49 |
|
50 //gA11yEventDumpToConsole = true; |
|
51 |
|
52 var gQueue = null; |
|
53 |
|
54 function doTest() |
|
55 { |
|
56 // Combobox |
|
57 testBounds("combobox"); |
|
58 |
|
59 // Option boundaries matches to combobox boundaries when collapsed. |
|
60 var selectBounds = getBoundsForDOMElm("combobox"); |
|
61 testBounds("option1", selectBounds); |
|
62 |
|
63 // Open combobox and test option boundaries. |
|
64 gQueue = new eventQueue(); |
|
65 gQueue.push(new openComboboxNCheckBounds("combobox")); |
|
66 gQueue.invoke(); // Will call SimpleTest.finish(); |
|
67 } |
|
68 |
|
69 SimpleTest.waitForExplicitFinish(); |
|
70 addA11yLoadEvent(doTest); |
|
71 </script> |
|
72 </head> |
|
73 <body> |
|
74 |
|
75 <p id="display"></p> |
|
76 <div id="content" style="display: none"></div> |
|
77 <pre id="test"> |
|
78 </pre> |
|
79 |
|
80 <select id="combobox"> |
|
81 <option id="option1">item1</option> |
|
82 <option>item2</option> |
|
83 </select> |
|
84 </body> |
|
85 </html> |