accessible/tests/mochitest/states/test_doc.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/states/test_doc.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,89 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>states of document</title>
     1.8 +  <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="../role.js"></script>
    1.18 +  <script type="application/javascript"
    1.19 +          src="../states.js"></script>
    1.20 +
    1.21 +  <script type="application/javascript">
    1.22 +    function doTest()
    1.23 +    {
    1.24 +      // Bug 566542: root accesible should expose active state when focused.
    1.25 +      testStates(getRootAccessible(), 0, EXT_STATE_ACTIVE);
    1.26 +
    1.27 +      // Bug 509696, 607219.
    1.28 +      testStates(document, STATE_READONLY, 0); // role=""
    1.29 +
    1.30 +      document.body.setAttribute("role","banner"); // no platform mapping
    1.31 +      testStates(document, STATE_READONLY);
    1.32 +      document.body.setAttribute("role","foo"); // bogus role
    1.33 +      testStates(document, STATE_READONLY);
    1.34 +      document.body.removeAttribute("role");
    1.35 +      testStates(document, STATE_READONLY);
    1.36 +
    1.37 +      // Bugs 454997 and 467387
    1.38 +      testStates(document, STATE_READONLY);
    1.39 +      testStates("document", STATE_READONLY);
    1.40 +      testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    1.41 +
    1.42 +      document.designMode = "on";
    1.43 +
    1.44 +      testStates(document, 0, EXT_STATE_EDITABLE, STATE_READONLY);
    1.45 +      testStates("p", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    1.46 +      testStates("document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    1.47 +      testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    1.48 +
    1.49 +      document.designMode = "off";
    1.50 +
    1.51 +      testStates(document, STATE_READONLY);
    1.52 +      testStates("document", STATE_READONLY);
    1.53 +      testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    1.54 +
    1.55 +      SimpleTest.finish();
    1.56 +    }
    1.57 +
    1.58 +    SimpleTest.waitForExplicitFinish();
    1.59 +    addA11yLoadEvent(doTest);
    1.60 +  </script>
    1.61 +</head>
    1.62 +
    1.63 +<body role="">
    1.64 +
    1.65 +  <a target="_blank"
    1.66 +     title="<body contenteditable='true'> exposed incorrectly"
    1.67 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=454997">Mozilla Bug 454997</a>
    1.68 +   <a target="_blank"
    1.69 +     title="nsIAccessible states tests of editable document"
    1.70 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=467387">Mozilla Bug 467387</a>
    1.71 +   <a target="_blank"
    1.72 +     title="Role attribute on body with empty string causes DocAccessible not to have read-only state."
    1.73 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=509696">Mozilla Bug 509696</a>
    1.74 +  <a target="_blank"
    1.75 +     title="Frame for firefox does not implement the state "active" when firefox is the active frame"
    1.76 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=566542">Mozilla Bug 566542</a>
    1.77 +  <a target="_blank"
    1.78 +     title="Dynamic role attribute change on body doesn't affect on document role"
    1.79 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=607219">Mozilla Bug 607219</a>
    1.80 +
    1.81 +  <p id="display"></p>
    1.82 +  <div id="content" style="display: none"></div>
    1.83 +  <pre id="test">
    1.84 +  </pre>
    1.85 +
    1.86 +  <p id="p">hello</p>
    1.87 +
    1.88 +  <div id="document" role="document">document</div>
    1.89 +  <div id="editable_document" role="document" contentEditable="true">editable document</doc>
    1.90 +
    1.91 +</body>
    1.92 +</html>

mercurial