accessible/tests/mochitest/treeupdate/test_list_editabledoc.html

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 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3
michael@0 4 <head>
michael@0 5 <title>Test HTML li and listitem bullet accessible insertion into editable document</title>
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 <script type="application/javascript"
michael@0 10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 11
michael@0 12 <script type="application/javascript"
michael@0 13 src="../common.js"></script>
michael@0 14 <script type="application/javascript"
michael@0 15 src="../role.js"></script>
michael@0 16 <script type="application/javascript"
michael@0 17 src="../events.js"></script>
michael@0 18
michael@0 19 <script type="application/javascript">
michael@0 20
michael@0 21 ////////////////////////////////////////////////////////////////////////////
michael@0 22 // Invokers
michael@0 23
michael@0 24 function addLi(aID)
michael@0 25 {
michael@0 26 this.listNode = getNode(aID);
michael@0 27 this.liNode = document.createElement("li");
michael@0 28 this.liNode.textContent = "item";
michael@0 29
michael@0 30 this.eventSeq = [
michael@0 31 new invokerChecker(EVENT_SHOW, getAccessible, this.liNode),
michael@0 32 new invokerChecker(EVENT_REORDER, this.listNode)
michael@0 33 ];
michael@0 34
michael@0 35 this.invoke = function addLi_invoke()
michael@0 36 {
michael@0 37 this.listNode.appendChild(this.liNode);
michael@0 38 }
michael@0 39
michael@0 40 this.finalCheck = function addLi_finalCheck()
michael@0 41 {
michael@0 42 var tree = {
michael@0 43 role: ROLE_LIST,
michael@0 44 children: [
michael@0 45 {
michael@0 46 role: ROLE_LISTITEM,
michael@0 47 children: [
michael@0 48 {
michael@0 49 role: ROLE_STATICTEXT,
michael@0 50 name: "1. ",
michael@0 51 children: []
michael@0 52 },
michael@0 53 {
michael@0 54 role: ROLE_TEXT_LEAF,
michael@0 55 children: []
michael@0 56 }
michael@0 57 ]
michael@0 58 }
michael@0 59 ]
michael@0 60 };
michael@0 61 testAccessibleTree(aID, tree);
michael@0 62 }
michael@0 63
michael@0 64 this.getID = function addLi_getID()
michael@0 65 {
michael@0 66 return "add li";
michael@0 67 }
michael@0 68 };
michael@0 69
michael@0 70 ////////////////////////////////////////////////////////////////////////////
michael@0 71 // Test
michael@0 72
michael@0 73 //gA11yEventDumpID = "eventdump"; // debug stuff
michael@0 74
michael@0 75 var gQueue = null;
michael@0 76
michael@0 77 function doTest()
michael@0 78 {
michael@0 79 gQueue = new eventQueue();
michael@0 80
michael@0 81 gQueue.push(new addLi("list"));
michael@0 82
michael@0 83 gQueue.invoke(); // SimpleTest.finish() will be called in the end
michael@0 84 }
michael@0 85
michael@0 86 SimpleTest.waitForExplicitFinish();
michael@0 87 addA11yLoadEvent(doTest);
michael@0 88 </script>
michael@0 89 </head>
michael@0 90 <body contentEditable="true">
michael@0 91
michael@0 92 <a target="_blank"
michael@0 93 title="Wrong list bullet text of accessible for the first numbered HTML:li in CKEditor"
michael@0 94 href="https://bugzilla.mozilla.org/show_bug.cgi?id=557795">Mozilla Bug 557795</a>
michael@0 95
michael@0 96 <p id="display"></p>
michael@0 97 <div id="content" style="display: none"></div>
michael@0 98 <pre id="test">
michael@0 99 </pre>
michael@0 100
michael@0 101 <ol id="list">
michael@0 102 </ol>
michael@0 103
michael@0 104 <div id="eventdump"></div>
michael@0 105 </body>
michael@0 106 </html>

mercurial