2009-11-08 10:36:02 -08:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<title>Accessible document focus event testing</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" type="text/css"
|
|
|
|
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
2011-09-27 18:46:11 -07:00
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
|
|
|
|
2009-11-08 10:36:02 -08:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../common.js"></script>
|
2009-11-08 10:36:02 -08:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../events.js"></script>
|
2012-04-04 15:07:49 -07:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="../role.js"></script>
|
2009-11-08 10:36:02 -08:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../states.js"></script>
|
2009-11-08 10:36:02 -08:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
2013-02-26 22:23:08 -08:00
|
|
|
if (navigator.platform.startsWith("Win")) {
|
2013-02-25 18:39:21 -08:00
|
|
|
SimpleTest.expectAssertions(0, 1);
|
|
|
|
}
|
|
|
|
|
2009-11-08 10:36:02 -08:00
|
|
|
var gQueue = null;
|
|
|
|
|
|
|
|
//var gA11yEventDumpID = "eventdump";
|
2011-09-27 18:46:11 -07:00
|
|
|
//gA11yEventDumpToConsole = true;
|
2009-11-08 10:36:02 -08:00
|
|
|
|
|
|
|
function doTests()
|
|
|
|
{
|
|
|
|
// setup
|
|
|
|
var frameDoc = document.getElementById("iframe").contentDocument;
|
|
|
|
frameDoc.designMode = "on";
|
|
|
|
var frameDocAcc = getAccessible(frameDoc, [nsIAccessibleDocument]);
|
|
|
|
var buttonAcc = getAccessible("b1");
|
|
|
|
|
2011-09-27 18:46:11 -07:00
|
|
|
var frame2Doc = document.getElementById("iframe2").contentDocument;
|
|
|
|
var frame2Input = frame2Doc.getElementById("input");
|
|
|
|
var frame2DocAcc = getAccessible(frame2Doc);
|
|
|
|
var frame2InputAcc = getAccessible(frame2Input);
|
|
|
|
|
2009-11-08 10:36:02 -08:00
|
|
|
// Test focus events.
|
2011-09-27 18:46:11 -07:00
|
|
|
gQueue = new eventQueue();
|
2009-11-08 10:36:02 -08:00
|
|
|
|
|
|
|
// try to give focus to contentEditable frame twice to cover bug 512059
|
2011-09-27 18:46:11 -07:00
|
|
|
gQueue.push(new synthFocus(buttonAcc));
|
|
|
|
gQueue.push(new synthTab(frameDocAcc, new focusChecker(frameDocAcc)));
|
|
|
|
gQueue.push(new synthFocus(buttonAcc));
|
|
|
|
gQueue.push(new synthTab(frameDocAcc, new focusChecker(frameDocAcc)));
|
|
|
|
|
|
|
|
// focus on not editable document
|
|
|
|
gQueue.push(new synthFocus(frame2InputAcc));
|
|
|
|
gQueue.push(new synthShiftTab(frame2DocAcc, new focusChecker(frame2DocAcc)));
|
2009-11-08 10:36:02 -08:00
|
|
|
|
|
|
|
gQueue.invoke(); // Will call SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
addA11yLoadEvent(doTests);
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=512058"
|
|
|
|
title="Can't set focus to designMode document via accessibility APIs">
|
|
|
|
Mozilla Bug 512058
|
|
|
|
</a>
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=512059"
|
|
|
|
title="Accessibility focus event never fired for designMode document after the first focus">
|
|
|
|
Mozilla Bug 512059
|
|
|
|
</a>
|
2011-09-27 18:46:11 -07:00
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=618046"
|
|
|
|
title="No focus change event when Shift+Tab at top of screen">
|
|
|
|
Mozilla Bug 618046
|
|
|
|
</a>
|
2009-11-08 10:36:02 -08:00
|
|
|
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<div id="eventdump"></div>
|
|
|
|
|
|
|
|
<div id="testContainer">
|
|
|
|
<button id="b1">a button</button>
|
|
|
|
<iframe id="iframe" src="about:blank"></iframe>
|
|
|
|
<button id="b2">a button</button>
|
2011-09-27 18:46:11 -07:00
|
|
|
<iframe id="iframe2" src="data:text/html,<html><input id='input'></html>"></iframe>
|
2009-11-08 10:36:02 -08:00
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|