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