mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1628415 part 1: Remove use of nsIDOMXULSelectControlItemElement::label in Accessible. r=MarcoZ
This was only used for richlistitems, but the richlistitem implementation of this property did the wrong thing in several cases. The a11y engine's label computation code generally does a better job. Where the label does need to be overridden in specific cases, we should use ARIA instead. Differential Revision: https://phabricator.services.mozilla.com/D74370
This commit is contained in:
parent
52f3956037
commit
ba3de78b7e
@ -757,18 +757,12 @@ void Accessible::XULElmName(DocAccessible* aDocument, nsIContent* aElm,
|
||||
*/
|
||||
|
||||
// CASE #1 (via label attribute) -- great majority of the cases
|
||||
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemEl =
|
||||
aElm->AsElement()->AsXULSelectControlItem();
|
||||
if (itemEl) {
|
||||
itemEl->GetLabel(aName);
|
||||
} else {
|
||||
// Use @label if this is not a select control element, which uses label
|
||||
// attribute to indicate, which option is selected.
|
||||
nsCOMPtr<nsIDOMXULSelectControlElement> select =
|
||||
aElm->AsElement()->AsXULSelectControl();
|
||||
if (!select) {
|
||||
aElm->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
|
||||
}
|
||||
// Only do this if this is not a select control element, which uses label
|
||||
// attribute to indicate, which option is selected.
|
||||
nsCOMPtr<nsIDOMXULSelectControlElement> select =
|
||||
aElm->AsElement()->AsXULSelectControl();
|
||||
if (!select) {
|
||||
aElm->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
|
||||
}
|
||||
|
||||
// CASES #2 and #3 ------ label as a child or <label control="id" ... >
|
||||
|
Loading…
Reference in New Issue
Block a user