1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/events/test_mutation.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,97 @@ 1.4 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.5 + 1.6 +<head> 1.7 + <title>Accessible mutation events testing</title> 1.8 + 1.9 + <link rel="stylesheet" type="text/css" 1.10 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.11 + 1.12 + <bindings xmlns="http://www.mozilla.org/xbl" > 1.13 + <binding id="button"> 1.14 + <content> 1.15 + <button xmlns="http://www.w3.org/1999/xhtml">a button</button> 1.16 + </content> 1.17 + </binding> 1.18 + </bindings> 1.19 + 1.20 + <script type="application/javascript" 1.21 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.22 + <script type="application/javascript" 1.23 + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 1.24 + 1.25 + <script type="application/javascript" 1.26 + src="../common.js"></script> 1.27 + <script type="application/javascript" 1.28 + src="../events.js"></script> 1.29 + 1.30 + <script type="application/javascript"> 1.31 + 1.32 + /** 1.33 + * Insert a not accessible bound element containing an accessible element 1.34 + * in anonymous content. 1.35 + */ 1.36 + function insertBinding(aContainerID) 1.37 + { 1.38 + this.containerNode = getNode(aContainerID); 1.39 + 1.40 + function getButtonFromBinding(aNode) 1.41 + { 1.42 + try { return document.getAnonymousNodes(aNode.firstChild)[0]; } 1.43 + catch (e) { return null; } 1.44 + } 1.45 + 1.46 + this.eventSeq = [ 1.47 + new invokerChecker(EVENT_SHOW, getButtonFromBinding, this.containerNode), 1.48 + new invokerChecker(EVENT_REORDER, this.containerNode) 1.49 + ]; 1.50 + 1.51 + this.invoke = function insertBinding_invoke() 1.52 + { 1.53 + var span = document.createElement("span"); 1.54 + span.setAttribute("style", "-moz-binding:url(#button)"); 1.55 + this.containerNode.appendChild(span); 1.56 + } 1.57 + 1.58 + this.getID = function insertBinding_getID() 1.59 + { 1.60 + return "insert button binding"; 1.61 + } 1.62 + } 1.63 + 1.64 + /** 1.65 + * Do tests. 1.66 + */ 1.67 + var gQueue = null; 1.68 + //gA11yEventDumpID = "eventdump"; // debug stuff 1.69 + //gA11yEventDumpToConsole = true; 1.70 + 1.71 + function doTests() 1.72 + { 1.73 + gQueue = new eventQueue(); 1.74 + 1.75 + gQueue.push(new insertBinding("testContainer")); 1.76 + 1.77 + gQueue.invoke(); // Will call SimpleTest.finish(); 1.78 + } 1.79 + 1.80 + SimpleTest.waitForExplicitFinish(); 1.81 + addA11yLoadEvent(doTests); 1.82 + </script> 1.83 +</head> 1.84 + 1.85 +<body> 1.86 + 1.87 + <a target="_blank" 1.88 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=646369" 1.89 + title="UpdateTree should rely on accessible tree walker rather than DOM tree traversal"> 1.90 + Mozilla Bug 646369</a> 1.91 + 1.92 + <p id="display"></p> 1.93 + <div id="content" style="display: none"></div> 1.94 + <pre id="test"> 1.95 + </pre> 1.96 + <div id="eventdump"></div> 1.97 + 1.98 + <div id="testContainer"></div> 1.99 +</body> 1.100 +</html>