mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Bug 260823. Report correct accessible value for HTML comboboxes. r=pkw, sr=bryner
This commit is contained in:
parent
fd88f0a648
commit
c48a2a1a00
@ -965,17 +965,16 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetFirstChild(nsIAccessible **aFirstChil
|
||||
}
|
||||
|
||||
/**
|
||||
* Our value is the value of our ( first ) selected child. nsIDOMHTMLSelectElement
|
||||
* returns this by default with GetValue().
|
||||
* MSAA/ATK accessible value != HTML value, especially not in combo boxes.
|
||||
* Our accessible value is the text label for of our ( first ) selected child.
|
||||
* The easiest way to get this is from the first child which is the readonly textfield.
|
||||
*/
|
||||
NS_IMETHODIMP nsHTMLComboboxAccessible::GetValue(nsAString& _retval)
|
||||
NS_IMETHODIMP nsHTMLComboboxAccessible::GetValue(nsAString& aValue)
|
||||
{
|
||||
nsCOMPtr<nsIDOMHTMLSelectElement> select (do_QueryInterface(mDOMNode));
|
||||
if (select) {
|
||||
select->GetValue(_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIAccessible> textFieldAccessible;
|
||||
nsresult rv = GetFirstChild(getter_AddRefs(textFieldAccessible));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
return textFieldAccessible->GetValue(aValue);
|
||||
}
|
||||
|
||||
/** ----- nsHTMLComboboxTextFieldAccessible ----- */
|
||||
|
Loading…
Reference in New Issue
Block a user