test_cssoverflow.html (3922B)
1 <html> 2 3 <head> 4 <title>CSS overflow testing</title> 5 6 <link rel="stylesheet" type="text/css" 7 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 8 9 <style> 10 a.link:focus { 11 overflow: scroll; 12 } 13 </style> 14 15 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 16 <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 17 18 <script type="application/javascript" 19 src="../common.js"></script> 20 <script type="application/javascript" 21 src="../events.js"></script> 22 23 <script type="application/javascript"> 24 // ////////////////////////////////////////////////////////////////////////// 25 // Invokers 26 27 function focusAnchor(aID) { 28 this.linkNode = getNode(aID); 29 this.link = getAccessible(this.linkNode); 30 31 this.eventSeq = [ 32 new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode), 33 ]; 34 35 this.invoke = function focusAnchor_invoke() { 36 this.linkNode.focus(); 37 }; 38 39 this.check = function focusAnchor_check(aEvent) { 40 is(this.link, aEvent.accessible, 41 "Focus should be fired against new link accessible!"); 42 }; 43 44 this.getID = function focusAnchor_getID() { 45 return "focus a:focus{overflow:scroll} #1"; 46 }; 47 } 48 49 function tabAnchor(aID) { 50 this.linkNode = getNode(aID); 51 this.link = getAccessible(this.linkNode); 52 53 this.eventSeq = [ 54 new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode), 55 ]; 56 57 this.invoke = function tabAnchor_invoke() { 58 synthesizeKey("VK_TAB", { shiftKey: false }); 59 }; 60 61 this.check = function tabAnchor_check(aEvent) { 62 is(this.link, aEvent.accessible, 63 "Focus should be fired against new link accessible!"); 64 }; 65 66 this.getID = function tabAnchor_getID() { 67 return "focus a:focus{overflow:scroll} #2"; 68 }; 69 } 70 71 // ////////////////////////////////////////////////////////////////////////// 72 // Do tests 73 74 var gQueue = null; 75 // gA11yEventDumpID = "eventdump"; // debug stuff 76 // gA11yEventDumpToConsole = true; 77 78 function doTests() { 79 // Shift+Tab not working, and a test timeout, bug 746977 80 if (MAC) { 81 todo(false, "Shift+tab isn't working on OS X, needs to be disabled until bug 746977 is fixed!"); 82 SimpleTest.finish(); 83 return; 84 } 85 86 gQueue = new eventQueue(); 87 88 // CSS 'overflow: scroll' property setting and unsetting causes accessible 89 // recreation (and fire show/hide events). For example, the focus and 90 // blur of HTML:a with ':focus {overflow: scroll; }' CSS style causes its 91 // accessible recreation. The focus event should be fired on new 92 // accessible. 93 gQueue.push(new focusAnchor("a")); 94 gQueue.push(new tabAnchor("a2")); 95 96 gQueue.invoke(); // Will call SimpleTest.finish(); 97 } 98 99 SimpleTest.waitForExplicitFinish(); 100 addA11yLoadEvent(doTests); 101 </script> 102 </head> 103 104 <body> 105 106 <a target="_blank" 107 href="https://bugzilla.mozilla.org/show_bug.cgi?id=591163" 108 title="mochitest for bug 413777: focus the a:focus {overflow: scroll;} shouldn't recreate HTML a accessible"> 109 Mozilla Bug 591163 110 </a><br> 111 <a target="_blank" 112 title="Rework accessible tree update code" 113 href="https://bugzilla.mozilla.org/show_bug.cgi?id=570275"> 114 Mozilla Bug 570275 115 </a><br> 116 <a target="_blank" 117 title="Text control frames should accept dynamic changes to the CSS overflow property" 118 href="https://bugzilla.mozilla.org/show_bug.cgi?id=686247"> 119 Mozilla Bug 686247 120 </a><br> 121 122 <p id="display"></p> 123 <div id="content" style="display: none"></div> 124 <pre id="test"> 125 </pre> 126 <div id="eventdump"></div> 127 128 <div> 129 <a id="a" class="link" href="www">link</a> 130 </div> 131 <div> 132 <a id="a2" class="link" href="www">link2</a> 133 </div> 134 </body> 135 </html>