/** * 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& aValue) { // Use label of currently focused option nsCOMPtr<nsIAccessible> optionAccessible = GetFocusedOptionAccessible(); NS_ENSURE_TRUE(optionAccessible, NS_ERROR_FAILURE); return optionAccessible->GetName(aValue); }
NS_IMETHODIMP nsHTMLComboboxAccessible::GetDescription(nsAString& aDescription) { aDescription.Truncate(); // First check to see if combo box itself has a description, perhaps through // tooltip (title attribute) or via aria-describedby nsAccessible::GetDescription(aDescription); if (!aDescription.IsEmpty()) { return NS_OK; } // Use description of currently focused option nsCOMPtr<nsIAccessible> optionAccessible = GetFocusedOptionAccessible(); return optionAccessible ? optionAccessible->GetDescription(aDescription) : NS_OK; }
/** * 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& aValue) { // Use accessible name of currently focused option. nsAccessible *option = GetFocusedOptionAccessible(); return option ? option->GetName(aValue) : NS_OK; }