2009-11-02 01:02:09 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
2010-02-01 15:48:51 +00:00
|
|
|
|
|
|
|
<!-- Firefox tabbrowser -->
|
|
|
|
<?xml-stylesheet href="chrome://browser/content/browser.css"
|
|
|
|
type="text/css"?>
|
2010-09-09 13:57:25 +00:00
|
|
|
<!-- SeaMonkey tabbrowser -->
|
2010-02-01 15:48:51 +00:00
|
|
|
<?xml-stylesheet href="chrome://navigator/content/navigator.css"
|
|
|
|
type="text/css"?>
|
|
|
|
|
2009-11-02 01:02:09 +00:00
|
|
|
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
|
|
|
type="text/css"?>
|
|
|
|
|
|
|
|
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
2012-01-25 22:43:27 +00:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://browser/content/utilityOverlay.js"/>
|
2009-11-02 01:02:09 +00:00
|
|
|
|
|
|
|
<script type="application/javascript"
|
2010-09-01 22:09:56 +00:00
|
|
|
src="../common.js" />
|
2011-10-08 05:16:37 +00:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="../role.js" />
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="../states.js" />
|
2009-11-02 01:02:09 +00:00
|
|
|
<script type="application/javascript"
|
2010-09-01 22:09:56 +00:00
|
|
|
src="../events.js" />
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/chrome-harness.js"/>
|
2009-11-02 01:02:09 +00:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
<![CDATA[
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
2012-01-06 12:03:17 +00:00
|
|
|
// Hacks to make xul:tabbrowser work
|
2009-11-02 01:02:09 +00:00
|
|
|
|
|
|
|
const Ci = Components.interfaces;
|
2011-10-08 05:16:37 +00:00
|
|
|
const CC = Components.classes;
|
2009-11-02 01:02:09 +00:00
|
|
|
|
2010-03-17 06:36:13 +00:00
|
|
|
Components.utils.import("resource://gre/modules/Services.jsm");
|
|
|
|
|
2010-04-18 18:27:18 +00:00
|
|
|
var handleDroppedLink = null;
|
|
|
|
|
2009-11-02 01:02:09 +00:00
|
|
|
var XULBrowserWindow = {
|
|
|
|
isBusy: false,
|
|
|
|
setOverLink: function (link, b) {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-10-08 05:16:37 +00:00
|
|
|
var gURLBar = {
|
|
|
|
focused: false
|
|
|
|
};
|
|
|
|
|
|
|
|
var gFindBarInitialized = false;
|
|
|
|
|
2012-01-06 12:03:17 +00:00
|
|
|
function goSetCommandEnabled() {}
|
|
|
|
|
2009-11-02 01:02:09 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Tests
|
|
|
|
|
2011-10-08 05:16:37 +00:00
|
|
|
function getTabDocument()
|
|
|
|
{
|
|
|
|
return getNode("tabBrowser").selectedBrowser.contentDocument;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getAnchorJumpInTabDocument()
|
|
|
|
{
|
|
|
|
return getTabDocument().querySelector("a[name='link1']");
|
|
|
|
}
|
|
|
|
|
|
|
|
function loadTab(aTabBrowserID, aURL)
|
|
|
|
{
|
|
|
|
function loadTabChecker()
|
|
|
|
{
|
|
|
|
this.type = EVENT_REORDER;
|
|
|
|
this.match = function loadTabChecker_match(aEvent)
|
|
|
|
{
|
|
|
|
var target = aEvent.accessible;
|
|
|
|
if (target.role == ROLE_INTERNAL_FRAME &&
|
|
|
|
target.parent.parent == getAccessible(getNode(aTabBrowserID).mTabBox.tabpanels)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2009-11-02 01:02:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-08 05:16:37 +00:00
|
|
|
this.eventSeq = [ new loadTabChecker() ];
|
|
|
|
|
|
|
|
this.invoke = function loadTab_invoke()
|
|
|
|
{
|
|
|
|
getNode(aTabBrowserID).loadURI(aURL);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.getID = function loadTab_getID()
|
|
|
|
{
|
|
|
|
return "load tab " + aURL + " for " + prettyName(aTabBrowserID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function advanceFocusIntoTab(aTabBrowserID)
|
2009-11-02 01:02:09 +00:00
|
|
|
{
|
2011-10-08 05:16:37 +00:00
|
|
|
this.eventSeq = [
|
|
|
|
new focusChecker(getTabDocument),
|
|
|
|
new invokerChecker(EVENT_SCROLLING_START, getAnchorJumpInTabDocument)
|
|
|
|
];
|
|
|
|
|
|
|
|
this.invoke = function advanceFocusIntoTab_invoke()
|
|
|
|
{
|
|
|
|
var tabDoc = getAccessible(getTabDocument());
|
|
|
|
tabDoc.takeFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
this.getID = function advanceFocusIntoTab_getID()
|
|
|
|
{
|
|
|
|
return "advance focus into loaded tab";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//gA11yEventDumpToConsole = true; // debug stuff
|
2009-11-02 01:02:09 +00:00
|
|
|
|
2011-10-08 05:16:37 +00:00
|
|
|
var gQueue = null;
|
|
|
|
function doTest()
|
|
|
|
{
|
2010-09-01 22:09:56 +00:00
|
|
|
var rootDir = getRootDirectory(window.location.href);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* When tests are packed in a .jar, we need to extract them so we
|
|
|
|
* can access the specific url with a file:// protocol which appears
|
|
|
|
* to be required by loadURI() (at least a file without an embedded .jar)
|
|
|
|
*/
|
|
|
|
var jar = getJar(rootDir);
|
|
|
|
if (jar) {
|
|
|
|
var tmpdir = extractJarToTmp(jar);
|
2010-10-01 00:10:19 +00:00
|
|
|
rootDir = "file://" + tmpdir.path + '/';
|
2010-09-01 22:09:56 +00:00
|
|
|
}
|
2010-10-01 00:10:19 +00:00
|
|
|
var url = rootDir + "scroll.html#link1";
|
2011-10-08 05:16:37 +00:00
|
|
|
|
|
|
|
gQueue = new eventQueue();
|
|
|
|
gQueue.push(new loadTab("tabBrowser", url));
|
|
|
|
gQueue.push(new advanceFocusIntoTab("tabBrowser"));
|
|
|
|
gQueue.invoke(); // Will call SimpleTest.finish();
|
2009-11-02 01:02:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
addA11yLoadEvent(doTest);
|
|
|
|
]]>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<hbox flex="1" style="overflow: auto;">
|
|
|
|
<body xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=437607"
|
|
|
|
title="Clicking the 'Skip to main content' link once works, second time fails to initiate a V cursor jump">
|
|
|
|
Mozilla Bug 437607
|
|
|
|
</a><br/>
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=519303"
|
|
|
|
title="Same page links to targets with content fires scrolling start accessible event on leaf text node">
|
|
|
|
Mozilla Bug 519303
|
|
|
|
</a>
|
2011-10-08 05:16:37 +00:00
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=691734"
|
|
|
|
title="Make sure scrolling start event is fired when document receive focus">
|
|
|
|
Mozilla Bug 691734
|
|
|
|
</a>
|
2009-11-02 01:02:09 +00:00
|
|
|
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
<vbox flex="1">
|
|
|
|
<!-- Hack to make xul:tabbrowser work -->
|
|
|
|
<menubar>
|
|
|
|
<menu label="menu">
|
|
|
|
<menupopup>
|
|
|
|
<menuitem label="close window hook" id="menu_closeWindow"/>
|
|
|
|
<menuitem label="close hook" id="menu_close"/>
|
|
|
|
</menupopup>
|
|
|
|
</menu>
|
|
|
|
</menubar>
|
2011-10-08 05:16:37 +00:00
|
|
|
<keyset>
|
|
|
|
<key id="key_close"/>
|
|
|
|
</keyset>
|
2009-11-02 01:02:09 +00:00
|
|
|
|
2011-10-08 05:16:37 +00:00
|
|
|
<hbox>
|
2010-03-17 06:36:13 +00:00
|
|
|
<tabs id="tabbrowser-tabs" class="tabbrowser-tabs"
|
|
|
|
tabbrowser="tabBrowser"
|
2011-10-08 05:16:37 +00:00
|
|
|
flex="1">
|
|
|
|
<tab class="tabbrowser-tab" selected="true" label="tab"/>
|
2010-03-17 06:36:13 +00:00
|
|
|
</tabs>
|
2011-10-08 05:16:37 +00:00
|
|
|
</hbox>
|
2010-03-17 06:36:13 +00:00
|
|
|
<tabbrowser id="tabBrowser"
|
|
|
|
type="content-primary"
|
|
|
|
tabcontainer="tabbrowser-tabs"
|
|
|
|
flex="1"/>
|
2009-11-02 01:02:09 +00:00
|
|
|
</vbox>
|
2011-01-17 14:35:32 +00:00
|
|
|
<toolbar id="addon-bar"/>
|
2009-11-02 01:02:09 +00:00
|
|
|
</hbox>
|
|
|
|
|
|
|
|
</window>
|