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

r=aaronl, sr=jst


git-svn-id: svn://10.0.0.236/trunk@124064 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kyle.yuan%sun.com
2002-06-26 01:53:11 +00:00
parent 91708c91f6
commit 418bf748bc
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;