accessible/tests/mochitest/relations/test_bindings.xhtml

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.

michael@0 1 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 2
michael@0 3 <head>
michael@0 4 <title>Accessible relations for bindings</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 <style>
michael@0 10 .button {
michael@0 11 -moz-binding: url('#custombutton');
michael@0 12 }
michael@0 13
michael@0 14 .button2 {
michael@0 15 -moz-binding: url('#custombutton2');
michael@0 16 }
michael@0 17 </style>
michael@0 18
michael@0 19 <bindings xmlns="http://www.mozilla.org/xbl">
michael@0 20 <binding id="custombutton">
michael@0 21 <content aria-labelledby="button.label label">
michael@0 22 <label xmlns="http://www.w3.org/1999/xhtml" anonid="button.label">
michael@0 23 anon label
michael@0 24 </label>
michael@0 25 <button xmlns="http://www.w3.org/1999/xhtml" anonid="button.button"
michael@0 26 aria-labelledby="button.label label">
michael@0 27 a button
michael@0 28 </button>
michael@0 29 <div xmlns="http://www.w3.org/1999/xhtml"
michael@0 30 anonid="button.button2" class="button2"
michael@0 31 aria-labelledby="button.label"></div>
michael@0 32 <div xmlns="http://www.w3.org/1999/xhtml"
michael@0 33 anonid="button.button3" class="button2"></div>
michael@0 34 </content>
michael@0 35 </binding>
michael@0 36 <binding id="custombutton2">
michael@0 37 <content aria-labelledby="button2.label">
michael@0 38 <label xmlns="http://www.w3.org/1999/xhtml" anonid="button2.label">
michael@0 39 nested anon label
michael@0 40 </label>
michael@0 41 </content>
michael@0 42 </binding>
michael@0 43 </bindings>
michael@0 44
michael@0 45 <script type="application/javascript"
michael@0 46 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 47 <script type="application/javascript"
michael@0 48 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
michael@0 49
michael@0 50 <script type="application/javascript"
michael@0 51 src="../common.js"></script>
michael@0 52 <script type="application/javascript"
michael@0 53 src="../relations.js"></script>
michael@0 54
michael@0 55 <script type="application/javascript">
michael@0 56 function doTests()
michael@0 57 {
michael@0 58 var button = document.getElementById("button");
michael@0 59 var anonLabel = document.
michael@0 60 getAnonymousElementByAttribute(button, "anonid", "button.label");
michael@0 61 var anonButton = document.
michael@0 62 getAnonymousElementByAttribute(button, "anonid", "button.button");
michael@0 63 var anonButton2 = document.
michael@0 64 getAnonymousElementByAttribute(button, "anonid", "button.button2");
michael@0 65 var anonButton3 = document.
michael@0 66 getAnonymousElementByAttribute(button, "anonid", "button.button3");
michael@0 67 var anonAnonLabel = document.
michael@0 68 getAnonymousElementByAttribute(anonButton3, "anonid", "button2.label");
michael@0 69
michael@0 70 testRelation("label", RELATION_LABEL_FOR, button);
michael@0 71 testRelation(anonLabel, RELATION_LABEL_FOR, [button, anonButton, anonButton2]);
michael@0 72 testRelation(button, RELATION_LABELLED_BY, [anonLabel, "label"]);
michael@0 73 testRelation(anonButton, RELATION_LABELLED_BY, anonLabel);
michael@0 74 testRelation(anonButton2, RELATION_LABELLED_BY, anonLabel);
michael@0 75 testRelation(anonButton3, RELATION_LABELLED_BY, anonAnonLabel);
michael@0 76 testRelation(anonAnonLabel, RELATION_LABEL_FOR, anonButton3);
michael@0 77
michael@0 78 SimpleTest.finish();
michael@0 79 }
michael@0 80
michael@0 81 SimpleTest.waitForExplicitFinish();
michael@0 82 addA11yLoadEvent(doTests);
michael@0 83 </script>
michael@0 84 </head>
michael@0 85
michael@0 86 <body>
michael@0 87
michael@0 88 <a target="_blank"
michael@0 89 href="https://bugzilla.mozilla.org/show_bug.cgi?id=421242"
michael@0 90 title="Allow relations in anonymous content for binding parent">
michael@0 91 Mozilla Bug 421242
michael@0 92 </a>
michael@0 93
michael@0 94 <p id="display"></p>
michael@0 95 <div id="content" style="display: none"></div>
michael@0 96 <pre id="test">
michael@0 97 </pre>
michael@0 98 <div id="eventdump"></div>
michael@0 99
michael@0 100 <label id="label">explicit label</label>
michael@0 101 <div id="button" class="button"></div>
michael@0 102 </body>
michael@0 103 </html>

mercurial