accessible/tests/mochitest/states/test_doc.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>states of document</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 <script type="application/javascript"
michael@0 16 src="../states.js"></script>
michael@0 17
michael@0 18 <script type="application/javascript">
michael@0 19 function doTest()
michael@0 20 {
michael@0 21 // Bug 566542: root accesible should expose active state when focused.
michael@0 22 testStates(getRootAccessible(), 0, EXT_STATE_ACTIVE);
michael@0 23
michael@0 24 // Bug 509696, 607219.
michael@0 25 testStates(document, STATE_READONLY, 0); // role=""
michael@0 26
michael@0 27 document.body.setAttribute("role","banner"); // no platform mapping
michael@0 28 testStates(document, STATE_READONLY);
michael@0 29 document.body.setAttribute("role","foo"); // bogus role
michael@0 30 testStates(document, STATE_READONLY);
michael@0 31 document.body.removeAttribute("role");
michael@0 32 testStates(document, STATE_READONLY);
michael@0 33
michael@0 34 // Bugs 454997 and 467387
michael@0 35 testStates(document, STATE_READONLY);
michael@0 36 testStates("document", STATE_READONLY);
michael@0 37 testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
michael@0 38
michael@0 39 document.designMode = "on";
michael@0 40
michael@0 41 testStates(document, 0, EXT_STATE_EDITABLE, STATE_READONLY);
michael@0 42 testStates("p", 0, EXT_STATE_EDITABLE, STATE_READONLY);
michael@0 43 testStates("document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
michael@0 44 testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
michael@0 45
michael@0 46 document.designMode = "off";
michael@0 47
michael@0 48 testStates(document, STATE_READONLY);
michael@0 49 testStates("document", STATE_READONLY);
michael@0 50 testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
michael@0 51
michael@0 52 SimpleTest.finish();
michael@0 53 }
michael@0 54
michael@0 55 SimpleTest.waitForExplicitFinish();
michael@0 56 addA11yLoadEvent(doTest);
michael@0 57 </script>
michael@0 58 </head>
michael@0 59
michael@0 60 <body role="">
michael@0 61
michael@0 62 <a target="_blank"
michael@0 63 title="<body contenteditable='true'> exposed incorrectly"
michael@0 64 href="https://bugzilla.mozilla.org/show_bug.cgi?id=454997">Mozilla Bug 454997</a>
michael@0 65 <a target="_blank"
michael@0 66 title="nsIAccessible states tests of editable document"
michael@0 67 href="https://bugzilla.mozilla.org/show_bug.cgi?id=467387">Mozilla Bug 467387</a>
michael@0 68 <a target="_blank"
michael@0 69 title="Role attribute on body with empty string causes DocAccessible not to have read-only state."
michael@0 70 href="https://bugzilla.mozilla.org/show_bug.cgi?id=509696">Mozilla Bug 509696</a>
michael@0 71 <a target="_blank"
michael@0 72 title="Frame for firefox does not implement the state "active" when firefox is the active frame"
michael@0 73 href="https://bugzilla.mozilla.org/show_bug.cgi?id=566542">Mozilla Bug 566542</a>
michael@0 74 <a target="_blank"
michael@0 75 title="Dynamic role attribute change on body doesn't affect on document role"
michael@0 76 href="https://bugzilla.mozilla.org/show_bug.cgi?id=607219">Mozilla Bug 607219</a>
michael@0 77
michael@0 78 <p id="display"></p>
michael@0 79 <div id="content" style="display: none"></div>
michael@0 80 <pre id="test">
michael@0 81 </pre>
michael@0 82
michael@0 83 <p id="p">hello</p>
michael@0 84
michael@0 85 <div id="document" role="document">document</div>
michael@0 86 <div id="editable_document" role="document" contentEditable="true">editable document</doc>
michael@0 87
michael@0 88 </body>
michael@0 89 </html>

mercurial