accessible/tests/mochitest/tree/test_txtctrl.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/tree/test_txtctrl.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,173 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +
     1.7 +<head>
     1.8 +  <title>HTML text controls tests</title>
     1.9 +  <link rel="stylesheet" type="text/css"
    1.10 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.11 +
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.14 +
    1.15 +  <script type="application/javascript"
    1.16 +          src="../common.js"></script>
    1.17 +  <script type="application/javascript"
    1.18 +          src="../role.js"></script>
    1.19 +
    1.20 +  <script type="application/javascript">
    1.21 +    function doTest()
    1.22 +    {
    1.23 +      // editable div
    1.24 +      var accTree = {
    1.25 +        role: ROLE_SECTION,
    1.26 +        children: [
    1.27 +          { // text child
    1.28 +            role: ROLE_TEXT_LEAF,
    1.29 +            children: []
    1.30 +          }
    1.31 +        ]
    1.32 +      };
    1.33 +
    1.34 +      testAccessibleTree("txc1", accTree);
    1.35 +
    1.36 +      // input@type="text", value
    1.37 +      accTree = {
    1.38 +        role: ROLE_ENTRY,
    1.39 +        children: [
    1.40 +          { // text child
    1.41 +            role: ROLE_TEXT_LEAF,
    1.42 +            children: []
    1.43 +          }
    1.44 +        ]
    1.45 +      };
    1.46 +
    1.47 +      testAccessibleTree("txc2", accTree);
    1.48 +
    1.49 +      // input@type="text", no value
    1.50 +      accTree =
    1.51 +        { ENTRY: [ ] };
    1.52 +
    1.53 +      testAccessibleTree("txc3", accTree);
    1.54 +
    1.55 +      // textarea
    1.56 +      accTree = {
    1.57 +        role: ROLE_ENTRY,
    1.58 +        children: [
    1.59 +          {
    1.60 +            role: ROLE_TEXT_LEAF // hello1\nhello2 text
    1.61 +          }
    1.62 +        ]
    1.63 +      };
    1.64 +
    1.65 +      testAccessibleTree("txc4", accTree);
    1.66 +
    1.67 +      // input@type="password"
    1.68 +      accTree = {
    1.69 +        role: ROLE_PASSWORD_TEXT,
    1.70 +        children: [
    1.71 +          {
    1.72 +            role: ROLE_TEXT_LEAF,
    1.73 +            children: []
    1.74 +          }
    1.75 +        ]
    1.76 +      };
    1.77 +
    1.78 +      testAccessibleTree("txc5", accTree);
    1.79 +      
    1.80 +      // input@type="tel", value
    1.81 +      accTree = {
    1.82 +        role: ROLE_ENTRY,
    1.83 +        children: [
    1.84 +          { // text child
    1.85 +            role: ROLE_TEXT_LEAF,
    1.86 +            children: []
    1.87 +          }
    1.88 +        ]
    1.89 +      };
    1.90 +
    1.91 +      testAccessibleTree("txc6", accTree);
    1.92 +
    1.93 +      // input@type="email", value
    1.94 +      accTree = {
    1.95 +        role: ROLE_ENTRY,
    1.96 +        children: [
    1.97 +          { // text child
    1.98 +            role: ROLE_TEXT_LEAF,
    1.99 +            children: []
   1.100 +          }
   1.101 +        ]
   1.102 +      };
   1.103 +
   1.104 +      testAccessibleTree("txc7", accTree);
   1.105 +
   1.106 +      // input@type="search", value
   1.107 +      accTree = {
   1.108 +        role: ROLE_ENTRY,
   1.109 +        children: [
   1.110 +          { // text child
   1.111 +            role: ROLE_TEXT_LEAF,
   1.112 +            children: []
   1.113 +          }
   1.114 +        ]
   1.115 +      };
   1.116 +
   1.117 +      testAccessibleTree("txc8", accTree);
   1.118 +
   1.119 +      SimpleTest.finish();
   1.120 +    }
   1.121 +
   1.122 +    SimpleTest.waitForExplicitFinish();
   1.123 +    addA11yLoadEvent(doTest);
   1.124 +  </script>
   1.125 +</head>
   1.126 +<body>
   1.127 +
   1.128 +  <a target="_blank"
   1.129 +     title="overflowed content doesn't expose child text accessibles"
   1.130 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=489306">
   1.131 +    Mozilla Bug 489306
   1.132 +  </a><br>
   1.133 +  <a target="_blank"
   1.134 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=542824"
   1.135 +     title="Create child accessibles for text controls from native anonymous content">
   1.136 +    Mozilla Bug 542824
   1.137 +  </a>
   1.138 +  <a target="_blank"
   1.139 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=625652"
   1.140 +     title="Make sure accessible tree is correct when rendered text is changed">
   1.141 +    Mozilla Bug 625652
   1.142 +  </a>
   1.143 +
   1.144 +  <p id="display"></p>
   1.145 +  <div id="content" style="display: none"></div>
   1.146 +  <pre id="test">
   1.147 +  </pre>
   1.148 +
   1.149 +  <div id="txc1" contentEditable="true">
   1.150 +    1hellohello
   1.151 +  </div>
   1.152 +  <input id="txc2" value="hello">
   1.153 +  <input id="txc3">
   1.154 +  <textarea id="txc4">
   1.155 +    hello1
   1.156 +    hello2
   1.157 +  </textarea>
   1.158 +  <input id="txc5" type="password" value="hello">
   1.159 +  <input id="txc6" type="tel" value="4167771234">
   1.160 +
   1.161 +  Email Address:
   1.162 +  <input id="txc7" type="email" list="contacts" value="xyzzy">
   1.163 +  <datalist id="contacts">
   1.164 +    <option>xyzzy@plughs.com</option>
   1.165 +    <option>nobody@mozilla.org</option>
   1.166 +  </datalist>
   1.167 +
   1.168 +  </br>Search for:
   1.169 +  <input id="txc8" type="search" list="searchhisty" value="Gamma">
   1.170 +  <datalist id="searchhisty">
   1.171 +    <option>Gamma Rays</option>
   1.172 +    <option>Gamma Ray Bursts</option>
   1.173 +  </datalist>
   1.174 +
   1.175 +</body>
   1.176 +</html>

mercurial