accessible/tests/mochitest/events/test_mutation.xhtml

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <html xmlns="http://www.w3.org/1999/xhtml">
     3 <head>
     4   <title>Accessible mutation events testing</title>
     6   <link rel="stylesheet" type="text/css"
     7         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     9   <bindings xmlns="http://www.mozilla.org/xbl" >
    10     <binding id="button">
    11       <content>
    12         <button xmlns="http://www.w3.org/1999/xhtml">a button</button>
    13       </content>
    14     </binding>
    15   </bindings>
    17   <script type="application/javascript"
    18           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    19   <script type="application/javascript"
    20           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
    22   <script type="application/javascript"
    23           src="../common.js"></script>
    24   <script type="application/javascript"
    25           src="../events.js"></script>
    27   <script type="application/javascript">
    29     /**
    30      * Insert a not accessible bound element containing an accessible element
    31      * in anonymous content.
    32      */
    33     function insertBinding(aContainerID)
    34     {
    35       this.containerNode = getNode(aContainerID);
    37       function getButtonFromBinding(aNode)
    38       {
    39         try { return document.getAnonymousNodes(aNode.firstChild)[0]; }
    40         catch (e) { return null; }
    41       }
    43       this.eventSeq = [
    44         new invokerChecker(EVENT_SHOW, getButtonFromBinding, this.containerNode),
    45         new invokerChecker(EVENT_REORDER, this.containerNode)
    46       ];
    48       this.invoke = function insertBinding_invoke()
    49       {
    50         var span = document.createElement("span");
    51         span.setAttribute("style", "-moz-binding:url(#button)");
    52         this.containerNode.appendChild(span);
    53       }
    55       this.getID = function insertBinding_getID()
    56       {
    57         return "insert button binding";
    58       }
    59     }
    61     /**
    62      * Do tests.
    63      */
    64     var gQueue = null;
    65     //gA11yEventDumpID = "eventdump"; // debug stuff
    66     //gA11yEventDumpToConsole = true;
    68     function doTests()
    69     {
    70       gQueue = new eventQueue();
    72       gQueue.push(new insertBinding("testContainer"));
    74       gQueue.invoke(); // Will call SimpleTest.finish();
    75     }
    77     SimpleTest.waitForExplicitFinish();
    78     addA11yLoadEvent(doTests);
    79   </script>
    80 </head>
    82 <body>
    84   <a target="_blank"
    85      href="https://bugzilla.mozilla.org/show_bug.cgi?id=646369"
    86      title="UpdateTree should rely on accessible tree walker rather than DOM tree traversal">
    87     Mozilla Bug 646369</a>
    89   <p id="display"></p>
    90   <div id="content" style="display: none"></div>
    91   <pre id="test">
    92   </pre>
    93   <div id="eventdump"></div>
    95   <div id="testContainer"></div>
    96 </body>
    97 </html>

mercurial