Bug 149856 [XBLFC] Active Accessibility: support XBL-based HTML button

r=aaronl, sr=jst
This commit is contained in:
kyle.yuan@sun.com
2002-06-26 01:53:11 +00:00
parent 8e990d215d
commit 39a9d195c7
6 changed files with 64 additions and 2 deletions

View File

@@ -69,6 +69,8 @@
#include "nsINameSpaceManager.h"
#include "nsReflowPath.h"
#include "nsIServiceManager.h"
#include "nsIDOMHTMLButtonElement.h"
#include "nsIDOMHTMLInputElement.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#endif
@@ -188,7 +190,14 @@ NS_IMETHODIMP nsHTMLButtonControlFrame::GetAccessible(nsIAccessible** aAccessibl
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
return accService->CreateHTML4ButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
nsCOMPtr<nsIContent> content;
GetContent(getter_AddRefs(content));
nsCOMPtr<nsIDOMHTMLButtonElement> buttonElement(do_QueryInterface(content));
if (buttonElement) //If turned XBL-base form control off, the frame contains HTML 4 button
return accService->CreateHTML4ButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(content));
if (inputElement) //If turned XBL-base form control on, the frame contains normal HTML button
return accService->CreateHTMLButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
}
return NS_ERROR_FAILURE;