Commit aeeb28cd authored by James Teh's avatar James Teh
Browse files

Bug 1628415 part 3: Remove XULListboxAccessible::Value. r=MarcoZ, a=pascalc

This depends on richlistitem's nsIDOMXULSelectControlItemElement::label implementation, which does the wrong thing in several cases.
We could make this use a11y name computation, but I can't find any other list box implementation that exposes accessible value on the list box itself, so I don't see any reason to keep this.

Differential Revision: https://phabricator.services.mozilla.com/D74372
parent 5fade7eb
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -97,27 +97,6 @@ uint64_t XULListboxAccessible::NativeState() const {
  return states;
}

/**
 * Our value is the label of our ( first ) selected child.
 */
void XULListboxAccessible::Value(nsString& aValue) const {
  aValue.Truncate();

  nsCOMPtr<nsIDOMXULSelectControlElement> select = Elm()->AsXULSelectControl();
  if (select) {
    RefPtr<dom::Element> element;
    select->GetSelectedItem(getter_AddRefs(element));

    if (element) {
      nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem =
          element->AsXULSelectControlItem();
      if (selectedItem) {
        selectedItem->GetLabel(aValue);
      }
    }
  }
}

role XULListboxAccessible::NativeRole() const {
  // A richlistbox is used with the new autocomplete URL bar, and has a parent
  // popup <panel>.
+0 −1
Original line number Diff line number Diff line
@@ -76,7 +76,6 @@ class XULListboxAccessible : public XULSelectControlAccessible,
  virtual Accessible* AsAccessible() override { return this; }

  // Accessible
  virtual void Value(nsString& aValue) const override;
  virtual TableAccessible* AsTable() override { return this; }
  virtual a11y::role NativeRole() const override;
  virtual uint64_t NativeState() const override;