Skip to content
Snippets Groups Projects
Commit a2995a42 authored by aaronleventhal@moonset.net's avatar aaronleventhal@moonset.net
Browse files

Bug 384229. No accessible name for location and search fields. r=ginn.chen, r=mano

parent f4030a0e
No related branches found
No related tags found
No related merge requests found
......@@ -401,6 +401,26 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetName(nsAString& aName)
{
nsCOMPtr<nsIContent> 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<nsIAccessible> parent;
rv = GetParent(getter_AddRefs(parent));
return parent ? parent->GetName(aName) : rv;
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetValue(nsAString& _retval)
{
PRUint32 state;
......
......@@ -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);
......
......@@ -45,6 +45,8 @@
%searchBarDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
<bindings id="SearchBindings"
......@@ -548,7 +550,7 @@
<binding id="searchbar-textbox"
extends="chrome://global/content/bindings/autocomplete.xml#autocomplete">
<implementation implements="nsIObserver">
<implementation implements="nsIObserver nsIDOMXULLabeledControlElement">
<constructor><![CDATA[
if (this._getParentSearchbar().parentNode.parentNode.localName ==
"toolbarpaletteitem")
......@@ -568,6 +570,9 @@
} catch (ex) { }
]]></destructor>
<property name="label" readonly="true"
onget="return '&searchItem.title; ' +
this._getParentSearchbar().currentEngine.name;"/>
<field name="_stringBundle"/>
<field name="_formHistSvc"/>
<field name="_prefBranch"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment