accessible/tests/mochitest/events/test_mutation.xhtml

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.

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

mercurial