diff --git a/mozilla/accessible/src/html/nsHTMLFormControlAccessible.cpp b/mozilla/accessible/src/html/nsHTMLFormControlAccessible.cpp index 8dddc6c0a2b..9450bfacdee 100644 --- a/mozilla/accessible/src/html/nsHTMLFormControlAccessible.cpp +++ b/mozilla/accessible/src/html/nsHTMLFormControlAccessible.cpp @@ -401,6 +401,26 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible::GetRole(PRUint32 *aRole) return NS_OK; } +NS_IMETHODIMP nsHTMLTextFieldAccessible::GetName(nsAString& aName) +{ + nsCOMPtr content = do_QueryInterface(mDOMNode); + if (!content) { + return NS_ERROR_FAILURE; + } + nsresult rv = GetHTMLName(aName, PR_FALSE); + if (NS_FAILED(rv) || !aName.IsEmpty() || !content->GetBindingParent()) { + return rv; + } + + // There's a binding parent. + // This means we're part of another control, so use parent accessible for name. + // This ensures that a textbox inside of a XUL widget gets + // an accessible name. + nsCOMPtr parent; + rv = GetParent(getter_AddRefs(parent)); + return parent ? parent->GetName(aName) : rv; +} + NS_IMETHODIMP nsHTMLTextFieldAccessible::GetValue(nsAString& _retval) { PRUint32 state; diff --git a/mozilla/accessible/src/html/nsHTMLFormControlAccessible.h b/mozilla/accessible/src/html/nsHTMLFormControlAccessible.h index 37d83343700..b8bf679216b 100644 --- a/mozilla/accessible/src/html/nsHTMLFormControlAccessible.h +++ b/mozilla/accessible/src/html/nsHTMLFormControlAccessible.h @@ -109,6 +109,7 @@ public: NS_IMETHOD Init(); NS_IMETHOD Shutdown(); NS_IMETHOD GetRole(PRUint32 *_retval); + NS_IMETHOD GetName(nsAString& aName); NS_IMETHOD GetValue(nsAString& _retval); NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState); NS_IMETHOD GetNumActions(PRUint8 *_retval); diff --git a/mozilla/browser/components/search/content/search.xml b/mozilla/browser/components/search/content/search.xml index b753546dd6c..fb0846afd69 100644 --- a/mozilla/browser/components/search/content/search.xml +++ b/mozilla/browser/components/search/content/search.xml @@ -45,6 +45,8 @@ %searchBarDTD; %globalDTD; + +%browserDTD; ]> - + +