Bug 149858 [XBLFC] Active Accessibility: support XBL-based HTML radio

r=aaronl, sr=jst
Add nsIAccessibleProvider in radio.xml, create accessible object for XBL radio button
This commit is contained in:
kyle.yuan%sun.com 2002-06-19 02:00:38 +00:00
Родитель 1016cf5c89
Коммит 02f117ccc1
4 изменённых файлов: 44 добавлений и 0 удалений

Просмотреть файл

@ -50,6 +50,7 @@ interface nsIAccessibilityService : nsISupports
nsIAccessible createHTMLNativeWindowAccessible(in nsIDOMNode aDOMNode, in nsIWeakReference aShell, in PRInt32 aHWnd); nsIAccessible createHTMLNativeWindowAccessible(in nsIDOMNode aDOMNode, in nsIWeakReference aShell, in PRInt32 aHWnd);
nsIAccessible createHTMLPluginAccessible(in nsIDOMNode aDOMNode, in nsIWeakReference aShell); nsIAccessible createHTMLPluginAccessible(in nsIDOMNode aDOMNode, in nsIWeakReference aShell);
nsIAccessible createHTMLRadioButtonAccessible(in nsISupports aFrame); nsIAccessible createHTMLRadioButtonAccessible(in nsISupports aFrame);
nsIAccessible createHTMLRadioButtonAccessibleXBL(in nsIDOMNode aNode);
nsIAccessible createHTMLSelectOptionAccessible(in nsIDOMNode aNode, in nsIAccessible aAccParent, in nsISupports aPresShell); nsIAccessible createHTMLSelectOptionAccessible(in nsIDOMNode aNode, in nsIAccessible aAccParent, in nsISupports aPresShell);
nsIAccessible createHTMLTableAccessible(in nsISupports aFrame); nsIAccessible createHTMLTableAccessible(in nsISupports aFrame);
nsIAccessible createHTMLTableCellAccessible(in nsISupports aFrame); nsIAccessible createHTMLTableCellAccessible(in nsISupports aFrame);

Просмотреть файл

@ -605,6 +605,25 @@ nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsISupports *aFrame, nsI
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLRadioButtonAccessibleXBL(nsIDOMNode *aNode, nsIAccessible **_retval)
{
#ifdef MOZ_XUL
nsCOMPtr<nsIWeakReference> weakShell;
GetShellFromNode(aNode, getter_AddRefs(weakShell));
// reusing the HTML accessible widget and enhancing for XUL
*_retval = new nsHTMLRadioButtonAccessible(aNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
#else
*_retval = nsnull;
#endif // MOZ_XUL
return NS_OK;
}
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLSelectOptionAccessible(nsIDOMNode* aDOMNode, nsIAccessible *aAccParent, nsISupports* aPresContext, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLSelectOptionAccessible(nsIDOMNode* aDOMNode, nsIAccessible *aAccParent, nsISupports* aPresContext, nsIAccessible **_retval)
{ {

Просмотреть файл

@ -46,6 +46,18 @@
<xul:image class="input-radio-check"/> <xul:image class="input-radio-check"/>
</xul:hbox> </xul:hbox>
</content> </content>
<implementation implements="nsIAccessibleProvider">
<property name="accessible">
<getter>
<![CDATA[
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); // Temporary, until bug 104907 is fixed
var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService);
return accService.createHTMLRadioButtonAccessibleXBL(this);
]]>
</getter>
</property>
</implementation>
</binding> </binding>
</bindings> </bindings>

Просмотреть файл

@ -46,6 +46,18 @@
<xul:image class="input-radio-check"/> <xul:image class="input-radio-check"/>
</xul:hbox> </xul:hbox>
</content> </content>
<implementation implements="nsIAccessibleProvider">
<property name="accessible">
<getter>
<![CDATA[
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); // Temporary, until bug 104907 is fixed
var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService);
return accService.createHTMLRadioButtonAccessibleXBL(this);
]]>
</getter>
</property>
</implementation>
</binding> </binding>
</bindings> </bindings>