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