Fixed bug in script to switch the value of aria-hidden to 'false'
authorJoseph Scheuhammer <clown@alum.mit.edu>
Thu, 18 Oct 2012 11:48:27 -0400
changeset 15 18252a0b9006
parent 14 867a444ffac9
child 16 5e5f01c64ed5
Fixed bug in script to switch the value of aria-hidden to 'false'
when the style of the test element is set to 'display:none'.
Also, hooked theses changes up to a button to allow the tester
to make the switch at their leisure (previsou version made the
the style change automatically some time after page load).
ARIA/1.0/tests/test-files/author-requirements/580.html
--- a/ARIA/1.0/tests/test-files/author-requirements/580.html	Mon Oct 15 10:11:59 2012 -0400
+++ b/ARIA/1.0/tests/test-files/author-requirements/580.html	Thu Oct 18 11:48:27 2012 -0400
@@ -7,13 +7,19 @@
     <script type="text/javascript">
       function replaceStyle (/* Element */ element, /* String */ selector, /* String */ newValue) {
           element.setAttribute ('style', selector + ':' + newValue);
-      }
-      function doOnload() {
-          window.setTimeout ("replaceStyle (document.getElementById('test'), 'display', 'block')", 1000);
+          if (newValue == 'block')
+            element.setAttribute ('aria-hidden', 'false');
+          else if (newValue == 'none')
+            element.setAttribute ('aria-hidden', 'true');            
       }
     </script>
   </head>
-  <body onload="doOnload();">
-    <div id="test" aria-hidden="true" style="display:none;">This &lt;div&gt;'s style switched from 'display:none' to 'display:block'.  It has <code>aria-hidden='true'</code>, regardless.</div>
+  <body>
+    <div id="test" aria-hidden="true" style="display:none;">This &lt;div&gt;'s style switched from 'display:none' to 'display:block'.  It's <code>aria-hidden</code> was simultaneously switched to 'false'.</div>
+    <p>
+      <button onclick="replaceStyle (document.getElementById ('test'), 'display', 'block')" type="button">Change to 'display:block'</button>
+      <button onclick="replaceStyle (document.getElementById ('test'), 'display', 'none')" type="button">Change to 'display:none'</button>
+      <button onclick="window.location.reload()" type="button">Reload Page</button>
+    </p>
   </body>
 </html>
\ No newline at end of file