accessible/tests/mochitest/tree/test_list.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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>HTML ul/li element tests</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
michael@0 11 <script type="application/javascript"
michael@0 12 src="../common.js"></script>
michael@0 13 <script type="application/javascript"
michael@0 14 src="../role.js"></script>
michael@0 15
michael@0 16 <script type="application/javascript">
michael@0 17 function listItemTree(aBulletText, aName, aSubtree)
michael@0 18 {
michael@0 19 var obj = {
michael@0 20 role: ROLE_LISTITEM,
michael@0 21 children: [
michael@0 22 {
michael@0 23 role: ROLE_STATICTEXT,
michael@0 24 name: aBulletText
michael@0 25 },
michael@0 26 {
michael@0 27 role: ROLE_TEXT_LEAF,
michael@0 28 name: aName
michael@0 29 }
michael@0 30 ]
michael@0 31 };
michael@0 32
michael@0 33 if (aSubtree)
michael@0 34 obj.children.push(aSubtree);
michael@0 35
michael@0 36 return obj;
michael@0 37 }
michael@0 38
michael@0 39 function doTest()
michael@0 40 {
michael@0 41 // list1
michael@0 42 var discAccTree = {
michael@0 43 role: ROLE_LIST,
michael@0 44 children: [
michael@0 45 new listItemTree(kDiscBulletText, "Oranges"),
michael@0 46 new listItemTree(kDiscBulletText, "Apples"),
michael@0 47 new listItemTree(kDiscBulletText, "Bananas")
michael@0 48 ]
michael@0 49 };
michael@0 50
michael@0 51 testAccessibleTree("list1", discAccTree);
michael@0 52
michael@0 53 // list2
michael@0 54 var circleAccTree = {
michael@0 55 role: ROLE_LIST,
michael@0 56 children: [
michael@0 57 new listItemTree(kCircleBulletText, "Oranges"),
michael@0 58 new listItemTree(kCircleBulletText, "Apples"),
michael@0 59 new listItemTree(kCircleBulletText, "Bananas")
michael@0 60 ]
michael@0 61 };
michael@0 62
michael@0 63 testAccessibleTree("list2", circleAccTree);
michael@0 64
michael@0 65 // list3
michael@0 66 var squareAccTree = {
michael@0 67 role: ROLE_LIST,
michael@0 68 children: [
michael@0 69 new listItemTree(kSquareBulletText, "Oranges"),
michael@0 70 new listItemTree(kSquareBulletText, "Apples"),
michael@0 71 new listItemTree(kSquareBulletText, "Bananas")
michael@0 72 ]
michael@0 73 };
michael@0 74
michael@0 75 testAccessibleTree("list3", squareAccTree);
michael@0 76
michael@0 77 // list4
michael@0 78 var nestedAccTree = {
michael@0 79 role: ROLE_LIST,
michael@0 80 children: [
michael@0 81 new listItemTree("1. ", "Oranges"),
michael@0 82 new listItemTree("2. ", "Apples"),
michael@0 83 new listItemTree("3. ", "Bananas", circleAccTree)
michael@0 84 ]
michael@0 85 };
michael@0 86
michael@0 87 testAccessibleTree("list4", nestedAccTree);
michael@0 88
michael@0 89 // dl list
michael@0 90 var tree =
michael@0 91 { DEFINITION_LIST: [ // dl
michael@0 92 { TERM: [ // dt
michael@0 93 { TEXT_LEAF: [] },
michael@0 94 ] },
michael@0 95 { DEFINITION: [ // dd
michael@0 96 { TEXT_LEAF: [] }
michael@0 97 ] },
michael@0 98 { TERM: [ // dt
michael@0 99 { TEXT_LEAF: [] }
michael@0 100 ] },
michael@0 101 { DEFINITION: [ // dd
michael@0 102 { TEXT_LEAF: [] }
michael@0 103 ] }
michael@0 104 ] };
michael@0 105
michael@0 106 testAccessibleTree("list5", tree);
michael@0 107
michael@0 108 // dl list inside ordered list
michael@0 109 tree =
michael@0 110 { LIST: [ // ol
michael@0 111 { LISTITEM: [ // li
michael@0 112 { STATICTEXT: [ ] },
michael@0 113 { DEFINITION_LIST: [ // dl
michael@0 114 { TERM: [ // dt
michael@0 115 { TEXT_LEAF: [] }
michael@0 116 ] },
michael@0 117 { DEFINITION: [ // dd
michael@0 118 { TEXT_LEAF: [] }
michael@0 119 ] }
michael@0 120 ] }
michael@0 121 ] }
michael@0 122 ] };
michael@0 123
michael@0 124 testAccessibleTree("list6", tree);
michael@0 125
michael@0 126 // li having no display:list-item style
michael@0 127 var tree =
michael@0 128 { LIST: [ // ul
michael@0 129 { LISTITEM: [ // li
michael@0 130 { TEXT_LEAF: [] },
michael@0 131 ] },
michael@0 132 { TEXT_LEAF: [] },
michael@0 133 { LISTITEM: [ // li
michael@0 134 { TEXT_LEAF: [] }
michael@0 135 ] }
michael@0 136 ] };
michael@0 137 testAccessibleTree("list7", tree);
michael@0 138
michael@0 139 var tree =
michael@0 140 { LIST: [ // ul
michael@0 141 { LISTITEM: [ // li
michael@0 142 { TEXT_LEAF: [] },
michael@0 143 ] },
michael@0 144 { LISTITEM: [ // li
michael@0 145 { TEXT_LEAF: [] }
michael@0 146 ] }
michael@0 147 ] };
michael@0 148 testAccessibleTree("list8", tree);
michael@0 149
michael@0 150 // span having display:list-item style
michael@0 151 testAccessibleTree("list9", discAccTree);
michael@0 152
michael@0 153 SimpleTest.finish();
michael@0 154 }
michael@0 155
michael@0 156 SimpleTest.waitForExplicitFinish();
michael@0 157 addA11yLoadEvent(doTest);
michael@0 158 </script>
michael@0 159 </head>
michael@0 160 <body>
michael@0 161
michael@0 162 <a target="_blank"
michael@0 163 title="Fix O(n^2) access to all the children of a container"
michael@0 164 href="https://bugzilla.mozilla.org/show_bug.cgi?id=342045">
michael@0 165 Mozilla Bug 342045
michael@0 166 </a>
michael@0 167 <a target="_blank"
michael@0 168 title="Wrong accessible is created for HTML:li having block display style"
michael@0 169 href="https://bugzilla.mozilla.org/show_bug.cgi?id=507555">
michael@0 170 Mozilla Bug 507555
michael@0 171 </a>
michael@0 172 <a target="_blank"
michael@0 173 title="Bullets of nested not ordered lists have one and the same character."
michael@0 174 href="https://bugzilla.mozilla.org/show_bug.cgi?id=604587">
michael@0 175 Mozilla Bug 604587
michael@0 176 </a>
michael@0 177 <a target="_blank"
michael@0 178 title="Fix list bullets for DL list (crash [@ nsBulletFrame::GetListItemText])"
michael@0 179 href="https://bugzilla.mozilla.org/show_bug.cgi?id=629114">
michael@0 180 Mozilla Bug 629114
michael@0 181 </a>
michael@0 182 <p id="display"></p>
michael@0 183 <div id="content" style="display: none"></div>
michael@0 184 <pre id="test">
michael@0 185 </pre>
michael@0 186
michael@0 187 <ul id="list1">
michael@0 188 <li id="l1_li1">Oranges</li>
michael@0 189 <li id="l1_li2">Apples</li>
michael@0 190 <li id="l1_li3">Bananas</li>
michael@0 191 </ul>
michael@0 192
michael@0 193 <ul id="list2" style="list-style-type: circle">
michael@0 194 <li id="l2_li1">Oranges</li>
michael@0 195 <li id="l2_li2">Apples</li>
michael@0 196 <li id="l2_li3">Bananas</li>
michael@0 197 </ul>
michael@0 198
michael@0 199 <ul id="list3" style="list-style-type: square">
michael@0 200 <li id="l3_li1">Oranges</li>
michael@0 201 <li id="l3_li2">Apples</li>
michael@0 202 <li id="l3_li3">Bananas</li>
michael@0 203 </ul>
michael@0 204
michael@0 205 <ol id="list4">
michael@0 206 <li id="li4">Oranges</li>
michael@0 207 <li id="li5">Apples</li>
michael@0 208 <li id="li6">Bananas<ul>
michael@0 209 <li id="n_li4">Oranges</li>
michael@0 210 <li id="n_li5">Apples</li>
michael@0 211 <li id="n_li6">Bananas</li>
michael@0 212 </ul>
michael@0 213 </li>
michael@0 214 </ol>
michael@0 215
michael@0 216 <dl id="list5">
michael@0 217 <dt>item1</dt><dd>description</dd>
michael@0 218 <dt>item2</td><dd>description</dd>
michael@0 219 </dl>
michael@0 220
michael@0 221 <ol id="list6">
michael@0 222 <li>
michael@0 223 <dl id="dl">
michael@0 224 <dt>item1</dt><dd>description</dd>
michael@0 225 </dl>
michael@0 226 </li>
michael@0 227 </ol>
michael@0 228
michael@0 229 <!-- display style different than list-item -->
michael@0 230 <ul id="list7">
michael@0 231 <li id="l7_li1" style="display:inline-block;">Oranges</li>
michael@0 232 <li id="l7_li2" style="display:inline-block;">Apples</li>
michael@0 233 </ul>
michael@0 234
michael@0 235 <ul id="list8">
michael@0 236 <li id="l8_li1" style="display:inline; float:right;">Oranges</li>
michael@0 237 <li id="l8_li2" style="display:inline; float:right;">Apples</li>
michael@0 238 </ul>
michael@0 239
michael@0 240 <!-- list-item display style -->
michael@0 241 <ul id="list9">
michael@0 242 <span id="l9_li1" style="display:list-item">Oranges</span>
michael@0 243 <span id="l9_li2" style="display:list-item">Apples</span>
michael@0 244 <span id="l9_li3" style="display:list-item">Bananas</span>
michael@0 245 </ul>
michael@0 246 </body>
michael@0 247 </html>

mercurial