Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<html>
<head>
<title>CSS overflow testing</title>
<link rel="stylesheet" type="text/css"
<style>
a.link:focus {
overflow: scroll;
}
</style>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../events.js"></script>
<script type="application/javascript">
// //////////////////////////////////////////////////////////////////////////
// Do tests
async function doTests() {
// Shift+Tab not working, and a test timeout, bug 746977
if (MAC) {
todo(
false,
"Shift+tab isn't working on OS X, needs to be disabled until bug 746977 is fixed!"
);
SimpleTest.finish();
return;
}
// CSS 'overflow: scroll' property setting and unsetting causes accessible
// recreation (and fire show/hide events). For example, the focus and
// blur of HTML:a with ':focus {overflow: scroll; }' CSS style causes its
// accessible recreation. The focus event should be fired on new
// accessible.
const aLinkNode = getNode("a");
const aLink = getAccessible(aLinkNode);
let focused = waitForEvent(EVENT_FOCUS, e => e.DOMNode == aLinkNode);
aLinkNode.focus();
let event = await focused;
is(aLink, event.accessible,
"Focus should be fired against new link accessible!");
const a2LinkNode = getNode("a2");
const a2Link = getAccessible(a2LinkNode);
focused = waitForEvent(EVENT_FOCUS, e => e.DOMNode == a2LinkNode);
synthesizeKey("VK_TAB", { shiftKey: false });
event = await focused;
is(a2Link, event.accessible,
"Focus should be fired against new link accessible!");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTests);
</script>
</head>
<body>
<a target="_blank"
title="mochitest for bug 413777: focus the a:focus {overflow: scroll;} shouldn't recreate HTML a accessible">
Mozilla Bug 591163
</a><br>
<a target="_blank"
title="Rework accessible tree update code"
Mozilla Bug 570275
</a><br>
<a target="_blank"
title="Text control frames should accept dynamic changes to the CSS overflow property"
Mozilla Bug 686247
</a><br>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<div id="eventdump"></div>
<div>
<a id="a" class="link" href="www">link</a>
</div>
<div>
<a id="a2" class="link" href="www">link2</a>
</div>
</body>
</html>