accessible/tests/mochitest/treeupdate/test_cssoverflow.html

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

mercurial