1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/actions/test_anchors.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,150 @@ 1.4 +<html> 1.5 + 1.6 +<head> 1.7 + <title>nsIAccessible actions testing for HTML links that 1.8 + scroll the page to named anchors</title> 1.9 + 1.10 + <link rel="stylesheet" type="text/css" 1.11 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.12 + 1.13 + <script type="application/javascript" 1.14 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.15 + 1.16 + <script type="application/javascript" 1.17 + src="../common.js"></script> 1.18 + <script type="application/javascript" 1.19 + src="../events.js"></script> 1.20 + <script type="application/javascript" 1.21 + src="../actions.js"></script> 1.22 + 1.23 + <script type="application/javascript"> 1.24 + //////////////////////////////////////////////////////////////////////////// 1.25 + // Event checkers 1.26 + 1.27 + function scrollingChecker(aAcc) 1.28 + { 1.29 + this.type = EVENT_SCROLLING_START; 1.30 + this.target = aAcc; 1.31 + this.getID = function scrollingChecker_getID() 1.32 + { 1.33 + return "scrolling start handling for " + prettyName(aAcc); 1.34 + } 1.35 + } 1.36 + 1.37 + //////////////////////////////////////////////////////////////////////////// 1.38 + // Test 1.39 + 1.40 + // gA11yEventDumpID = "debug"; // debug stuff 1.41 + //gA11yEventDumpToConsole = true; // debug stuff 1.42 + 1.43 + function doTest() 1.44 + { 1.45 + var actionsArray = [ 1.46 + { 1.47 + ID: "anchor1", 1.48 + actionName: "jump", 1.49 + actionIndex: 0, 1.50 + events: CLICK_EVENTS, 1.51 + eventSeq: [ 1.52 + new scrollingChecker(getAccessible("bottom1")) 1.53 + ] 1.54 + }, 1.55 + { // jump again (test for bug 437607) 1.56 + ID: "anchor1", 1.57 + actionName: "jump", 1.58 + actionIndex: 0, 1.59 + events: CLICK_EVENTS, 1.60 + eventSeq: [ 1.61 + new scrollingChecker(getAccessible("bottom1")) 1.62 + ] 1.63 + }, 1.64 + { 1.65 + ID: "anchor2", 1.66 + actionName: "jump", 1.67 + actionIndex: 0, 1.68 + events: CLICK_EVENTS, 1.69 + eventSeq: [ 1.70 + new scrollingChecker(getAccessible("bottom2")) 1.71 + ] 1.72 + } 1.73 + ]; 1.74 + 1.75 + testActions(actionsArray); 1.76 + } 1.77 + 1.78 + SimpleTest.waitForExplicitFinish(); 1.79 + addA11yLoadEvent(doTest); 1.80 + </script> 1.81 +</head> 1.82 + 1.83 +<body> 1.84 + 1.85 + <a target="_blank" 1.86 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=506389" 1.87 + title="Some same page links do not fire EVENT_SYSTEM_SCROLLINGSTART"> 1.88 + Mozilla Bug 506389 1.89 + </a><br> 1.90 + <a target="_blank" 1.91 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=437607" 1.92 + title="Clicking the 'Skip to main content' link once works, second time fails to initiate a V cursor jump"> 1.93 + Mozilla Bug 437607 1.94 + </a><br> 1.95 + <a target="_blank" 1.96 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=519303" 1.97 + title="Same page links to targets with content fires scrolling start accessible event on leaf text node"> 1.98 + Mozilla Bug 519303 1.99 + </a> 1.100 + 1.101 + <p id="display"></p> 1.102 + <div id="content" style="display: none"></div> 1.103 + <pre id="test"> 1.104 + </pre> 1.105 + 1.106 + <div id="debug"></div> 1.107 + 1.108 + <h1>This is a test page for anchors</h1> 1.109 + This is a top anchor<a name="Top"> 1.110 + </a><a id="anchor1" href="#bottom1">Link to anchor</a> 1.111 + <a id="anchor2" href="#bottom2">Link to div</a> 1.112 + <br><br><br><br><br><br><br><br><br><br> 1.113 + <br><br><br><br><br><br><br><br><br><br> 1.114 + <br><br><br><br><br><br><br><br><br><br> 1.115 + <br><br><br><br><br><br><br><br><br><br> 1.116 + <br><br><br><br><br><br><br><br><br><br> 1.117 + <br><br><br><br><br><br><br><br><br><br> 1.118 + <br><br><br><br><br><br><br><br><br><br> 1.119 + <br><br><br><br><br><br><br><br><br><br> 1.120 + <br><br><br><br><br><br><br><br><br><br> 1.121 + <br><br><br><br><br><br><br><br><br><br> 1.122 + <br><br><br><br><br><br><br><br><br><br><br> 1.123 + <br><br><br><br><br><br><br><br><br><br><br> 1.124 + <br><br><br><br><br><br><br><br><br><br> 1.125 + <br><br><br><br><br><br><br><br><br><br> 1.126 + <br><br><br><br><br>This is some text in the middle<br><br><br><br><br> 1.127 + <br><br><br><br><br><br><br><br><br><br> 1.128 + <br><br><br><br><br><br><br><br><br><br> 1.129 + <br><br><br><br><br><br><br><br><br><br> 1.130 + <br><br><br><br><br><br><br><br><br><br> 1.131 + <br><br><br><br><br><br><br><br><br><br> 1.132 + <br><br><br><br><br><br><br><br><br><br> 1.133 + <br><br><br><br><br><br><br><br><br><br> 1.134 + <br><br><br><br><br><br><br><br><br><br> 1.135 + <br><br><br><br><br><br><br><br><br><br> 1.136 + <br><br><br><br><br><br><br><br><br><br> 1.137 + <br><br><br><br><br><br><br><br><br><br> 1.138 + <br><br><br><br><br><br><br><br><br><br> 1.139 + <br><br><br><br><br><br><br><br><br><br> 1.140 + <br><br><br><br><br><br><br><br><br><br> 1.141 + <br><br><br><br><br><br><br><br><br><br> 1.142 + <br><br><br><br><br><br><br><br><br><br> 1.143 + <br><br><br><br><br><br><br><br><br><br> 1.144 + <br><br><br><br><br><br><br><br><br><br> 1.145 + <br><br><br><br><br><br><br><br><br><br> 1.146 + This is some text. 1.147 + This is a bottom anchor<a id="bottom1"></a> 1.148 + <br><br><br><br><br><br><br><br><br><br> 1.149 + <br><br><br><br><br><br><br><br><br><br> 1.150 + <br><br><br><br><br><br><br><br><br><br> 1.151 + <div id="bottom2">This is a div</div> 1.152 +</body> 1.153 +</html>