1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/tree/test_cssoverflow.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,146 @@ 1.4 +<html> 1.5 + 1.6 +<head> 1.7 + <title>CSS overflow testing</title> 1.8 + 1.9 + <link rel="stylesheet" type="text/css" 1.10 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.11 + 1.12 + <style> 1.13 + a.link:focus { 1.14 + overflow: scroll; 1.15 + } 1.16 + </style> 1.17 + 1.18 + <script type="application/javascript" 1.19 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.20 + <script type="application/javascript" 1.21 + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 1.22 + 1.23 + <script type="application/javascript" 1.24 + src="../common.js"></script> 1.25 + <script type="application/javascript" 1.26 + src="../events.js"></script> 1.27 + 1.28 + <script type="application/javascript"> 1.29 + //////////////////////////////////////////////////////////////////////////// 1.30 + // Invokers 1.31 + 1.32 + function focusAnchor(aID) 1.33 + { 1.34 + this.linkNode = getNode(aID); 1.35 + this.link = getAccessible(this.linkNode); 1.36 + 1.37 + this.eventSeq = [ 1.38 + new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode) 1.39 + ]; 1.40 + 1.41 + this.invoke = function focusAnchor_invoke() 1.42 + { 1.43 + this.linkNode.focus(); 1.44 + } 1.45 + 1.46 + this.check = function focusAnchor_check(aEvent) 1.47 + { 1.48 + todo_is(this.link, aEvent.accessible, 1.49 + "Focus should be fired against new link accessible!"); 1.50 + } 1.51 + 1.52 + this.getID = function focusAnchor_getID() 1.53 + { 1.54 + return "focus a:focus{overflow:scroll} #1"; 1.55 + } 1.56 + } 1.57 + 1.58 + function tabAnchor(aID) 1.59 + { 1.60 + this.linkNode = getNode(aID); 1.61 + this.link = getAccessible(this.linkNode); 1.62 + 1.63 + this.eventSeq = [ 1.64 + new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode) 1.65 + ]; 1.66 + 1.67 + this.invoke = function tabAnchor_invoke() 1.68 + { 1.69 + synthesizeKey("VK_TAB", { shiftKey: false }); 1.70 + } 1.71 + 1.72 + this.check = function tabAnchor_check(aEvent) 1.73 + { 1.74 + todo_is(this.link, aEvent.accessible, 1.75 + "Focus should be fired against new link accessible!"); 1.76 + } 1.77 + 1.78 + this.getID = function tabAnchor_getID() 1.79 + { 1.80 + return "focus a:focus{overflow:scroll} #2"; 1.81 + } 1.82 + } 1.83 + 1.84 + //////////////////////////////////////////////////////////////////////////// 1.85 + // Do tests 1.86 + 1.87 + var gQueue = null; 1.88 + //gA11yEventDumpID = "eventdump"; // debug stuff 1.89 + //gA11yEventDumpToConsole = true; 1.90 + 1.91 + function doTests() 1.92 + { 1.93 + // Shift+Tab not working, and a test timeout, bug 746977 1.94 + if (MAC) { 1.95 + todo(false, "Shift+tab isn't working on OS X, needs to be disabled until bug 746977 is fixed!"); 1.96 + SimpleTest.finish(); 1.97 + return; 1.98 + } 1.99 + 1.100 + gQueue = new eventQueue(); 1.101 + 1.102 + // CSS 'overflow: scroll' property setting and unsetting causes accessible 1.103 + // recreation (and fire show/hide events). For example, the focus and 1.104 + // blur of HTML:a with ':focus {overflow: scroll; }' CSS style causes its 1.105 + // accessible recreation. The focus event should be fired on new 1.106 + // accessible. 1.107 + gQueue.push(new focusAnchor("a")); 1.108 + gQueue.push(new tabAnchor("a2")); 1.109 + 1.110 + gQueue.invoke(); // Will call SimpleTest.finish(); 1.111 + } 1.112 + 1.113 + SimpleTest.waitForExplicitFinish(); 1.114 + addA11yLoadEvent(doTests); 1.115 + </script> 1.116 +</head> 1.117 + 1.118 +<body> 1.119 + 1.120 + <a target="_blank" 1.121 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=591163" 1.122 + title="mochitest for bug 413777: focus the a:focus {overflow: scroll;} shouldn't recreate HTML a accessible"> 1.123 + Mozilla Bug 591163 1.124 + </a><br> 1.125 + <a target="_blank" 1.126 + title="Rework accessible tree update code" 1.127 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=570275"> 1.128 + Mozilla Bug 570275 1.129 + </a><br> 1.130 + <a target="_blank" 1.131 + title="Text control frames should accept dynamic changes to the CSS overflow property" 1.132 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=686247"> 1.133 + Mozilla Bug 686247 1.134 + </a><br> 1.135 + 1.136 + <p id="display"></p> 1.137 + <div id="content" style="display: none"></div> 1.138 + <pre id="test"> 1.139 + </pre> 1.140 + <div id="eventdump"></div> 1.141 + 1.142 + <div> 1.143 + <a id="a" class="link" href="www">link</a> 1.144 + </div> 1.145 + <div> 1.146 + <a id="a2" class="link" href="www">link2</a> 1.147 + </div> 1.148 +</body> 1.149 +</html>