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 | <html> |
michael@0 | 2 | |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Testing HTML scrollable frames (css overflow style)</title> |
michael@0 | 5 | |
michael@0 | 6 | <link rel="stylesheet" type="text/css" |
michael@0 | 7 | href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 11 | |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="../common.js"></script> |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../role.js"></script> |
michael@0 | 16 | <script type="application/javascript" |
michael@0 | 17 | src="../events.js"></script> |
michael@0 | 18 | |
michael@0 | 19 | <script type="application/javascript"> |
michael@0 | 20 | |
michael@0 | 21 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 22 | // Invokers |
michael@0 | 23 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 24 | |
michael@0 | 25 | /** |
michael@0 | 26 | * Change scroll range to not empty size and inserts a child into container |
michael@0 | 27 | * to trigger tree update of the container. Prior to bug 677154 not empty |
michael@0 | 28 | * size resulted to accessible creation for scroll area, container tree |
michael@0 | 29 | * update picked up that accessible unattaching scroll area accessible |
michael@0 | 30 | * subtree. |
michael@0 | 31 | */ |
michael@0 | 32 | function changeScrollRange(aContainerID, aScrollAreaID) |
michael@0 | 33 | { |
michael@0 | 34 | this.containerNode = getNode(aContainerID); |
michael@0 | 35 | this.container = getAccessible(this.containerNode); |
michael@0 | 36 | this.scrollAreaNode = getNode(aScrollAreaID); |
michael@0 | 37 | |
michael@0 | 38 | this.eventSeq = [ |
michael@0 | 39 | new invokerChecker(EVENT_REORDER, this.container) |
michael@0 | 40 | ]; |
michael@0 | 41 | |
michael@0 | 42 | this.invoke = function changeScrollRange_invoke() |
michael@0 | 43 | { |
michael@0 | 44 | this.scrollAreaNode.style.width = "20px"; |
michael@0 | 45 | this.containerNode.appendChild(document.createElement("input")); |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | this.finalCheck = function changeScrollRange_finalCheck() |
michael@0 | 49 | { |
michael@0 | 50 | var accTree = |
michael@0 | 51 | { SECTION: [ // container |
michael@0 | 52 | { SECTION: [ // scroll area |
michael@0 | 53 | { ENTRY: [] } // child content |
michael@0 | 54 | ] }, |
michael@0 | 55 | { ENTRY: [] } // inserted input |
michael@0 | 56 | ] }; |
michael@0 | 57 | testAccessibleTree(this.container, accTree); |
michael@0 | 58 | } |
michael@0 | 59 | |
michael@0 | 60 | this.getID = function changeScrollRange_getID() |
michael@0 | 61 | { |
michael@0 | 62 | return "change scroll range for " + prettyName(aScrollAreaID); |
michael@0 | 63 | } |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | /** |
michael@0 | 67 | * Change scrollbar styles from hidden to auto. That makes us to create an |
michael@0 | 68 | * accessible for scroll area. |
michael@0 | 69 | */ |
michael@0 | 70 | function changeScrollbarStyles(aContainerID, aScrollAreaID) |
michael@0 | 71 | { |
michael@0 | 72 | this.container = getAccessible(aContainerID); |
michael@0 | 73 | this.scrollAreaNode = getNode(aScrollAreaID); |
michael@0 | 74 | |
michael@0 | 75 | this.eventSeq = [ |
michael@0 | 76 | new invokerChecker(EVENT_SHOW, getAccessible, this.scrollAreaNode), |
michael@0 | 77 | new invokerChecker(EVENT_REORDER, this.container) |
michael@0 | 78 | ]; |
michael@0 | 79 | |
michael@0 | 80 | this.invoke = function changeScrollbarStyles_invoke() |
michael@0 | 81 | { |
michael@0 | 82 | var accTree = |
michael@0 | 83 | { SECTION: [] }; |
michael@0 | 84 | testAccessibleTree(this.container, accTree); |
michael@0 | 85 | |
michael@0 | 86 | this.scrollAreaNode.style.overflow = "auto"; |
michael@0 | 87 | } |
michael@0 | 88 | |
michael@0 | 89 | this.finalCheck = function changeScrollbarStyles_finalCheck() |
michael@0 | 90 | { |
michael@0 | 91 | var accTree = |
michael@0 | 92 | { SECTION: [ // container |
michael@0 | 93 | { SECTION: [] } // scroll area |
michael@0 | 94 | ] }; |
michael@0 | 95 | testAccessibleTree(this.container, accTree); |
michael@0 | 96 | } |
michael@0 | 97 | |
michael@0 | 98 | this.getID = function changeScrollbarStyles_getID() |
michael@0 | 99 | { |
michael@0 | 100 | return "change scrollbar styles " + prettyName(aScrollAreaID); |
michael@0 | 101 | } |
michael@0 | 102 | } |
michael@0 | 103 | |
michael@0 | 104 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 105 | // Do tests |
michael@0 | 106 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 107 | |
michael@0 | 108 | var gQueue = null; |
michael@0 | 109 | //gA11yEventDumpID = "eventdump"; // debug stuff |
michael@0 | 110 | //gA11yEventDumpToConsole = true; |
michael@0 | 111 | |
michael@0 | 112 | function doTests() |
michael@0 | 113 | { |
michael@0 | 114 | gQueue = new eventQueue(); |
michael@0 | 115 | |
michael@0 | 116 | gQueue.push(new changeScrollRange("container", "scrollarea")); |
michael@0 | 117 | gQueue.push(new changeScrollbarStyles("container2", "scrollarea2")); |
michael@0 | 118 | |
michael@0 | 119 | gQueue.invoke(); // Will call SimpleTest.finish(); |
michael@0 | 120 | } |
michael@0 | 121 | |
michael@0 | 122 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 123 | addA11yLoadEvent(doTests); |
michael@0 | 124 | </script> |
michael@0 | 125 | </head> |
michael@0 | 126 | |
michael@0 | 127 | <body> |
michael@0 | 128 | |
michael@0 | 129 | <a target="_blank" |
michael@0 | 130 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=677154" |
michael@0 | 131 | title="Detached document accessibility tree"> |
michael@0 | 132 | Mozilla Bug 677154</a> |
michael@0 | 133 | |
michael@0 | 134 | <p id="display"></p> |
michael@0 | 135 | <div id="content" style="display: none"></div> |
michael@0 | 136 | <pre id="test"> |
michael@0 | 137 | </pre> |
michael@0 | 138 | <div id="eventdump"></div> |
michael@0 | 139 | |
michael@0 | 140 | <div id="container"><div id="scrollarea" style="overflow:auto;"><input></div></div> |
michael@0 | 141 | <div id="container2"><div id="scrollarea2" style="overflow:hidden;"></div></div> |
michael@0 | 142 | </body> |
michael@0 | 143 | </html> |