accessible/tests/mochitest/elm/test_HTMLSpec.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,1635 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>HTML a11y spec tests</title>
     1.8 +  <link id="link" rel="stylesheet" type="text/css"
     1.9 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.10 +
    1.11 +  <script type="application/javascript"
    1.12 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +
    1.14 +  <script type="application/javascript"
    1.15 +          src="../common.js"></script>
    1.16 +  <script type="application/javascript"
    1.17 +          src="../actions.js"></script>
    1.18 +  <script type="application/javascript"
    1.19 +          src="../role.js"></script>
    1.20 +  <script type="application/javascript"
    1.21 +          src="../states.js"></script>
    1.22 +  <script type="application/javascript"
    1.23 +          src="../attributes.js"></script>
    1.24 +  <script type="application/javascript"
    1.25 +          src="../relations.js"></script>
    1.26 +  <script type="application/javascript"
    1.27 +          src="../name.js"></script>
    1.28 +
    1.29 +  <script type="application/javascript">
    1.30 +    function doTest()
    1.31 +    {
    1.32 +      //////////////////////////////////////////////////////////////////////////
    1.33 +      // HTML:a@href
    1.34 +
    1.35 +      var obj = {
    1.36 +        role: ROLE_LINK,
    1.37 +        states: STATE_LINKED,
    1.38 +        actions: "jump",
    1.39 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText, nsIAccessibleHyperLink ],
    1.40 +        children: [ // all kids inherits linked state and jump action
    1.41 +          {
    1.42 +            role: ROLE_TEXT_LEAF,
    1.43 +            states: STATE_LINKED,
    1.44 +            actions: "jump"
    1.45 +          }
    1.46 +        ]
    1.47 +      };
    1.48 +      testElm("a_href", obj);
    1.49 +
    1.50 +      //////////////////////////////////////////////////////////////////////////
    1.51 +      // HTML:a no @href
    1.52 +
    1.53 +      obj = {
    1.54 +        todo_role: ROLE_TEXT_CONTAINER,
    1.55 +        absentStates: STATE_LINKED,
    1.56 +        actions: null,
    1.57 +        children: [
    1.58 +          {
    1.59 +            role: ROLE_TEXT_LEAF,
    1.60 +            absentStates: STATE_LINKED,
    1.61 +            actions: null
    1.62 +          }
    1.63 +        ]
    1.64 +      };
    1.65 +      testElm("a_nohref", obj);
    1.66 +
    1.67 +      //////////////////////////////////////////////////////////////////////////
    1.68 +      // HTML:abbr contained by HTML:td
    1.69 +
    1.70 +      obj = {
    1.71 +        role: ROLE_CELL,
    1.72 +        attributes: { abbr: "WWW" },
    1.73 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
    1.74 +        children: [
    1.75 +          {
    1.76 +            role: ROLE_TEXT_CONTAINER,
    1.77 +            children: [ { role: ROLE_TEXT_LEAF } ]
    1.78 +          }
    1.79 +        ]
    1.80 +      };
    1.81 +      testElm("td_abbr", obj);
    1.82 +
    1.83 +      //////////////////////////////////////////////////////////////////////////
    1.84 +      // HTML:address
    1.85 +
    1.86 +      obj = {
    1.87 +        todo_role: ROLE_PARAGRAPH,
    1.88 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
    1.89 +      };
    1.90 +      testElm("address", obj);
    1.91 +
    1.92 +      //////////////////////////////////////////////////////////////////////////
    1.93 +      // HTML:area@href
    1.94 +
    1.95 +      obj = {
    1.96 +        role: ROLE_LINK,
    1.97 +        states: STATE_LINKED,
    1.98 +        actions: "jump",
    1.99 +        interfaces: [ nsIAccessibleHyperLink ],
   1.100 +        children: []
   1.101 +      };
   1.102 +      testElm(getAccessible("imgmap").firstChild, obj);
   1.103 +
   1.104 +      //////////////////////////////////////////////////////////////////////////
   1.105 +      // HTML:area no @href
   1.106 +
   1.107 +      obj = {
   1.108 +        todo_role: "ROLE_SHAPE",
   1.109 +        absentStates: STATE_LINKED,
   1.110 +        children: []
   1.111 +      };
   1.112 +      testElm(getAccessible("imgmap").lastChild, obj);
   1.113 +
   1.114 +      //////////////////////////////////////////////////////////////////////////
   1.115 +      // HTML:article
   1.116 +      obj = {
   1.117 +        role: ROLE_DOCUMENT,
   1.118 +        states: STATE_READONLY,
   1.119 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
   1.120 +      };
   1.121 +      testElm("article", obj);
   1.122 +
   1.123 +      //////////////////////////////////////////////////////////////////////////
   1.124 +      // HTML:aside
   1.125 +      obj = {
   1.126 +        role: ROLE_NOTE,
   1.127 +        attributes: { "xml-roles": "complementary" },
   1.128 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.129 +      };
   1.130 +      testElm("aside", obj);
   1.131 +
   1.132 +      //////////////////////////////////////////////////////////////////////////
   1.133 +      obj = { // HTML:audio
   1.134 +        role: ROLE_GROUPING
   1.135 +      };
   1.136 +      testElm("audio", obj);
   1.137 +
   1.138 +      //////////////////////////////////////////////////////////////////////////
   1.139 +      obj = { // HTML:b contained by paragraph
   1.140 +        role: ROLE_PARAGRAPH,
   1.141 +        textAttrs: {
   1.142 +          0: { },
   1.143 +          6: { "font-weight": kBoldFontWeight }
   1.144 +        },
   1.145 +        children: [
   1.146 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.147 +          { role: ROLE_TEXT_LEAF } // HTML:b text
   1.148 +        ]
   1.149 +      }
   1.150 +      testElm("b_container", obj);
   1.151 +
   1.152 +      //////////////////////////////////////////////////////////////////////////
   1.153 +      obj = { // HTML:bdi contained by paragraph
   1.154 +        role: ROLE_PARAGRAPH,
   1.155 +        todo_textAttrs: {
   1.156 +          0: { },
   1.157 +          5: { "writing-mode": "rl" },
   1.158 +          8: { }
   1.159 +        },
   1.160 +        children: [
   1.161 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.162 +          { role: ROLE_TEXT_LEAF }, // HTML:bdi text
   1.163 +          { role: ROLE_TEXT_LEAF } // plain text
   1.164 +        ]
   1.165 +      }
   1.166 +      testElm("bdi_container", obj);
   1.167 +
   1.168 +      //////////////////////////////////////////////////////////////////////////
   1.169 +      // HTML:bdo contained by paragraph
   1.170 +
   1.171 +      obj = {
   1.172 +        role: ROLE_PARAGRAPH,
   1.173 +        todo_textAttrs: {
   1.174 +          0: { },
   1.175 +          6: { "writing-mode": "rl" }
   1.176 +        },
   1.177 +        children: [
   1.178 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.179 +        ]
   1.180 +      }
   1.181 +      testElm("bdo_container", obj);
   1.182 +
   1.183 +      //////////////////////////////////////////////////////////////////////////
   1.184 +      // HTML:blockquote
   1.185 +
   1.186 +      obj = {
   1.187 +        role: ROLE_SECTION,
   1.188 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
   1.189 +        children: [ { role: ROLE_PARAGRAPH } ]
   1.190 +      };
   1.191 +      testElm("blockquote", obj);
   1.192 +
   1.193 +      //////////////////////////////////////////////////////////////////////////
   1.194 +      // HTML:br
   1.195 +
   1.196 +      obj = {
   1.197 +        role: ROLE_PARAGRAPH,
   1.198 +        children: [ { role: ROLE_WHITESPACE } ]
   1.199 +      };
   1.200 +      testElm("br_container", obj);
   1.201 +
   1.202 +      //////////////////////////////////////////////////////////////////////////
   1.203 +      obj = { // HTML:button
   1.204 +        role: ROLE_PUSHBUTTON,
   1.205 +        absentStates: STATE_DEFAULT,
   1.206 +        actions: "press",
   1.207 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.208 +      };
   1.209 +      testElm("button", obj);
   1.210 +
   1.211 +      //////////////////////////////////////////////////////////////////////////
   1.212 +      // HTML:button@type="submit" (default button)
   1.213 +
   1.214 +      obj = {
   1.215 +        role: ROLE_PUSHBUTTON,
   1.216 +        states: STATE_DEFAULT,
   1.217 +        actions: "press"
   1.218 +      };
   1.219 +      testElm("button_default", obj);
   1.220 +
   1.221 +      //////////////////////////////////////////////////////////////////////////
   1.222 +      // HTML:canvas
   1.223 +
   1.224 +      obj = {
   1.225 +        role: ROLE_CANVAS
   1.226 +      };
   1.227 +      testElm("canvas", obj);
   1.228 +
   1.229 +      //////////////////////////////////////////////////////////////////////////
   1.230 +      // HTML:caption under table
   1.231 +
   1.232 +      obj = {
   1.233 +        role: ROLE_TABLE,
   1.234 +        relations: {
   1.235 +          RELATION_LABELLED_BY: "caption"
   1.236 +        },
   1.237 +        interfaces: nsIAccessibleTable,
   1.238 +        children: [
   1.239 +          {
   1.240 +            role: ROLE_CAPTION,
   1.241 +            relations: {
   1.242 +              RELATION_LABEL_FOR: "table"
   1.243 +            },
   1.244 +            interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.245 +          },
   1.246 +          { // td inside thead
   1.247 +            role: ROLE_ROW,
   1.248 +            children: [
   1.249 +              {
   1.250 +                role: ROLE_COLUMNHEADER,
   1.251 +                interfaces: [ nsIAccessibleTableCell, nsIAccessibleText, nsIAccessibleHyperText ]
   1.252 +              },
   1.253 +              { role: ROLE_COLUMNHEADER }
   1.254 +            ]
   1.255 +          },
   1.256 +          { // td inside tbody
   1.257 +            role: ROLE_ROW,
   1.258 +            children: [
   1.259 +              {
   1.260 +                role: ROLE_ROWHEADER,
   1.261 +                interfaces: [ nsIAccessibleTableCell, nsIAccessibleText, nsIAccessibleHyperText ]
   1.262 +              },
   1.263 +              {
   1.264 +                role: ROLE_CELL,
   1.265 +                interfaces: [ nsIAccessibleTableCell, nsIAccessibleText, nsIAccessibleHyperText ]
   1.266 +              }
   1.267 +            ]
   1.268 +          },
   1.269 +          { // td inside tfoot
   1.270 +            role: ROLE_ROW
   1.271 +          }
   1.272 +        ]
   1.273 +      };
   1.274 +      testElm("table", obj);
   1.275 +
   1.276 +      //////////////////////////////////////////////////////////////////////////
   1.277 +      // HTML:cite contained by paragraph
   1.278 +
   1.279 +      obj = {
   1.280 +        role: ROLE_PARAGRAPH,
   1.281 +        textAttrs: {
   1.282 +          0: { },
   1.283 +          6: { "font-style": "italic" }
   1.284 +        },
   1.285 +        children: [
   1.286 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.287 +          { role: ROLE_TEXT_LEAF } // HTML:cite text
   1.288 +        ]
   1.289 +      };
   1.290 +      testElm("cite_container", obj);
   1.291 +
   1.292 +      //////////////////////////////////////////////////////////////////////////
   1.293 +      // HTML:code contained by paragraph
   1.294 +
   1.295 +      obj = {
   1.296 +        role: ROLE_PARAGRAPH,
   1.297 +        textAttrs: {
   1.298 +          0: { },
   1.299 +          6: { "font-family": kMonospaceFontFamily }
   1.300 +        },
   1.301 +        children: [
   1.302 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.303 +          { role: ROLE_TEXT_LEAF } // HTML:code text
   1.304 +        ]
   1.305 +      };
   1.306 +      testElm("code_container", obj);
   1.307 +
   1.308 +      //////////////////////////////////////////////////////////////////////////
   1.309 +      // HTML:col and HTML:colgroup under table
   1.310 +
   1.311 +      obj =
   1.312 +        { TABLE : [
   1.313 +          { ROW :[
   1.314 +            { role: ROLE_CELL },
   1.315 +            { role: ROLE_CELL },
   1.316 +            { role: ROLE_CELL }
   1.317 +          ] }
   1.318 +        ] };
   1.319 +      testElm("colNcolgroup_table", obj);
   1.320 +
   1.321 +      //////////////////////////////////////////////////////////////////////////
   1.322 +      // HTML:data contained by paragraph
   1.323 +
   1.324 +      obj =
   1.325 +        { PARAGRAPH: [
   1.326 +          { TEXT_LEAF: [] } // HTML:data text
   1.327 +        ] };
   1.328 +      testElm("data_container", obj);
   1.329 +
   1.330 +      //////////////////////////////////////////////////////////////////////////
   1.331 +      // HTML:datalist associated with input
   1.332 +
   1.333 +      todo(false, "datalist and summary tree hierarchy test missed");
   1.334 +
   1.335 +      //////////////////////////////////////////////////////////////////////////
   1.336 +      // HTML:dd, HTML:dl, HTML:dd
   1.337 +
   1.338 +      obj = {
   1.339 +        role: ROLE_DEFINITION_LIST,
   1.340 +        states: STATE_READONLY,
   1.341 +        children: [ // dl
   1.342 +          {
   1.343 +            role: ROLE_TERM,
   1.344 +            states: STATE_READONLY,
   1.345 +            interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
   1.346 +            children: [ // dt
   1.347 +              { role: ROLE_TEXT_LEAF }
   1.348 +            ]
   1.349 +          },
   1.350 +          {
   1.351 +            role: ROLE_DEFINITION,
   1.352 +            interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
   1.353 +            children: [ // dd
   1.354 +              { role: ROLE_TEXT_LEAF }
   1.355 +            ]
   1.356 +          }
   1.357 +        ]
   1.358 +      };
   1.359 +      testElm("dl", obj);
   1.360 +
   1.361 +      //////////////////////////////////////////////////////////////////////////
   1.362 +      // HTML:del contained by paragraph
   1.363 +
   1.364 +      obj = {
   1.365 +        role: ROLE_PARAGRAPH,
   1.366 +        textAttrs: {
   1.367 +          0: { },
   1.368 +          6: { "text-line-through-style": "solid" }
   1.369 +        },
   1.370 +        children: [
   1.371 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.372 +          { role: ROLE_TEXT_LEAF } // HTML:del text
   1.373 +        ]
   1.374 +      };
   1.375 +      testElm("del_container", obj);
   1.376 +
   1.377 +      //////////////////////////////////////////////////////////////////////////
   1.378 +      // HTML:details
   1.379 +
   1.380 +      todo(isAccessible("details"), "details element is not accessible");
   1.381 +
   1.382 +      //////////////////////////////////////////////////////////////////////////
   1.383 +      // HTML:dfn contained by paragraph
   1.384 +
   1.385 +      obj = {
   1.386 +        role: ROLE_PARAGRAPH,
   1.387 +        textAttrs: {
   1.388 +          0: { "font-style": "italic" },
   1.389 +          12: { }
   1.390 +        },
   1.391 +        children: [
   1.392 +          { role: ROLE_TEXT_LEAF }, // HTML:dfn text
   1.393 +          { role: ROLE_TEXT_LEAF } // plain text
   1.394 +        ]
   1.395 +      };
   1.396 +      testElm("dfn_container", obj);
   1.397 +
   1.398 +      //////////////////////////////////////////////////////////////////////////
   1.399 +      // HTML:dialog
   1.400 +
   1.401 +      todo(isAccessible("dialog"), "dialog element is not accessible");
   1.402 +
   1.403 +      //////////////////////////////////////////////////////////////////////////
   1.404 +      // HTML:div
   1.405 +
   1.406 +      obj = {
   1.407 +        role: ROLE_SECTION,
   1.408 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
   1.409 +        children: [
   1.410 +          { role: ROLE_TEXT_LEAF } // plain text
   1.411 +        ]
   1.412 +      };
   1.413 +      testElm("div", obj);
   1.414 +
   1.415 +      //////////////////////////////////////////////////////////////////////////
   1.416 +      // HTML:em in a paragraph
   1.417 +
   1.418 +      obj = {
   1.419 +        role: ROLE_PARAGRAPH,
   1.420 +        textAttrs: {
   1.421 +          0: { },
   1.422 +          6: { "font-style": "italic" }
   1.423 +        },
   1.424 +        children: [
   1.425 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.426 +          { role: ROLE_TEXT_LEAF } // HTML:em text
   1.427 +        ]
   1.428 +      };
   1.429 +      testElm("em_container", obj);
   1.430 +
   1.431 +      //////////////////////////////////////////////////////////////////////////
   1.432 +      // HTML:embed (windowless and windowed plugins)
   1.433 +
   1.434 +      if (WIN) {
   1.435 +        obj = {
   1.436 +          role: ROLE_EMBEDDED_OBJECT,
   1.437 +          states: STATE_UNAVAILABLE
   1.438 +        };
   1.439 +
   1.440 +        testElm("embed_plugin_windowless", obj);
   1.441 +
   1.442 +        obj = {
   1.443 +          role: ROLE_EMBEDDED_OBJECT,
   1.444 +          absentStates: STATE_UNAVAILABLE
   1.445 +        };
   1.446 +        testElm("embed_plugin_windowed", obj);
   1.447 +      }
   1.448 +
   1.449 +      //////////////////////////////////////////////////////////////////////////
   1.450 +      // HTML:fieldset and HTML:legend
   1.451 +
   1.452 +      obj = {
   1.453 +        role: ROLE_GROUPING,
   1.454 +        relations: {
   1.455 +          RELATION_LABELLED_BY: "legend"
   1.456 +        },
   1.457 +        children: [
   1.458 +          {
   1.459 +            role: ROLE_LABEL,
   1.460 +            relations: {
   1.461 +              RELATION_LABEL_FOR: "fieldset"
   1.462 +            },
   1.463 +            interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.464 +          },
   1.465 +          {
   1.466 +            role: ROLE_ENTRY
   1.467 +          }
   1.468 +        ]
   1.469 +      };
   1.470 +      testElm("fieldset", obj);
   1.471 +
   1.472 +      //////////////////////////////////////////////////////////////////////////
   1.473 +      // HTML:figure and HTML:figcaption
   1.474 +
   1.475 +      obj = {
   1.476 +        role: ROLE_FIGURE,
   1.477 +        attributes: { "xml-roles": "figure" },
   1.478 +        relations: {
   1.479 +          RELATION_LABELLED_BY: "figcaption"
   1.480 +        },
   1.481 +        children: [
   1.482 +          { role: ROLE_GRAPHIC },
   1.483 +          {
   1.484 +            role: ROLE_CAPTION,
   1.485 +            relations: {
   1.486 +              RELATION_LABEL_FOR: "figure"
   1.487 +            },
   1.488 +            interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.489 +          }
   1.490 +        ]
   1.491 +      };
   1.492 +      testElm("figure", obj);
   1.493 +
   1.494 +      //////////////////////////////////////////////////////////////////////////
   1.495 +      // HTML:footer
   1.496 +
   1.497 +      obj = {
   1.498 +        role: ROLE_FOOTER,
   1.499 +        attributes: { "xml-roles": "contentinfo" },
   1.500 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.501 +      };
   1.502 +      testElm("footer", obj);
   1.503 +
   1.504 +      obj = {
   1.505 +        role: ROLE_FOOTER,
   1.506 +        absentAttributes: { "xml-roles": "contentinfo" },
   1.507 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.508 +      };
   1.509 +      testElm("footer_in_article", obj);
   1.510 +      testElm("footer_in_section", obj);
   1.511 +
   1.512 +      //////////////////////////////////////////////////////////////////////////
   1.513 +      // HTML:form
   1.514 +
   1.515 +      obj = {
   1.516 +        role: ROLE_FORM
   1.517 +      };
   1.518 +      testElm("form", obj);
   1.519 +
   1.520 +      //////////////////////////////////////////////////////////////////////////
   1.521 +      // // HTML:frameset, HTML:frame and HTML:iframe
   1.522 +
   1.523 +      obj = {
   1.524 +        INTERNAL_FRAME: [ { // HTML:iframe
   1.525 +          DOCUMENT: [ {
   1.526 +            INTERNAL_FRAME: [ { // HTML:frame
   1.527 +              DOCUMENT: [ { role: ROLE_TEXT_LEAF} ]
   1.528 +            } ]
   1.529 +          } ]
   1.530 +        } ]
   1.531 +      };
   1.532 +      testElm("frameset_container", obj);
   1.533 +
   1.534 +      //////////////////////////////////////////////////////////////////////////
   1.535 +      // HTML:h1, HTML:h2, HTML:h3, HTML:h4, HTML:h5, HTML:h6
   1.536 +
   1.537 +      obj = {
   1.538 +        role: ROLE_HEADING,
   1.539 +        attributes: { "level": "1" },
   1.540 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.541 +      };
   1.542 +      testElm("h1", obj);
   1.543 +
   1.544 +      obj = {
   1.545 +        role: ROLE_HEADING,
   1.546 +        attributes: { "level": "2" },
   1.547 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.548 +      };
   1.549 +      testElm("h2", obj);
   1.550 +
   1.551 +      obj = {
   1.552 +        role: ROLE_HEADING,
   1.553 +        attributes: { "level": "3" },
   1.554 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.555 +      };
   1.556 +      testElm("h3", obj);
   1.557 +
   1.558 +      obj = {
   1.559 +        role: ROLE_HEADING,
   1.560 +        attributes: { "level": "4" },
   1.561 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.562 +      };
   1.563 +      testElm("h4", obj);
   1.564 +
   1.565 +      obj = {
   1.566 +        role: ROLE_HEADING,
   1.567 +        attributes: { "level": "5" },
   1.568 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.569 +      };
   1.570 +      testElm("h5", obj);
   1.571 +
   1.572 +      obj = {
   1.573 +        role: ROLE_HEADING,
   1.574 +        attributes: { "level": "6" },
   1.575 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.576 +      };
   1.577 +      testElm("h6", obj);
   1.578 +
   1.579 +      //////////////////////////////////////////////////////////////////////////
   1.580 +      // HTML:header
   1.581 +
   1.582 +      obj = {
   1.583 +        role: ROLE_HEADER,
   1.584 +        attributes: { "xml-roles": "banner" },
   1.585 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.586 +      };
   1.587 +      testElm("header", obj);
   1.588 +
   1.589 +      obj = {
   1.590 +        role: ROLE_HEADER,
   1.591 +        absentAttributes: { "xml-roles": "banner" },
   1.592 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.593 +      };
   1.594 +      testElm("header_in_article", obj);
   1.595 +      testElm("header_in_section", obj);
   1.596 +
   1.597 +      //////////////////////////////////////////////////////////////////////////
   1.598 +      // HTML:hr
   1.599 +
   1.600 +      obj = {
   1.601 +        role: ROLE_SEPARATOR,
   1.602 +      };
   1.603 +      testElm("hr", obj);
   1.604 +
   1.605 +      //////////////////////////////////////////////////////////////////////////
   1.606 +      obj = { // HTML:i contained by paragraph
   1.607 +        role: ROLE_PARAGRAPH,
   1.608 +        textAttrs: {
   1.609 +          0: { },
   1.610 +          6: { "font-style": "italic" }
   1.611 +        },
   1.612 +        children: [
   1.613 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.614 +          { role: ROLE_TEXT_LEAF } // HTML:i text
   1.615 +        ]
   1.616 +      }
   1.617 +      testElm("i_container", obj);
   1.618 +
   1.619 +      //////////////////////////////////////////////////////////////////////////
   1.620 +      // HTML:img
   1.621 +
   1.622 +      obj = {
   1.623 +        role: ROLE_GRAPHIC,
   1.624 +        interfaces: [ nsIAccessibleImage ]
   1.625 +      };
   1.626 +      testElm("img", obj);
   1.627 +
   1.628 +      //////////////////////////////////////////////////////////////////////////
   1.629 +      // HTML:input@type="button"
   1.630 +
   1.631 +      obj = {
   1.632 +        role: ROLE_PUSHBUTTON,
   1.633 +        absentStates: STATE_DEFAULT
   1.634 +      };
   1.635 +      testElm("input_button", obj);
   1.636 +
   1.637 +      //////////////////////////////////////////////////////////////////////////
   1.638 +      // HTML:input@type="checkbox"
   1.639 +
   1.640 +      obj = {
   1.641 +        role: ROLE_CHECKBUTTON,
   1.642 +        states: STATE_CHECKABLE,
   1.643 +        absentStates: STATE_CHECKED,
   1.644 +        actions: "check"
   1.645 +      };
   1.646 +      testElm("input_checkbox", obj);
   1.647 +
   1.648 +      obj = {
   1.649 +        role: ROLE_CHECKBUTTON,
   1.650 +        states: STATE_CHECKABLE | STATE_CHECKED,
   1.651 +        actions: "uncheck"
   1.652 +      };
   1.653 +      testElm("input_checkbox_true", obj);
   1.654 +
   1.655 +      //////////////////////////////////////////////////////////////////////////
   1.656 +      // HTML:input@type="file"
   1.657 +
   1.658 +      obj = {
   1.659 +        TEXT_CONTAINER: [
   1.660 +          { role: ROLE_PUSHBUTTON },
   1.661 +          { role: ROLE_LABEL }
   1.662 +        ]
   1.663 +      };
   1.664 +      testElm("input_file", obj);
   1.665 +
   1.666 +      //////////////////////////////////////////////////////////////////////////
   1.667 +      // HTML:input@type="image"
   1.668 +
   1.669 +      obj = {
   1.670 +        role: ROLE_PUSHBUTTON,
   1.671 +        absentStates: STATE_DEFAULT,
   1.672 +        actions: "press"
   1.673 +      };
   1.674 +      testElm("input_image", obj);
   1.675 +      testElm("input_submit", obj);
   1.676 +
   1.677 +      obj = {
   1.678 +        role: ROLE_PUSHBUTTON,
   1.679 +        actions: "press",
   1.680 +        states: STATE_DEFAULT
   1.681 +      };
   1.682 +      testElm("input_image_default", obj);
   1.683 +      testElm("input_submit_default", obj);
   1.684 +
   1.685 +      //////////////////////////////////////////////////////////////////////////
   1.686 +      // HTML:input@type="number" and etc
   1.687 +
   1.688 +      obj = {
   1.689 +        role: ROLE_SPINBUTTON,
   1.690 +        interfaces: [ nsIAccessibleValue ],
   1.691 +        children: [
   1.692 +          {
   1.693 +            role: ROLE_ENTRY,
   1.694 +            extraStates: EXT_STATE_EDITABLE | EXT_STATE_SINGLE_LINE,
   1.695 +            actions: "activate",
   1.696 +            interfaces: [ nsIAccessibleText, nsIAccessibleEditableText ],
   1.697 +            children: [
   1.698 +              { role: ROLE_TEXT_LEAF }
   1.699 +            ]
   1.700 +          },
   1.701 +          {
   1.702 +            role: ROLE_PUSHBUTTON,
   1.703 +            actions: "press"
   1.704 +          },
   1.705 +          {
   1.706 +            role: ROLE_PUSHBUTTON,
   1.707 +            actions: "press"
   1.708 +          }
   1.709 +        ]
   1.710 +      };
   1.711 +      testElm("input_number", obj);
   1.712 +
   1.713 +      //////////////////////////////////////////////////////////////////////////
   1.714 +      // HTML:input@type="text" and etc
   1.715 +
   1.716 +      obj = {
   1.717 +        role: ROLE_ENTRY,
   1.718 +        extraStates: EXT_STATE_EDITABLE | EXT_STATE_SINGLE_LINE,
   1.719 +        actions: "activate",
   1.720 +        interfaces: [ nsIAccessibleText, nsIAccessibleEditableText ],
   1.721 +        children: [
   1.722 +          { role: ROLE_TEXT_LEAF }
   1.723 +        ]
   1.724 +      };
   1.725 +      testElm("input_email", obj);
   1.726 +      testElm("input_search", obj);
   1.727 +      testElm("input_tel", obj);
   1.728 +      testElm("input_text", obj);
   1.729 +      testElm("input_url", obj);
   1.730 +
   1.731 +      //////////////////////////////////////////////////////////////////////////
   1.732 +      // HTML:input@type="password"
   1.733 +
   1.734 +      obj = {
   1.735 +        role: ROLE_PASSWORD_TEXT,
   1.736 +        states: STATE_PROTECTED,
   1.737 +        extraStates: EXT_STATE_EDITABLE,
   1.738 +        actions: "activate",
   1.739 +        children: [
   1.740 +        {
   1.741 +            role: ROLE_TEXT_LEAF
   1.742 +          }
   1.743 +        ]
   1.744 +      };
   1.745 +      testElm("input_password", obj);
   1.746 +      ok(getAccessible("input_password").firstChild.name != "44",
   1.747 +         "text leaf for password shouldn't have its real value as its name!");
   1.748 +
   1.749 +      obj = {
   1.750 +        role: ROLE_PASSWORD_TEXT,
   1.751 +        states: STATE_PROTECTED | STATE_READONLY,
   1.752 +        actions: "activate",
   1.753 +        children: [
   1.754 +        {
   1.755 +            role: ROLE_TEXT_LEAF
   1.756 +          }
   1.757 +        ]
   1.758 +      };
   1.759 +      testElm("input_password_readonly", obj);
   1.760 +      ok(getAccessible("input_password_readonly").firstChild.name != "44",
   1.761 +         "text leaf for password shouldn't have its real value as its name!");
   1.762 +
   1.763 +      //////////////////////////////////////////////////////////////////////////
   1.764 +      // HTML:input@type="radio"
   1.765 +
   1.766 +      obj = {
   1.767 +        role: ROLE_RADIOBUTTON,
   1.768 +        states: STATE_CHECKABLE,
   1.769 +        absentStates: STATE_CHECKED,
   1.770 +        actions: "select"
   1.771 +      };
   1.772 +      testElm("input_radio", obj);
   1.773 +
   1.774 +      obj = {
   1.775 +        role: ROLE_RADIOBUTTON,
   1.776 +        states: STATE_CHECKABLE | STATE_CHECKED,
   1.777 +        actions: "select"
   1.778 +      };
   1.779 +      testElm("input_radio_true", obj);
   1.780 +
   1.781 +      //////////////////////////////////////////////////////////////////////////
   1.782 +      // HTML:input@type="range"
   1.783 +
   1.784 +      obj = {
   1.785 +        role: ROLE_SLIDER
   1.786 +      };
   1.787 +      testElm("input_range", obj);
   1.788 +
   1.789 +      //////////////////////////////////////////////////////////////////////////
   1.790 +      // HTML:input@type="reset"
   1.791 +
   1.792 +      obj = {
   1.793 +        role: ROLE_PUSHBUTTON,
   1.794 +        actions: "press",
   1.795 +        absentStates: STATE_DEFAULT
   1.796 +      };
   1.797 +      testElm("input_reset", obj);
   1.798 +
   1.799 +      //////////////////////////////////////////////////////////////////////////
   1.800 +      // HTML:ins contained by paragraph
   1.801 +
   1.802 +      obj = {
   1.803 +        role: ROLE_PARAGRAPH,
   1.804 +        textAttrs: {
   1.805 +          0: { },
   1.806 +          6: { "text-underline-style": "solid" }
   1.807 +        },
   1.808 +        children: [
   1.809 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.810 +          { role: ROLE_TEXT_LEAF } // HTML:ins text
   1.811 +        ]
   1.812 +      };
   1.813 +      testElm("ins_container", obj);
   1.814 +
   1.815 +      //////////////////////////////////////////////////////////////////////////
   1.816 +      // HTML:kbd contained by paragraph
   1.817 +
   1.818 +      obj = {
   1.819 +        role: ROLE_PARAGRAPH,
   1.820 +        textAttrs: {
   1.821 +          0: { },
   1.822 +          6: { "font-family": kMonospaceFontFamily }
   1.823 +        },
   1.824 +        children: [
   1.825 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.826 +          { role: ROLE_TEXT_LEAF } // HTML:kbd text
   1.827 +        ]
   1.828 +      };
   1.829 +      testElm("kbd_container", obj);
   1.830 +
   1.831 +      //////////////////////////////////////////////////////////////////////////
   1.832 +      // HTML:keygen
   1.833 +
   1.834 +      obj = {
   1.835 +        role: ROLE_COMBOBOX,
   1.836 +        states: STATE_COLLAPSED | STATE_HASPOPUP,
   1.837 +        extraStates: EXT_STATE_EXPANDABLE,
   1.838 +        actions: "open",
   1.839 +        children: [ 
   1.840 +          { COMBOBOX_LIST: [
   1.841 +            { role: ROLE_COMBOBOX_OPTION }, // high grade
   1.842 +            { role: ROLE_COMBOBOX_OPTION } // medium grade
   1.843 +          ] }
   1.844 +        ]
   1.845 +      };
   1.846 +      testElm("keygen", obj);
   1.847 +
   1.848 +      //////////////////////////////////////////////////////////////////////////
   1.849 +      // HTML:label
   1.850 +
   1.851 +      obj = {
   1.852 +        role: ROLE_LABEL,
   1.853 +        todo_relations: {
   1.854 +          RELATION_LABEL_FOR: "label_input"
   1.855 +        },
   1.856 +        children: [
   1.857 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.858 +          {
   1.859 +            role: ROLE_ENTRY,
   1.860 +            relations: {
   1.861 +              RELATION_LABELLED_BY: "label"
   1.862 +            }
   1.863 +          }
   1.864 +        ]
   1.865 +      };
   1.866 +      testElm("label", obj);
   1.867 +
   1.868 +      obj = {
   1.869 +        role: ROLE_LABEL,
   1.870 +        relations: {
   1.871 +          RELATION_LABEL_FOR: "label_for_input"
   1.872 +        }
   1.873 +      };
   1.874 +      testElm("label_for", obj);
   1.875 +
   1.876 +      obj = {
   1.877 +        role: ROLE_ENTRY,
   1.878 +        relations: {
   1.879 +          RELATION_LABELLED_BY: "label_for"
   1.880 +        }
   1.881 +      };
   1.882 +      testElm("label_for_input", obj);
   1.883 +
   1.884 +      //////////////////////////////////////////////////////////////////////////
   1.885 +      // HTML:ul, HTML:ol, HTML:li
   1.886 +
   1.887 +      obj = { // ul or ol
   1.888 +        role: ROLE_LIST,
   1.889 +        states: STATE_READONLY,
   1.890 +        children: [
   1.891 +          { // li
   1.892 +            role: ROLE_LISTITEM,
   1.893 +            states: STATE_READONLY,
   1.894 +            interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.895 +          }
   1.896 +        ]
   1.897 +      };
   1.898 +      testElm("ul", obj);
   1.899 +      testElm("ol", obj);
   1.900 +
   1.901 +      //////////////////////////////////////////////////////////////////////////
   1.902 +      // HTML:link
   1.903 +
   1.904 +      ok(!isAccessible("link"), "link element is not accessible");
   1.905 +
   1.906 +      //////////////////////////////////////////////////////////////////////////
   1.907 +      // HTML:main
   1.908 +
   1.909 +      obj = {
   1.910 +        todo_role: ROLE_GROUPING,
   1.911 +        attributes: { "xml-roles": "main" },
   1.912 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.913 +      };
   1.914 +      testElm("main", obj);
   1.915 +
   1.916 +      //////////////////////////////////////////////////////////////////////////
   1.917 +      // HTML:map
   1.918 +
   1.919 +      ok(!isAccessible("map_imagemap"),
   1.920 +         "map element is not accessible if used as an image map");
   1.921 +
   1.922 +      obj = {
   1.923 +        role: ROLE_TEXT_CONTAINER
   1.924 +      };
   1.925 +      testElm("map", obj);
   1.926 +
   1.927 +      //////////////////////////////////////////////////////////////////////////
   1.928 +      // HTML:mark contained by paragraph
   1.929 +
   1.930 +      obj = {
   1.931 +        role: ROLE_PARAGRAPH,
   1.932 +        textAttrs: {
   1.933 +          0: { },
   1.934 +          6: { "background-color": "rgb(255, 255, 0)" }
   1.935 +        },
   1.936 +        children: [
   1.937 +          { role: ROLE_TEXT_LEAF }, // plain text
   1.938 +          { role: ROLE_TEXT_LEAF } // HTML:mark text
   1.939 +        ]
   1.940 +      };
   1.941 +      testElm("mark_container", obj);
   1.942 +
   1.943 +      //////////////////////////////////////////////////////////////////////////
   1.944 +      // HTML:math
   1.945 +
   1.946 +      obj = {
   1.947 +        role: ROLE_EQUATION
   1.948 +      };
   1.949 +      testElm("math", obj);
   1.950 +
   1.951 +      //////////////////////////////////////////////////////////////////////////
   1.952 +      // HTML:menu
   1.953 +
   1.954 +      obj = {
   1.955 +        todo_role: ROLE_MENUPOPUP
   1.956 +      };
   1.957 +      testElm("menu", obj);
   1.958 +
   1.959 +      //////////////////////////////////////////////////////////////////////////
   1.960 +      // HTML:meter
   1.961 +
   1.962 +      todo(isAccessible("meter"), "meter element is not accessible");
   1.963 +
   1.964 +      //////////////////////////////////////////////////////////////////////////
   1.965 +      // HTML:nav
   1.966 +
   1.967 +      obj = {
   1.968 +        role: ROLE_SECTION,
   1.969 +        attributes: { "xml-roles": "navigation" },
   1.970 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
   1.971 +      };
   1.972 +      testElm("nav", obj);
   1.973 +
   1.974 +      //////////////////////////////////////////////////////////////////////////
   1.975 +      // HTML:object (windowless and windowed plugins) and HTML:param
   1.976 +
   1.977 +      if (WIN) {
   1.978 +        obj = {
   1.979 +          role: ROLE_EMBEDDED_OBJECT,
   1.980 +          states: STATE_UNAVAILABLE,
   1.981 +          children: [ ] // no child for HTML:param
   1.982 +        };
   1.983 +        testElm("object_plugin_windowless", obj);
   1.984 +
   1.985 +        obj = {
   1.986 +          role: ROLE_EMBEDDED_OBJECT,
   1.987 +          absentStates: STATE_UNAVAILABLE
   1.988 +        };
   1.989 +        testElm("object_plugin_windowed", obj);
   1.990 +      }
   1.991 +
   1.992 +      //////////////////////////////////////////////////////////////////////////
   1.993 +      // HTML:select, HTML:optgroup and HTML:option
   1.994 +
   1.995 +      obj = { // HMTL:select@size > 1
   1.996 +        role: ROLE_LISTBOX,
   1.997 +        states: STATE_FOCUSABLE,
   1.998 +        absentStates: STATE_MULTISELECTABLE,
   1.999 +        interfaces: [ nsIAccessibleSelectable ],
  1.1000 +        children: [
  1.1001 +          { GROUPING: [ // HTML:optgroup
  1.1002 +            { role: ROLE_STATICTEXT },
  1.1003 +            { role: ROLE_OPTION }, // HTML:option
  1.1004 +            { role: ROLE_OPTION }
  1.1005 +          ] },
  1.1006 +          {
  1.1007 +            role: ROLE_OPTION,
  1.1008 +            states: STATE_FOCUSABLE,
  1.1009 +            actions: "select",
  1.1010 +            interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
  1.1011 +          }
  1.1012 +        ]
  1.1013 +      };
  1.1014 +      testElm("select_listbox", obj);
  1.1015 +
  1.1016 +      obj = { // HTML:select@multiple
  1.1017 +        role: ROLE_LISTBOX,
  1.1018 +        states: STATE_FOCUSABLE | STATE_MULTISELECTABLE,
  1.1019 +        children: [
  1.1020 +          { role: ROLE_OPTION },
  1.1021 +          { role: ROLE_OPTION },
  1.1022 +          { role: ROLE_OPTION }
  1.1023 +        ]
  1.1024 +      };
  1.1025 +      testElm("select_listbox_multiselectable", obj);
  1.1026 +
  1.1027 +      obj = { // HTML:select
  1.1028 +        role: ROLE_COMBOBOX,
  1.1029 +        states: STATE_FOCUSABLE,
  1.1030 +        children: [
  1.1031 +          {
  1.1032 +            role: ROLE_COMBOBOX_LIST,
  1.1033 +            children: [
  1.1034 +              { role: ROLE_COMBOBOX_OPTION },
  1.1035 +              { role: ROLE_COMBOBOX_OPTION },
  1.1036 +              { role: ROLE_COMBOBOX_OPTION }
  1.1037 +            ]
  1.1038 +          }
  1.1039 +        ]
  1.1040 +      };
  1.1041 +      testElm("select_combobox", obj);
  1.1042 +
  1.1043 +      //////////////////////////////////////////////////////////////////////////
  1.1044 +      // HTML:output
  1.1045 +
  1.1046 +      obj = {
  1.1047 +        role: ROLE_SECTION,
  1.1048 +        attributes: { "live": "polite" },
  1.1049 +        todo_relations: {
  1.1050 +          RELATION_CONTROLLED_BY: "output_input"
  1.1051 +        },
  1.1052 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
  1.1053 +      };
  1.1054 +      testElm("output", obj);
  1.1055 +
  1.1056 +      obj = {
  1.1057 +        role: ROLE_ENTRY,
  1.1058 +        relations: {
  1.1059 +          RELATION_CONTROLLER_FOR: "output"
  1.1060 +        }
  1.1061 +      };
  1.1062 +      testElm("output_input", obj);
  1.1063 +
  1.1064 +      //////////////////////////////////////////////////////////////////////////
  1.1065 +      // HTML:pre
  1.1066 +
  1.1067 +      obj = {
  1.1068 +        role: ROLE_PARAGRAPH,
  1.1069 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
  1.1070 +      };
  1.1071 +      testElm("pre", obj);
  1.1072 +
  1.1073 +      ///////////////////////////////////////////////////////////////////////////
  1.1074 +      // HTML:progress
  1.1075 +
  1.1076 +      obj = {
  1.1077 +        role: ROLE_PROGRESSBAR,
  1.1078 +        absentStates: STATE_MIXED,
  1.1079 +        interfaces: [ nsIAccessibleValue ]
  1.1080 +      };
  1.1081 +      testElm("progress", obj);
  1.1082 +
  1.1083 +      obj = {
  1.1084 +        role: ROLE_PROGRESSBAR,
  1.1085 +        states: STATE_MIXED
  1.1086 +      };
  1.1087 +      testElm("progress_indeterminate", obj);
  1.1088 +
  1.1089 +      //////////////////////////////////////////////////////////////////////////
  1.1090 +      // HTML:q
  1.1091 +
  1.1092 +      obj = {
  1.1093 +        role: ROLE_TEXT_CONTAINER,
  1.1094 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
  1.1095 +        children: [
  1.1096 +          { role: ROLE_STATICTEXT }, // left quote
  1.1097 +          { role: ROLE_TEXT_LEAF }, // quoted text
  1.1098 +          { role: ROLE_STATICTEXT } // right quote
  1.1099 +        ]
  1.1100 +      };
  1.1101 +      testElm("q", obj);
  1.1102 +
  1.1103 +      //////////////////////////////////////////////////////////////////////////
  1.1104 +      // HTML:ruby
  1.1105 +
  1.1106 +      todo(isAccessible("ruby"), "ruby element is not accessible");
  1.1107 +
  1.1108 +      //////////////////////////////////////////////////////////////////////////
  1.1109 +      // HTML:s contained by paragraph
  1.1110 +
  1.1111 +      obj = {
  1.1112 +        role: ROLE_PARAGRAPH,
  1.1113 +        textAttrs: {
  1.1114 +          0: { },
  1.1115 +          6: { "text-line-through-style": "solid" }
  1.1116 +        },
  1.1117 +        children: [
  1.1118 +          { role: ROLE_TEXT_LEAF }, // plain text
  1.1119 +          { role: ROLE_TEXT_LEAF } // HTML:i text
  1.1120 +        ]
  1.1121 +      };
  1.1122 +      testElm("s_container", obj);
  1.1123 +
  1.1124 +      //////////////////////////////////////////////////////////////////////////
  1.1125 +      // HTML:samp contained by paragraph
  1.1126 +
  1.1127 +      obj = {
  1.1128 +        role: ROLE_PARAGRAPH,
  1.1129 +        children: [
  1.1130 +          { role: ROLE_TEXT_LEAF }, // plain text
  1.1131 +          { role: ROLE_TEXT_LEAF } // HTML:samp text
  1.1132 +        ]
  1.1133 +      };
  1.1134 +      testElm("samp_container", obj);
  1.1135 +
  1.1136 +      //////////////////////////////////////////////////////////////////////////
  1.1137 +      // HTML:section
  1.1138 +
  1.1139 +      obj = {
  1.1140 +        role: ROLE_SECTION,
  1.1141 +        attributes: { "xml-roles": "region" },
  1.1142 +        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
  1.1143 +      };
  1.1144 +      testElm("section", obj);
  1.1145 +
  1.1146 +      //////////////////////////////////////////////////////////////////////////
  1.1147 +      // HTML:small contained by paragraph
  1.1148 +
  1.1149 +      obj = {
  1.1150 +        role: ROLE_PARAGRAPH,
  1.1151 +        textAttrs: {
  1.1152 +          0: { },
  1.1153 +          6: { "font-size": "10pt" }
  1.1154 +        },
  1.1155 +        children: [
  1.1156 +          { role: ROLE_TEXT_LEAF }, // plain text
  1.1157 +          { role: ROLE_TEXT_LEAF } // HTML:small text
  1.1158 +        ]
  1.1159 +      };
  1.1160 +      testElm("small_container", obj);
  1.1161 +
  1.1162 +      //////////////////////////////////////////////////////////////////////////
  1.1163 +      // HTML:source
  1.1164 +
  1.1165 +      ok(!isAccessible("source"), "source element is not accessible");
  1.1166 +
  1.1167 +      //////////////////////////////////////////////////////////////////////////
  1.1168 +      // HTML:span
  1.1169 +
  1.1170 +      ok(!isAccessible("span"), "span element is not accessible");
  1.1171 +
  1.1172 +      //////////////////////////////////////////////////////////////////////////
  1.1173 +      // HTML:strong contained by paragraph
  1.1174 +
  1.1175 +      obj = {
  1.1176 +        role: ROLE_PARAGRAPH,
  1.1177 +        children: [
  1.1178 +          { role: ROLE_TEXT_LEAF }, // plain text
  1.1179 +          { role: ROLE_TEXT_LEAF } // HTML:strong text
  1.1180 +        ]
  1.1181 +      };
  1.1182 +      testElm("strong_container", obj);
  1.1183 +
  1.1184 +      //////////////////////////////////////////////////////////////////////////
  1.1185 +      // HTML:sub contained by paragraph
  1.1186 +
  1.1187 +      obj = {
  1.1188 +        role: ROLE_PARAGRAPH,
  1.1189 +        textAttrs: {
  1.1190 +          0: { },
  1.1191 +          6: { "text-position": "sub" }
  1.1192 +        },
  1.1193 +        children: [
  1.1194 +          { role: ROLE_TEXT_LEAF }, // plain text
  1.1195 +          { role: ROLE_TEXT_LEAF } // HTML:sub text
  1.1196 +        ]
  1.1197 +      };
  1.1198 +      testElm("sub_container", obj);
  1.1199 +
  1.1200 +      //////////////////////////////////////////////////////////////////////////
  1.1201 +      // HTML:sup contained by paragraph
  1.1202 +
  1.1203 +      obj = {
  1.1204 +        role: ROLE_PARAGRAPH,
  1.1205 +        textAttrs: {
  1.1206 +          0: { },
  1.1207 +          6: { "text-position": "super" }
  1.1208 +        },
  1.1209 +        children: [
  1.1210 +          { role: ROLE_TEXT_LEAF }, // plain text
  1.1211 +          { role: ROLE_TEXT_LEAF } // HTML:sup text
  1.1212 +        ]
  1.1213 +      };
  1.1214 +      testElm("sup_container", obj);
  1.1215 +
  1.1216 +      //////////////////////////////////////////////////////////////////////////
  1.1217 +      // HTML:svg
  1.1218 +
  1.1219 +      obj = {
  1.1220 +        todo_role: ROLE_GRAPHIC
  1.1221 +      };
  1.1222 +      testElm("svg", obj);
  1.1223 +
  1.1224 +      //////////////////////////////////////////////////////////////////////////
  1.1225 +      // HTML:textarea
  1.1226 +
  1.1227 +      obj = {
  1.1228 +        role: ROLE_ENTRY,
  1.1229 +        extraStates: EXT_STATE_MULTI_LINE | EXT_STATE_EDITABLE,
  1.1230 +        actions: "activate",
  1.1231 +        interfaces: [ nsIAccessibleText, nsIAccessibleEditableText ]
  1.1232 +      };
  1.1233 +      testElm("textarea", obj);
  1.1234 +
  1.1235 +      //////////////////////////////////////////////////////////////////////////
  1.1236 +      // HTML:time
  1.1237 +
  1.1238 +      ok(!isAccessible("time"), "time element is not accessible");
  1.1239 +
  1.1240 +      //////////////////////////////////////////////////////////////////////////
  1.1241 +      // HTML:u contained by paragraph
  1.1242 +
  1.1243 +      obj = {
  1.1244 +        role: ROLE_PARAGRAPH,
  1.1245 +        textAttrs: {
  1.1246 +          0: { },
  1.1247 +          6: { "text-underline-style" : "solid" }
  1.1248 +        },
  1.1249 +        children: [
  1.1250 +          { role: ROLE_TEXT_LEAF }, // plain text
  1.1251 +          { role: ROLE_TEXT_LEAF } // HTML:u text
  1.1252 +        ]
  1.1253 +      };
  1.1254 +      testElm("u_container", obj);
  1.1255 +
  1.1256 +      //////////////////////////////////////////////////////////////////////////
  1.1257 +      // HTML:var contained by paragraph
  1.1258 +
  1.1259 +      obj = {
  1.1260 +        role: ROLE_PARAGRAPH,
  1.1261 +        children: [
  1.1262 +          { role: ROLE_TEXT_LEAF }, // plain text
  1.1263 +          { role: ROLE_TEXT_LEAF }, // HTML:var text
  1.1264 +          { role: ROLE_TEXT_LEAF }, // plain text
  1.1265 +          { role: ROLE_TEXT_LEAF } // HTML:var text
  1.1266 +        ]
  1.1267 +      };
  1.1268 +      testElm("var_container", obj);
  1.1269 +
  1.1270 +      //////////////////////////////////////////////////////////////////////////
  1.1271 +      obj = { // HTML:video
  1.1272 +        role: ROLE_GROUPING
  1.1273 +      };
  1.1274 +      testElm("video", obj);
  1.1275 +
  1.1276 +      SimpleTest.finish();
  1.1277 +    }
  1.1278 +
  1.1279 +    SimpleTest.waitForExplicitFinish();
  1.1280 +    addA11yLoadEvent(doTest);
  1.1281 +    setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
  1.1282 +
  1.1283 +    </script>
  1.1284 +</head>
  1.1285 +<body>
  1.1286 +
  1.1287 +  <a target="_blank"
  1.1288 +    title="Implement figure and figcaption accessibility"
  1.1289 +    href="https://bugzilla.mozilla.org/show_bug.cgi?id=658272">
  1.1290 +     Mozilla Bug 658272
  1.1291 +  </a><br/>
  1.1292 +  <p id="display"></p>
  1.1293 +  <div id="content" style="display: none"></div>
  1.1294 +  <pre id="test">
  1.1295 +  </pre>
  1.1296 +
  1.1297 +  <a id="a_href" href="www.mozilla.com">mozilla site</a>
  1.1298 +  <a id="a_nohref">anchor</a>
  1.1299 +  <table>
  1.1300 +    <tr>
  1.1301 +      <td id="td_abbr"><abbr title="World Wide Web">WWW</abbr></td>
  1.1302 +    </tr>
  1.1303 +  </table>
  1.1304 +  <address id="address">
  1.1305 +    Mozilla Foundation<br>
  1.1306 +    1981 Landings Drive<br>
  1.1307 +    Building K<br>
  1.1308 +    Mountain View, CA 94043-0801<br>
  1.1309 +    USA
  1.1310 +  </address>
  1.1311 +
  1.1312 +  <map name="atoz_map">
  1.1313 +    <area id="area_href"
  1.1314 +          href="http://www.bbc.co.uk/radio4/atoz/index.shtml#b"
  1.1315 +          coords="17,0,30,14" alt="b" shape="rect">
  1.1316 +    <area id="area_nohref"
  1.1317 +          coords="0,0,13,14" alt="a" shape="rect">
  1.1318 +  </map>
  1.1319 +  <img id="imgmap" width="447" height="15"
  1.1320 +       usemap="#atoz_map"
  1.1321 +       src="../letters.gif">
  1.1322 +
  1.1323 +  <article id="article">A document</article>
  1.1324 +  <audio id="audio" controls="true">
  1.1325 +    <source id="source" src="../bug461281.ogg" type="video/ogg">
  1.1326 +  </audio>
  1.1327 +
  1.1328 +  <aside id="aside">
  1.1329 +    <p>Some content related to an &lt;article&gt;</p>
  1.1330 +  </aside>
  1.1331 +
  1.1332 +  <p id="b_container">normal<b>bold</b></p>
  1.1333 +  <p id="bdi_container">User <bdi>إيان</bdi>: 90 points</p>
  1.1334 +  <p id="bdo_container"><bdo dir="rtl">This text will go right to left.</bdo></p>
  1.1335 +
  1.1336 +  <blockquote id="blockquote" cite="http://developer.mozilla.org">
  1.1337 +    <p>This is a quotation taken from the Mozilla Developer Center.</p>
  1.1338 +  </blockquote>
  1.1339 +
  1.1340 +  <!--  two BRs, one will be eaten -->
  1.1341 +  <p id="br_container"><br><br></p>
  1.1342 +
  1.1343 +  <button id="button">button</button>
  1.1344 +  <form>
  1.1345 +    <button id="button_default" type="submit">button</button>
  1.1346 +  </form>
  1.1347 +
  1.1348 +  <canvas id="canvas"></canvas>
  1.1349 +
  1.1350 +  <table id="table">
  1.1351 +    <caption id="caption">caption</caption>
  1.1352 +    <thead>
  1.1353 +      <tr>
  1.1354 +        <th>col1</th><th>col2</th>
  1.1355 +      </tr>
  1.1356 +    </thead>
  1.1357 +    <tbody>
  1.1358 +      <tr>
  1.1359 +        <th>col1</th><td>cell2</td>
  1.1360 +      </tr>
  1.1361 +    </tbody>
  1.1362 +    <tfoot>
  1.1363 +      <tr>
  1.1364 +        <td>cell5</td><td>cell6</td>
  1.1365 +      </tr>
  1.1366 +    </tfoot>
  1.1367 +  </table>
  1.1368 +
  1.1369 +  <p id="cite_container">normal<cite>cite</cite></p>
  1.1370 +  <p id="code_container">normal<code>code</code></p>
  1.1371 +
  1.1372 +  <table id="colNcolgroup_table">
  1.1373 +    <colgroup>
  1.1374 +      <col>
  1.1375 +      <col span="2">
  1.1376 +    </colgroup>
  1.1377 +    <tr>
  1.1378 +      <td>Lime</td>
  1.1379 +      <td>Lemon</td>
  1.1380 +      <td>Orange</td>
  1.1381 +    </tr>
  1.1382 +  </table>
  1.1383 +
  1.1384 +  <p id="data_container"><data value="8">Eight</data></p>
  1.1385 +
  1.1386 +  <datalist id="datalist">
  1.1387 +    <summary id="summary">details</summary>
  1.1388 +    <option>Paris</option>
  1.1389 +    <option>San Francisco</option>
  1.1390 +  </datalist>
  1.1391 +  <input id="autocomplete_datalist" list="datalist">
  1.1392 +
  1.1393 +  <dl id="dl">
  1.1394 +    <dt>item1</dt><dd>description</dd>
  1.1395 +  </dl>
  1.1396 +
  1.1397 +  <p id="del_container">normal<del>Removed</del></p>
  1.1398 +
  1.1399 +  <details id="details" open="open">
  1.1400 +    <summary>Information</summary>
  1.1401 +    <p>If your browser supports this element, it should allow you to expand and collapse these details.</p>
  1.1402 +  </details>
  1.1403 +
  1.1404 +  <p id="dfn_container"><dfn id="def-internet">The Internet</dfn> is a global
  1.1405 +    system of interconnected networks that use the Internet Protocol Suite (TCP/IP)
  1.1406 +    to serve billions of users worldwide.</p>
  1.1407 +
  1.1408 +  <dialog id="dialog" open="true">This is a dialog</dialog>
  1.1409 +
  1.1410 +  <div id="div">div</div>
  1.1411 +
  1.1412 +  <p id="em_container">normal<em>emphasis</em></p>
  1.1413 +
  1.1414 +  <embed id="embed_plugin_windowless" type="application/x-test"
  1.1415 +         width="300" height="300"></embed>
  1.1416 +  <embed id="embed_plugin_windowed" type="application/x-test" wmode="window"
  1.1417 +         width="300" height="300"></embed>
  1.1418 +
  1.1419 +  <fieldset id="fieldset">
  1.1420 +    <legend id="legend">legend</legend>
  1.1421 +    <input />
  1.1422 +  </fieldset>
  1.1423 +
  1.1424 +  <figure id="figure">
  1.1425 +    <img src="../moz.png" alt="An awesome picture">
  1.1426 +    <figcaption id="figcaption">Caption for the awesome picture</figcaption>
  1.1427 +  </figure>
  1.1428 +
  1.1429 +  <footer id="footer">Some copyright info</footer>
  1.1430 +  <article>
  1.1431 +    <footer id="footer_in_article">Some copyright info</footer>
  1.1432 +  </article>
  1.1433 +  <section>
  1.1434 +    <footer id="footer_in_section">Some copyright info</footer>
  1.1435 +  </section>
  1.1436 +
  1.1437 +  <form id="form"></form>
  1.1438 +
  1.1439 +  <iframe id="frameset_container"
  1.1440 +          src="data:text/html,<html><frameset><frame src='data:text/html,hi'></frame></frameset></html>">
  1.1441 +  </iframe>
  1.1442 +
  1.1443 +  <h1 id="h1">heading1</h1>
  1.1444 +  <h2 id="h2">heading2</h2>
  1.1445 +  <h3 id="h3">heading3</h3>
  1.1446 +  <h4 id="h4">heading4</h4>
  1.1447 +  <h5 id="h5">heading5</h5>
  1.1448 +  <h6 id="h6">heading6</h6>
  1.1449 +
  1.1450 +  <header id="header">A logo</header>
  1.1451 +  <article>
  1.1452 +    <header id="header_in_article">Not logo</header>
  1.1453 +  </article>
  1.1454 +  <section>
  1.1455 +    <header id="header_in_section">Not logo</header>
  1.1456 +  </section>
  1.1457 +
  1.1458 +  <hr id="hr">
  1.1459 +  <p id="i_container">normal<i>italic</i></p>
  1.1460 +  <img id="img" src="../moz.png">
  1.1461 +
  1.1462 +  <input id="input_button" type="button" value="Button">
  1.1463 +  <input id="input_checkbox" type="checkbox">
  1.1464 +  <input id="input_checkbox_true" type="checkbox" checked>
  1.1465 +  <input id="input_file" type="file">
  1.1466 +  <input id="input_image" type="image">
  1.1467 +  <form>
  1.1468 +    <input id="input_image_default" type="image">
  1.1469 +  </form>
  1.1470 +  <input id="input_submit" type="submit">
  1.1471 +  <form>
  1.1472 +    <input id="input_submit_default" type="submit">
  1.1473 +  </form>
  1.1474 +  <input id="input_number" type="number" value="44">
  1.1475 +  <input id="input_text" type="text" value="hi">
  1.1476 +  <input id="input_search" type="search" value="cats">
  1.1477 +  <input id="input_email" type="email" value="me@mozilla.com">
  1.1478 +  <input id="input_tel" type="tel" value="111.111.1111">
  1.1479 +  <input id="input_url" type="url" value="www.mozilla.com">
  1.1480 +  <input id="input_password" type="password" value="44">
  1.1481 +  <input id="input_password_readonly" type="password" value="44" readonly>
  1.1482 +  <input id="input_radio" type="radio">
  1.1483 +  <input id="input_radio_true" type="radio" checked>
  1.1484 +  <input id="input_range" type="range">
  1.1485 +  <form>
  1.1486 +    <input id="input_reset" type="reset">
  1.1487 +  </form>
  1.1488 +
  1.1489 +  <p id="ins_container">normal<ins>Inserted</ins></p>
  1.1490 +  <p id="kbd_container">normal<kbd>cmd</kbd></p>
  1.1491 +  <keygen id="keygen" name="RSA public key" challenge="123456789" keytype="RSA">
  1.1492 +
  1.1493 +  <label id="label">label<input id="label_input"></label>
  1.1494 +  <label id="label_for" for="label_for_input">label</label>
  1.1495 +  <input id="label_for_input">
  1.1496 +
  1.1497 +  <ul id="ul">
  1.1498 +    <li>item1</li>
  1.1499 +  </ul>
  1.1500 +  <ol id="ol">
  1.1501 +    <li>item1</li>
  1.1502 +  </ol>
  1.1503 +
  1.1504 +  <main id="main">main</main>
  1.1505 +
  1.1506 +  <map id="map_imagemap" name="atoz_map">
  1.1507 +    <area href="http://www.bbc.co.uk/radio4/atoz/index.shtml#b"
  1.1508 +          coords="17,0,30,14" alt="b" shape="rect">
  1.1509 +    <area href="http://www.bbc.co.uk/radio4/atoz/index.shtml#a"
  1.1510 +          coords="0,0,13,14" alt="a" shape="rect">
  1.1511 +  </map>
  1.1512 +  <img id="imgmap" width="447" height="15"
  1.1513 +       usemap="#atoz_map"
  1.1514 +       src="../letters.gif">
  1.1515 +
  1.1516 +  <map id="map" title="Navigation Bar" name="mapgroup">
  1.1517 +    <p>
  1.1518 +      [<a href="#how">Bypass navigation bar</a>]
  1.1519 +      [<a href="home.html">Home</a>]
  1.1520 +    </p>
  1.1521 +  </map>
  1.1522 +
  1.1523 +  <p id="mark_container">normal<mark>highlighted</mark></p>
  1.1524 +
  1.1525 +  <math id="math">
  1.1526 +    <mrow>
  1.1527 +      <mrow>
  1.1528 +        <msup>
  1.1529 +          <mi>a</mi>
  1.1530 +          <mn>2</mn>
  1.1531 +        </msup>
  1.1532 +        <mo>+</mo>
  1.1533 +        <msup>
  1.1534 +          <mi>b</mi>
  1.1535 +          <mn>2</mn>
  1.1536 +        </msup>
  1.1537 +      </mrow>
  1.1538 +      <mo>=</mo>
  1.1539 +      <msup>
  1.1540 +        <mi>c</mi>
  1.1541 +        <mn>2</mn>
  1.1542 +      </msup>
  1.1543 +    </mrow>
  1.1544 +  </math>
  1.1545 +
  1.1546 +  <menu id="menu" type="toolbar">
  1.1547 +    <li>
  1.1548 +      <menu label="File">
  1.1549 +        <button type="button" onclick="new()">New...</button>
  1.1550 +        <button type="button" onclick="save()">Save...</button>
  1.1551 +      </menu>
  1.1552 +    </li>
  1.1553 +    <li>
  1.1554 +      <menu label="Edit">
  1.1555 +        <button type="button" onclick="cut()">Cut...</button>
  1.1556 +        <button type="button" onclick="copy()">Copy...</button>
  1.1557 +        <button type="button" onclick="paste()">Paste...</button>
  1.1558 +      </menu>
  1.1559 +    </li>
  1.1560 +  </menu>
  1.1561 +
  1.1562 +  <meter id="meter" min="0" max="1000" low="300" high="700" value="200">200 Euro</meter>
  1.1563 +
  1.1564 +  <nav id="nav">
  1.1565 +    <ul>
  1.1566 +      <li><a href="#">Home</a></li>
  1.1567 +      <li><a href="#">About</a></li>
  1.1568 +      <li><a href="#">Contact</a></li>
  1.1569 +    </ul>
  1.1570 +  </nav>
  1.1571 +
  1.1572 +  <object id="object_plugin_windowless" type="application/x-test"
  1.1573 +         width="300" height="300">
  1.1574 +    <param name="foo" value="bar">
  1.1575 +  </object>
  1.1576 +  <object id="object_plugin_windowed" type="application/x-test" wmode="window"
  1.1577 +         width="300" height="300"></object>
  1.1578 +
  1.1579 +  <select id="select_listbox" size="4">
  1.1580 +    <optgroup label="Colors">
  1.1581 +      <option>Red</option>
  1.1582 +      <option>Blue</option>
  1.1583 +    </optgroup>
  1.1584 +    <option>Animal</option>
  1.1585 +  </select>
  1.1586 +
  1.1587 +  <select id="select_listbox_multiselectable" multiple>
  1.1588 +    <option>Red</option>
  1.1589 +    <option>Blue</option>
  1.1590 +    <option>Green</option>
  1.1591 +  </select>
  1.1592 +
  1.1593 +  <select id="select_combobox">
  1.1594 +    <option>Red</option>
  1.1595 +    <option>Blue</option>
  1.1596 +    <option>Green</option>
  1.1597 +  </select>
  1.1598 +
  1.1599 +  <input id="output_input">
  1.1600 +  <output id="output" for="output_input"></output>
  1.1601 +
  1.1602 +  <pre id="pre">pre</pre>
  1.1603 +
  1.1604 +  <progress id="progress" min="0" value="21" max="42"></progress>
  1.1605 +  <progress id="progress_indeterminate"></progress>
  1.1606 +
  1.1607 +  <q id="q" cite="http://en.wikipedia.org/wiki/Kenny_McCormick#Cultural_impact">
  1.1608 +    Oh my God, they killed Kenny!
  1.1609 +  </q>
  1.1610 +
  1.1611 +  <ruby id="ruby">
  1.1612 +    漢 <rp>(</rp><rt>Kan</rt><rp>)</rp>
  1.1613 +    字 <rp>(</rp><rt>ji</rt><rp>)</rp>
  1.1614 +  </ruby>
  1.1615 +
  1.1616 +  <p id="s_container">normal<s>striked</s></p>
  1.1617 +  <p id="samp_container">normal<samp>sample</samp></p>
  1.1618 +  <section id="section">section</section>
  1.1619 +  <p id="small_container">normal<small>small</small></p>
  1.1620 +  <span id="span"></span>
  1.1621 +  <p id="strong_container">normal<strong>strong</strong></p>
  1.1622 +  <p id="sub_container">normal<sub>sub</sub></p>
  1.1623 +  <p id="sup_container">normal<sup>sup</sup></p>
  1.1624 +
  1.1625 +  <svg id="svg"></svg>
  1.1626 +  <textarea id="textarea"></textarea>
  1.1627 +
  1.1628 +  <p>The concert took place on <time id="time" datetime="2001-05-15 19:00">May 15</time></p>
  1.1629 +  <p id="u_container">normal<u>underline</u></p>
  1.1630 +  <p id="var_container">An equation: <var>x</var> = <var>y</var></p>
  1.1631 +
  1.1632 +  <video id="video" controls="true">
  1.1633 +    <source id="source" src="../bug461281.ogg" type="video/ogg">
  1.1634 +  </video>
  1.1635 +
  1.1636 +</video>
  1.1637 +</body>
  1.1638 +</html>

mercurial