зеркало из https://github.com/mozilla/pjs.git
Bug 302678. Fix accessibility problems with empty richlistbox. r=parente, sr=neil, a=mkaply
This commit is contained in:
Родитель
7627e715bf
Коммит
69e1292de8
|
@ -366,26 +366,16 @@ nsXULSelectableAccessible(aDOMNode, aShell)
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Let Accessible count them up
|
||||
*/
|
||||
NS_IMETHODIMP nsXULListboxAccessible::GetChildCount(PRInt32 *_retval)
|
||||
{
|
||||
return nsAccessible::GetChildCount(_retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* As a nsXULListboxAccessible we can have the following states:
|
||||
* STATE_FOCUSED
|
||||
* STATE_READONLY
|
||||
* STATE_FOCUSABLE
|
||||
*/
|
||||
NS_IMETHODIMP nsXULListboxAccessible::GetState(PRUint32 *_retval)
|
||||
NS_IMETHODIMP nsXULListboxAccessible::GetState(PRUint32 *aState)
|
||||
{
|
||||
// Get focus status from base class
|
||||
nsAccessible::GetState(_retval);
|
||||
|
||||
*_retval |= STATE_FOCUSABLE;
|
||||
nsAccessible::GetState(aState);
|
||||
|
||||
// see if we are multiple select if so set ourselves as such
|
||||
nsCOMPtr<nsIDOMElement> element (do_QueryInterface(mDOMNode));
|
||||
|
@ -393,11 +383,9 @@ NS_IMETHODIMP nsXULListboxAccessible::GetState(PRUint32 *_retval)
|
|||
nsAutoString selType;
|
||||
element->GetAttribute(NS_LITERAL_STRING("seltype"), selType);
|
||||
if (!selType.IsEmpty() && selType.EqualsLiteral("multiple"))
|
||||
*_retval |= STATE_MULTISELECTABLE;
|
||||
*aState |= STATE_MULTISELECTABLE | STATE_EXTSELECTABLE;
|
||||
}
|
||||
|
||||
*_retval |= STATE_FOCUSABLE ;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,6 @@ public:
|
|||
virtual ~nsXULListboxAccessible() {}
|
||||
|
||||
/* ----- nsIAccessible ----- */
|
||||
NS_IMETHOD GetChildCount(PRInt32 *_retval);
|
||||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetValue(nsAString& _retval);
|
||||
|
|
|
@ -45,10 +45,7 @@
|
|||
<binding id="richlistbox">
|
||||
<content>
|
||||
<xul:scrollbox allowevents="true" orient="vertical" anonid="main-box"
|
||||
flex="1" style="overflow: auto;"
|
||||
xmlns:xhtml2="http://www.w3.org/TR/xhtml2"
|
||||
xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#"
|
||||
xhtml2:role="wairole:list">
|
||||
flex="1" style="overflow: auto;">
|
||||
<children />
|
||||
</xul:scrollbox>
|
||||
</content>
|
||||
|
@ -57,7 +54,7 @@
|
|||
<stylesheet src="chrome://global/skin/richlistbox.css"/>
|
||||
</resources>
|
||||
|
||||
<implementation implements="nsIDOMXULSelectControlElement">
|
||||
<implementation implements="nsIAccessibleProvider, nsIDOMXULSelectControlElement">
|
||||
<field name="scrollBoxObject">null</field>
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
|
@ -66,6 +63,15 @@
|
|||
]]>
|
||||
</constructor>
|
||||
|
||||
<property name="accessible">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService);
|
||||
return accService.createXULListboxAccessible(this);
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<property name="children">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
|
|
Загрузка…
Ссылка в новой задаче