accessible/tests/mochitest/actions/test_anchors.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <html>
michael@0 2
michael@0 3 <head>
michael@0 4 <title>nsIAccessible actions testing for HTML links that
michael@0 5 scroll the page to named anchors</title>
michael@0 6
michael@0 7 <link rel="stylesheet" type="text/css"
michael@0 8 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 9
michael@0 10 <script type="application/javascript"
michael@0 11 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 12
michael@0 13 <script type="application/javascript"
michael@0 14 src="../common.js"></script>
michael@0 15 <script type="application/javascript"
michael@0 16 src="../events.js"></script>
michael@0 17 <script type="application/javascript"
michael@0 18 src="../actions.js"></script>
michael@0 19
michael@0 20 <script type="application/javascript">
michael@0 21 ////////////////////////////////////////////////////////////////////////////
michael@0 22 // Event checkers
michael@0 23
michael@0 24 function scrollingChecker(aAcc)
michael@0 25 {
michael@0 26 this.type = EVENT_SCROLLING_START;
michael@0 27 this.target = aAcc;
michael@0 28 this.getID = function scrollingChecker_getID()
michael@0 29 {
michael@0 30 return "scrolling start handling for " + prettyName(aAcc);
michael@0 31 }
michael@0 32 }
michael@0 33
michael@0 34 ////////////////////////////////////////////////////////////////////////////
michael@0 35 // Test
michael@0 36
michael@0 37 // gA11yEventDumpID = "debug"; // debug stuff
michael@0 38 //gA11yEventDumpToConsole = true; // debug stuff
michael@0 39
michael@0 40 function doTest()
michael@0 41 {
michael@0 42 var actionsArray = [
michael@0 43 {
michael@0 44 ID: "anchor1",
michael@0 45 actionName: "jump",
michael@0 46 actionIndex: 0,
michael@0 47 events: CLICK_EVENTS,
michael@0 48 eventSeq: [
michael@0 49 new scrollingChecker(getAccessible("bottom1"))
michael@0 50 ]
michael@0 51 },
michael@0 52 { // jump again (test for bug 437607)
michael@0 53 ID: "anchor1",
michael@0 54 actionName: "jump",
michael@0 55 actionIndex: 0,
michael@0 56 events: CLICK_EVENTS,
michael@0 57 eventSeq: [
michael@0 58 new scrollingChecker(getAccessible("bottom1"))
michael@0 59 ]
michael@0 60 },
michael@0 61 {
michael@0 62 ID: "anchor2",
michael@0 63 actionName: "jump",
michael@0 64 actionIndex: 0,
michael@0 65 events: CLICK_EVENTS,
michael@0 66 eventSeq: [
michael@0 67 new scrollingChecker(getAccessible("bottom2"))
michael@0 68 ]
michael@0 69 }
michael@0 70 ];
michael@0 71
michael@0 72 testActions(actionsArray);
michael@0 73 }
michael@0 74
michael@0 75 SimpleTest.waitForExplicitFinish();
michael@0 76 addA11yLoadEvent(doTest);
michael@0 77 </script>
michael@0 78 </head>
michael@0 79
michael@0 80 <body>
michael@0 81
michael@0 82 <a target="_blank"
michael@0 83 href="https://bugzilla.mozilla.org/show_bug.cgi?id=506389"
michael@0 84 title="Some same page links do not fire EVENT_SYSTEM_SCROLLINGSTART">
michael@0 85 Mozilla Bug 506389
michael@0 86 </a><br>
michael@0 87 <a target="_blank"
michael@0 88 href="https://bugzilla.mozilla.org/show_bug.cgi?id=437607"
michael@0 89 title="Clicking the 'Skip to main content' link once works, second time fails to initiate a V cursor jump">
michael@0 90 Mozilla Bug 437607
michael@0 91 </a><br>
michael@0 92 <a target="_blank"
michael@0 93 href="https://bugzilla.mozilla.org/show_bug.cgi?id=519303"
michael@0 94 title="Same page links to targets with content fires scrolling start accessible event on leaf text node">
michael@0 95 Mozilla Bug 519303
michael@0 96 </a>
michael@0 97
michael@0 98 <p id="display"></p>
michael@0 99 <div id="content" style="display: none"></div>
michael@0 100 <pre id="test">
michael@0 101 </pre>
michael@0 102
michael@0 103 <div id="debug"></div>
michael@0 104
michael@0 105 <h1>This is a test page for anchors</h1>
michael@0 106 This is a top anchor<a name="Top">
michael@0 107 </a><a id="anchor1" href="#bottom1">Link to anchor</a>
michael@0 108 <a id="anchor2" href="#bottom2">Link to div</a>
michael@0 109 <br><br><br><br><br><br><br><br><br><br>
michael@0 110 <br><br><br><br><br><br><br><br><br><br>
michael@0 111 <br><br><br><br><br><br><br><br><br><br>
michael@0 112 <br><br><br><br><br><br><br><br><br><br>
michael@0 113 <br><br><br><br><br><br><br><br><br><br>
michael@0 114 <br><br><br><br><br><br><br><br><br><br>
michael@0 115 <br><br><br><br><br><br><br><br><br><br>
michael@0 116 <br><br><br><br><br><br><br><br><br><br>
michael@0 117 <br><br><br><br><br><br><br><br><br><br>
michael@0 118 <br><br><br><br><br><br><br><br><br><br>
michael@0 119 <br><br><br><br><br><br><br><br><br><br><br>
michael@0 120 <br><br><br><br><br><br><br><br><br><br><br>
michael@0 121 <br><br><br><br><br><br><br><br><br><br>
michael@0 122 <br><br><br><br><br><br><br><br><br><br>
michael@0 123 <br><br><br><br><br>This is some text in the middle<br><br><br><br><br>
michael@0 124 <br><br><br><br><br><br><br><br><br><br>
michael@0 125 <br><br><br><br><br><br><br><br><br><br>
michael@0 126 <br><br><br><br><br><br><br><br><br><br>
michael@0 127 <br><br><br><br><br><br><br><br><br><br>
michael@0 128 <br><br><br><br><br><br><br><br><br><br>
michael@0 129 <br><br><br><br><br><br><br><br><br><br>
michael@0 130 <br><br><br><br><br><br><br><br><br><br>
michael@0 131 <br><br><br><br><br><br><br><br><br><br>
michael@0 132 <br><br><br><br><br><br><br><br><br><br>
michael@0 133 <br><br><br><br><br><br><br><br><br><br>
michael@0 134 <br><br><br><br><br><br><br><br><br><br>
michael@0 135 <br><br><br><br><br><br><br><br><br><br>
michael@0 136 <br><br><br><br><br><br><br><br><br><br>
michael@0 137 <br><br><br><br><br><br><br><br><br><br>
michael@0 138 <br><br><br><br><br><br><br><br><br><br>
michael@0 139 <br><br><br><br><br><br><br><br><br><br>
michael@0 140 <br><br><br><br><br><br><br><br><br><br>
michael@0 141 <br><br><br><br><br><br><br><br><br><br>
michael@0 142 <br><br><br><br><br><br><br><br><br><br>
michael@0 143 This is some text.
michael@0 144 This is a bottom anchor<a id="bottom1"></a>
michael@0 145 <br><br><br><br><br><br><br><br><br><br>
michael@0 146 <br><br><br><br><br><br><br><br><br><br>
michael@0 147 <br><br><br><br><br><br><br><br><br><br>
michael@0 148 <div id="bottom2">This is a div</div>
michael@0 149 </body>
michael@0 150 </html>

mercurial