diff --git a/mozilla/accessible/public/nsIAccessibilityService.idl b/mozilla/accessible/public/nsIAccessibilityService.idl index f3b11738e8e..e40f9111939 100644 --- a/mozilla/accessible/public/nsIAccessibilityService.idl +++ b/mozilla/accessible/public/nsIAccessibilityService.idl @@ -42,6 +42,7 @@ interface nsIAccessibilityService : nsISupports nsIAccessible createHTMLBlockAccessible(in nsIDOMNode aNode, in nsISupports aDocument); nsIAccessible createHTMLButtonAccessible(in nsISupports aFrame); nsIAccessible createHTMLCheckboxAccessible(in nsISupports aFrame); + nsIAccessible createHTMLCheckboxAccessibleXBL(in nsIDOMNode aNode); nsIAccessible createHTMLComboboxAccessible(in nsIDOMNode aNode, in nsISupports aPresShell); nsIAccessible createHTMLGroupboxAccessible(in nsISupports aFrame); nsIAccessible createHTMLImageAccessible(in nsISupports aFrame); diff --git a/mozilla/accessible/src/base/nsAccessibilityService.cpp b/mozilla/accessible/src/base/nsAccessibilityService.cpp index e20c3e6a77d..da273826cc0 100644 --- a/mozilla/accessible/src/base/nsAccessibilityService.cpp +++ b/mozilla/accessible/src/base/nsAccessibilityService.cpp @@ -195,6 +195,9 @@ void nsAccessibilityService::GetOwnerFor(nsIPresShell *aPresShell, *aOwnerShell = parentPresShell; NS_ADDREF(*aOwnerShell); } + else { + NS_WARNING("Cannot find content for sub document"); + } } nsresult @@ -460,6 +463,25 @@ nsAccessibilityService::CreateHTMLCheckboxAccessible(nsISupports *aFrame, nsIAcc return NS_OK; } +NS_IMETHODIMP +nsAccessibilityService::CreateHTMLCheckboxAccessibleXBL(nsIDOMNode *aNode, nsIAccessible **_retval) +{ +#ifdef MOZ_XUL + nsCOMPtr weakShell; + GetShellFromNode(aNode, getter_AddRefs(weakShell)); + + // reusing the HTML accessible widget and enhancing for XUL + *_retval = new nsHTMLCheckboxAccessible(aNode, weakShell); + if (! *_retval) + return NS_ERROR_OUT_OF_MEMORY; + + NS_ADDREF(*_retval); +#else + *_retval = nsnull; +#endif // MOZ_XUL + return NS_OK; +} + NS_IMETHODIMP nsAccessibilityService::CreateHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval) { @@ -1280,29 +1302,33 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode, nsCOMPtr newAcc; -#ifdef MOZ_XUL - nsCOMPtr xulElement(do_QueryInterface(aNode)); - if (xulElement) { #ifdef DEBUG_aaronl - // Please leave this in for now, it's a convenient debugging method - nsAutoString name; - aNode->GetLocalName(name); - if (name.Equals(NS_LITERAL_STRING("dropmarker"))) - printf("## aaronl debugging tag name\n"); + // Please leave this in for now, it's a convenient debugging method + nsAutoString name; + aNode->GetLocalName(name); + if (name.Equals(NS_LITERAL_STRING("INPUT"))) + printf("## aaronl debugging tag name\n"); - nsAutoString className; - xulElement->GetAttribute(NS_LITERAL_STRING("class"), className); - if (className.Equals(NS_LITERAL_STRING("toolbarbutton-menubutton-dropmarker"))) + nsAutoString attrib; + nsCOMPtr element(do_QueryInterface(aNode)); + if (element) { + element->GetAttribute(NS_LITERAL_STRING("type"), attrib); + if (attrib.Equals(NS_LITERAL_STRING("checkbox"))) printf("## aaronl debugging attribute\n"); + } #endif - nsCOMPtr accProv(do_QueryInterface(aNode)); - if (accProv) { - accProv->GetAccessible(_retval); - if (*_retval) - return NS_OK; - } + nsCOMPtr accProv(do_QueryInterface(aNode)); + if (accProv) { + accProv->GetAccessible(_retval); + if (*_retval) + return NS_OK; return NS_ERROR_FAILURE; } + +#ifdef MOZ_XUL + nsCOMPtr xulElement(do_QueryInterface(aNode)); + if (xulElement) + return NS_ERROR_FAILURE; #endif // MOZ_XUL // ---- Get the document for this node ---- diff --git a/mozilla/accessible/src/base/nsAccessible.cpp b/mozilla/accessible/src/base/nsAccessible.cpp index eb531283706..703444bc9d8 100644 --- a/mozilla/accessible/src/base/nsAccessible.cpp +++ b/mozilla/accessible/src/base/nsAccessible.cpp @@ -426,7 +426,7 @@ PRBool nsAccessibleTreeWalker::GetAccessible() * Class nsAccessible */ -//-------------------------`---------------------------- +//----------------------------------------------------- // construction //----------------------------------------------------- nsAccessible::nsAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell): mDOMNode(aNode), mPresShell(aShell), mSiblingIndex(eSiblingsUninitialized) diff --git a/mozilla/layout/forms/resources/content/checkbox.xml b/mozilla/layout/forms/resources/content/checkbox.xml index f2481fc4bde..a61a07fc29e 100644 --- a/mozilla/layout/forms/resources/content/checkbox.xml +++ b/mozilla/layout/forms/resources/content/checkbox.xml @@ -40,7 +40,20 @@ xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - + + + + + + + + + + diff --git a/mozilla/layout/html/forms/resources/content/checkbox.xml b/mozilla/layout/html/forms/resources/content/checkbox.xml index f2481fc4bde..a61a07fc29e 100644 --- a/mozilla/layout/html/forms/resources/content/checkbox.xml +++ b/mozilla/layout/html/forms/resources/content/checkbox.xml @@ -40,7 +40,20 @@ xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - + + + + + + + + + +