accessible/tests/mochitest/treeupdate/test_list.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <!DOCTYPE html>
     2 <html>
     4 <head>
     5   <title>Test HTML li and listitem bullet accessible cache</title>
     6   <link rel="stylesheet" type="text/css"
     7         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     9   <script type="application/javascript"
    10           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    12   <script type="application/javascript"
    13           src="../common.js"></script>
    14   <script type="application/javascript"
    15           src="../role.js"></script>
    16   <script type="application/javascript"
    17           src="../events.js"></script>
    19   <script type="application/javascript">
    21     ////////////////////////////////////////////////////////////////////////////
    22     // Helpers
    24     function testLiAccessibleTree()
    25     {
    26       // Test accessible tree.
    27       var accTree = {
    28         role: ROLE_LISTITEM,
    29         children: [
    30           {
    31             role: ROLE_STATICTEXT,
    32             children: []
    33           },
    34           {
    35             role: ROLE_TEXT_LEAF,
    36             children: []
    37           }
    38         ]
    39       };
    41       testAccessibleTree("li", accTree);
    42     }
    44     ////////////////////////////////////////////////////////////////////////////
    45     // Sequence item processors
    47     function hideProcessor()
    48     {
    49       this.liNode = getNode("li");
    50       this.li = getAccessible(this.liNode);
    51       this.bullet = this.li.firstChild;
    53       this.process = function hideProcessor_process()
    54       {
    55         this.liNode.style.display = "none";
    56       }
    58       this.onProcessed = function hideProcessor_onProcessed()
    59       {
    60         window.setTimeout(
    61           function(aLiAcc, aLiNode, aBulletAcc)
    62           {
    63             testDefunctAccessible(aLiAcc, aLiNode);
    64             testDefunctAccessible(aBulletAcc);
    66             gSequence.processNext();
    67           },
    68           0, this.li, this.liNode, this.bullet
    69         );
    70       }
    71     };
    73     function showProcessor()
    74     {
    75       this.liNode = getNode("li");
    77       this.process = function showProcessor_process()
    78       {
    79         this.liNode.style.display = "list-item";
    80       }
    82       this.onProcessed = function showProcessor_onProcessed()
    83       {
    84         testLiAccessibleTree();
    85         SimpleTest.finish();
    86       }
    87     };
    89     ////////////////////////////////////////////////////////////////////////////
    90     // Test
    92     var gSequence = null;
    94     function doTest()
    95     {
    96       testLiAccessibleTree();
    98       gSequence = new sequence();
   100       gSequence.append(new hideProcessor(), EVENT_HIDE, getAccessible("li"),
   101                        "hide HTML li");
   102       gSequence.append(new showProcessor(), EVENT_SHOW, getNode("li"),
   103                        "show HTML li");
   105       gSequence.processNext(); // SimpleTest.finish() will be called in the end
   106     }
   108     SimpleTest.waitForExplicitFinish();
   109     addA11yLoadEvent(doTest);
   110   </script>
   111 </head>
   112 <body>
   114   <a target="_blank"
   115      title="setParent shouldn't be virtual"
   116      href="https://bugzilla.mozilla.org/show_bug.cgi?id=496783">Mozilla Bug 496783</a>
   118   <p id="display"></p>
   119   <div id="content" style="display: none"></div>
   120   <pre id="test">
   121   </pre>
   123   <ul>
   124     <li id="li">item1</li>
   125   </ul>
   126 </body>
   127 </html>

mercurial