Bug 942650 - Some toolbars have unknown accessible role or worse, r=tbsaunde Australis

This commit is contained in:
Alexander Surkov 2013-12-05 11:07:53 -05:00
parent 7a701dfeb9
commit 0ff0d981e6
5 changed files with 19 additions and 16 deletions

View File

@ -1006,8 +1006,8 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
}
}
// Elements may implement nsIAccessibleProvider via XBL. This allows them to
// say what kind of accessible to create.
// XBL bindings may use @role attribute to point the accessible type
// they belong to.
newAcc = CreateAccessibleByType(content, document);
// Any XUL box can be used as tabpanel, make sure we create a proper

View File

@ -178,8 +178,7 @@ private:
void Shutdown();
/**
* Create accessible for the element implementing nsIAccessibleProvider
* interface.
* Create accessible for the element having XBL bindings.
*/
already_AddRefed<Accessible>
CreateAccessibleByType(nsIContent* aContent, DocAccessible* aDoc);

View File

@ -75,10 +75,7 @@ public:
/**
* A tabpanel object, child elements of xul:tabpanels element. Note,the object
* is created from nsAccessibilityService::GetAccessibleForDeckChildren()
* method and we do not use nsIAccessibleProvider interface here because
* all children of xul:tabpanels element acts as xul:tabpanel element.
* A tabpanel object, child elements of xul:tabpanels element.
*
* XXX: we need to move the class logic into generic class since
* for example we do not create instance of this class for XUL textbox used as

View File

@ -3,9 +3,17 @@
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<!-- Firefox toolbar -->
<?xml-stylesheet href="chrome://browser/content/browser.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Accessible XUL checkbox and radio hierarchy tests">
<!-- Firefox toolbar -->
<script type="application/javascript"
src="chrome://browser/content/browser.js"/>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
@ -76,6 +84,9 @@
testAccessibleTree("toolbar2", accTree);
if (!SEAMONKEY)
testAccessibleTree("tb_customizable", { TOOLBAR: [] });
SimpleTest.finish()
}
@ -110,6 +121,8 @@
<toolbar id="toolbar2" toolbarname="2nd" aria-label="My second toolbar">
<toolbarbutton id="button2" label="hello"/>
</toolbar>
<toolbar id="tb_customizable" customizable="true"/>
</vbox>
</hbox>

View File

@ -8,19 +8,13 @@
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="toolbar">
<binding id="toolbar" role="xul:toolbar">
<resources>
<stylesheet src="chrome://global/skin/toolbar.css"/>
</resources>
<implementation implements="nsIAccessibleProvider">
<implementation>
<field name="overflowedDuringConstruction">null</field>
<property name="accessibleType" readonly="true">
<getter>
return Components.interfaces.nsIAccessibleProvider.XULToolbar;
</getter>
</property>
<constructor><![CDATA[
let scope = {};
Cu.import("resource:///modules/CustomizableUI.jsm", scope);