accessible/tests/mochitest/tree/test_cssoverflow.html

branch
TOR_BUG_9701
changeset 14
925c144e1f1f
equal deleted inserted replaced
-1:000000000000 0:05fbd659f670
1 <html>
2
3 <head>
4 <title>CSS overflow testing</title>
5
6 <link rel="stylesheet" type="text/css"
7 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
8
9 <style>
10 a.link:focus {
11 overflow: scroll;
12 }
13 </style>
14
15 <script type="application/javascript"
16 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
17 <script type="application/javascript"
18 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
19
20 <script type="application/javascript"
21 src="../common.js"></script>
22 <script type="application/javascript"
23 src="../events.js"></script>
24
25 <script type="application/javascript">
26 ////////////////////////////////////////////////////////////////////////////
27 // Invokers
28
29 function focusAnchor(aID)
30 {
31 this.linkNode = getNode(aID);
32 this.link = getAccessible(this.linkNode);
33
34 this.eventSeq = [
35 new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode)
36 ];
37
38 this.invoke = function focusAnchor_invoke()
39 {
40 this.linkNode.focus();
41 }
42
43 this.check = function focusAnchor_check(aEvent)
44 {
45 todo_is(this.link, aEvent.accessible,
46 "Focus should be fired against new link accessible!");
47 }
48
49 this.getID = function focusAnchor_getID()
50 {
51 return "focus a:focus{overflow:scroll} #1";
52 }
53 }
54
55 function tabAnchor(aID)
56 {
57 this.linkNode = getNode(aID);
58 this.link = getAccessible(this.linkNode);
59
60 this.eventSeq = [
61 new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode)
62 ];
63
64 this.invoke = function tabAnchor_invoke()
65 {
66 synthesizeKey("VK_TAB", { shiftKey: false });
67 }
68
69 this.check = function tabAnchor_check(aEvent)
70 {
71 todo_is(this.link, aEvent.accessible,
72 "Focus should be fired against new link accessible!");
73 }
74
75 this.getID = function tabAnchor_getID()
76 {
77 return "focus a:focus{overflow:scroll} #2";
78 }
79 }
80
81 ////////////////////////////////////////////////////////////////////////////
82 // Do tests
83
84 var gQueue = null;
85 //gA11yEventDumpID = "eventdump"; // debug stuff
86 //gA11yEventDumpToConsole = true;
87
88 function doTests()
89 {
90 // Shift+Tab not working, and a test timeout, bug 746977
91 if (MAC) {
92 todo(false, "Shift+tab isn't working on OS X, needs to be disabled until bug 746977 is fixed!");
93 SimpleTest.finish();
94 return;
95 }
96
97 gQueue = new eventQueue();
98
99 // CSS 'overflow: scroll' property setting and unsetting causes accessible
100 // recreation (and fire show/hide events). For example, the focus and
101 // blur of HTML:a with ':focus {overflow: scroll; }' CSS style causes its
102 // accessible recreation. The focus event should be fired on new
103 // accessible.
104 gQueue.push(new focusAnchor("a"));
105 gQueue.push(new tabAnchor("a2"));
106
107 gQueue.invoke(); // Will call SimpleTest.finish();
108 }
109
110 SimpleTest.waitForExplicitFinish();
111 addA11yLoadEvent(doTests);
112 </script>
113 </head>
114
115 <body>
116
117 <a target="_blank"
118 href="https://bugzilla.mozilla.org/show_bug.cgi?id=591163"
119 title="mochitest for bug 413777: focus the a:focus {overflow: scroll;} shouldn't recreate HTML a accessible">
120 Mozilla Bug 591163
121 </a><br>
122 <a target="_blank"
123 title="Rework accessible tree update code"
124 href="https://bugzilla.mozilla.org/show_bug.cgi?id=570275">
125 Mozilla Bug 570275
126 </a><br>
127 <a target="_blank"
128 title="Text control frames should accept dynamic changes to the CSS overflow property"
129 href="https://bugzilla.mozilla.org/show_bug.cgi?id=686247">
130 Mozilla Bug 686247
131 </a><br>
132
133 <p id="display"></p>
134 <div id="content" style="display: none"></div>
135 <pre id="test">
136 </pre>
137 <div id="eventdump"></div>
138
139 <div>
140 <a id="a" class="link" href="www">link</a>
141 </div>
142 <div>
143 <a id="a2" class="link" href="www">link2</a>
144 </div>
145 </body>
146 </html>

mercurial