accessible/tests/mochitest/states/test_doc.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4   <title>states of document</title>
     5   <link rel="stylesheet" type="text/css"
     6         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     8   <script type="application/javascript"
     9           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    11   <script type="application/javascript"
    12           src="../common.js"></script>
    13   <script type="application/javascript"
    14           src="../role.js"></script>
    15   <script type="application/javascript"
    16           src="../states.js"></script>
    18   <script type="application/javascript">
    19     function doTest()
    20     {
    21       // Bug 566542: root accesible should expose active state when focused.
    22       testStates(getRootAccessible(), 0, EXT_STATE_ACTIVE);
    24       // Bug 509696, 607219.
    25       testStates(document, STATE_READONLY, 0); // role=""
    27       document.body.setAttribute("role","banner"); // no platform mapping
    28       testStates(document, STATE_READONLY);
    29       document.body.setAttribute("role","foo"); // bogus role
    30       testStates(document, STATE_READONLY);
    31       document.body.removeAttribute("role");
    32       testStates(document, STATE_READONLY);
    34       // Bugs 454997 and 467387
    35       testStates(document, STATE_READONLY);
    36       testStates("document", STATE_READONLY);
    37       testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    39       document.designMode = "on";
    41       testStates(document, 0, EXT_STATE_EDITABLE, STATE_READONLY);
    42       testStates("p", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    43       testStates("document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    44       testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    46       document.designMode = "off";
    48       testStates(document, STATE_READONLY);
    49       testStates("document", STATE_READONLY);
    50       testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
    52       SimpleTest.finish();
    53     }
    55     SimpleTest.waitForExplicitFinish();
    56     addA11yLoadEvent(doTest);
    57   </script>
    58 </head>
    60 <body role="">
    62   <a target="_blank"
    63      title="<body contenteditable='true'> exposed incorrectly"
    64      href="https://bugzilla.mozilla.org/show_bug.cgi?id=454997">Mozilla Bug 454997</a>
    65    <a target="_blank"
    66      title="nsIAccessible states tests of editable document"
    67      href="https://bugzilla.mozilla.org/show_bug.cgi?id=467387">Mozilla Bug 467387</a>
    68    <a target="_blank"
    69      title="Role attribute on body with empty string causes DocAccessible not to have read-only state."
    70      href="https://bugzilla.mozilla.org/show_bug.cgi?id=509696">Mozilla Bug 509696</a>
    71   <a target="_blank"
    72      title="Frame for firefox does not implement the state "active" when firefox is the active frame"
    73      href="https://bugzilla.mozilla.org/show_bug.cgi?id=566542">Mozilla Bug 566542</a>
    74   <a target="_blank"
    75      title="Dynamic role attribute change on body doesn't affect on document role"
    76      href="https://bugzilla.mozilla.org/show_bug.cgi?id=607219">Mozilla Bug 607219</a>
    78   <p id="display"></p>
    79   <div id="content" style="display: none"></div>
    80   <pre id="test">
    81   </pre>
    83   <p id="p">hello</p>
    85   <div id="document" role="document">document</div>
    86   <div id="editable_document" role="document" contentEditable="true">editable document</doc>
    88 </body>
    89 </html>

mercurial