Closed Bug 2091657 Opened 19 days ago Closed 13 days ago

Regression: Linux ATs can no longer obtain value of collapsed select element

Categories

(Core :: Disability Access APIs, defect)

Unspecified
Linux
defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr153 --- unaffected
firefox160 --- unaffected
firefox161 --- unaffected
firefox162 --- fixed

People

(Reporter: jdiggs, Assigned: Jamie)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Steps to reproduce:

  1. Load this snippet in Nightly:
<label for="fruit">Fruit</label>
<select id="fruit">
  <option>Apple</option>
  <option selected="selected">Banana</option>
  <option>Cherry</option>
</select>
  1. Run the attached new-combo.py in a terminal.
  2. Up/Down arrow to change the selected option without expanding it.

Expected results: There would be an appropriate event and a means to obtain the value.

Actual results:

  • Each time the selected option changes, there's an object:state-changed:focusable event. (There's also an object:state-changed:defunct event, but I'm filtering those out.) That doesn't suggest that the selection/value changed.
  • I'm not seeing any way to get the new value via AT-SPI.

Sample output:

# I gave the select element focus
object:state-changed:focused (1,0,0) on combo box 'Fruit'
interfaces: ['Accessible', 'Action', 'Collection', 'Component', 'Hyperlink']
attributes: {'explicit-name': 'true', 'tag': 'select', 'display': 'inline-block', 'id': 'fruit'}
child count: 0
labelled-by: label 'Fruit'

# Arrowed
object:state-changed:focusable (1,0,0) on combo box 'Fruit'
interfaces: ['Accessible', 'Action', 'Collection', 'Component', 'Hyperlink']
attributes: {'explicit-name': 'true', 'tag': 'select', 'display': 'inline-block', 'id': 'fruit'}
child count: 0
labelled-by: label 'Fruit'

# Arrowed
object:state-changed:focusable (1,0,0) on combo box 'Fruit'
interfaces: ['Accessible', 'Action', 'Collection', 'Component', 'Hyperlink']
attributes: {'explicit-name': 'true', 'tag': 'select', 'display': 'inline-block', 'id': 'fruit'}
child count: 0
labelled-by: label 'Fruit'

# Arrowed
object:state-changed:focusable (1,0,0) on combo box 'Fruit'
interfaces: ['Accessible', 'Action', 'Collection', 'Component', 'Hyperlink']
attributes: {'explicit-name': 'true', 'tag': 'select', 'display': 'inline-block', 'id': 'fruit'}
child count: 0

Notes:

This seems to have regressed as a result of the change done in bug 2050939.

As I asked there, I'm curious how NVDA gets the value now (and don't have a Windows machine to find out).

Orca already tries several things to get the value:

  1. Checks the object attributes for valuetext. (Even though comboboxes don't -- and probably shouldn't -- implement AtspiValue, this change was made awhile back for Chromium.)
  2. If the combobox lacks a child it tries to obtain the text via AtspiText. (It also has a fallback on the accessible name, which was done for some native combo box and is clearly a problem now that Gecko select elements lack children. I'll change the name fallback.)
  3. Otherwise it tries to get the selected child, which of course no longer works.

I'm willing to try other things if you have other, better suggestions.

Flags: needinfo?(eitan)

Set release status flags based on info from the regressing bug 2050939

Damn it, I forgot combo boxes don't support value in ATK. 🤦‍♂️

(In reply to Joanmarie Diggs from comment #0)

As I asked there, I'm curious how NVDA gets the value now (and don't have a Windows machine to find out).

Combo boxes do support value text on Windows (IAccessible::accValue, UIA Value pattern).

  1. Checks the object attributes for valuetext. (Even though comboboxes don't -- and probably shouldn't -- implement AtspiValue, this change was made awhile back for Chromium.)

That's bug 1732284. Would fixing that "fix" this problem?

You mentioned that this was necessary for Chromium. Does Chromium expose the children of collapsed combo boxes via ATK?

  1. If the combobox lacks a child it tries to obtain the text via AtspiText.

I guess we might be able to fudge that for ATK? It feels kinda wrong though.

I'm willing to try other things if you have other, better suggestions.

I guess the question is: what is correct for ATK? Based on what you're saying, it seems like collapsed native combo boxes do expose children? Even if we reverted bug 2050939, this still won't work so well for ARIA comboboxes, since the listbox isn't going to be in the tree in that case.

Severity: -- → S2

(In reply to James Teh [:Jamie] from comment #2)

Damn it, I forgot combo boxes don't support value in ATK. 🤦‍♂️

Thank Sun Microsystems I guess.

That's bug 1732284. Would fixing that "fix" this problem?

Heh. Seems I forgot something as well. 😀 And yes, that would indeed "fix" this problem -- in terms of getting the value. There's still the question of the event needed to notify ATs when the selected item / value changes. On the one hand it would be would be odd for something that doesn't implement AtkValue to fire object:property-change:accessible-value. On the other hand, I don't think anything prevents it. And Orca's already handling that condition, so maybe that is the thing to fudge?

You mentioned that this was necessary for Chromium. Does Chromium expose the children of collapsed combo boxes via ATK?

Chromium does indeed. Though maybe one day that will change, in which case it should also expose the current item via valuetext. I'll take a look at exposing valuetext and firing the value-changed event on a non-value-implementing object in Chromium. I'll try to get to that today and report back.

To be honest, I no longer remember the exact reasoning. But reading the Gecko bug I filed and forgot about, I now have vague recollections that Aaron and I discussed it, shrugged, and came up with "make it an object attribute." It was probably for ARIA because I'm not seeing it exposed on native collapsed select elements.

  1. If the combobox lacks a child it tries to obtain the text via AtspiText.
    I guess we might be able to fudge that for ATK? It feels kinda wrong though.

If it feels more wrong than the previous option (valuetext + value-changed), don't do it. Basically I was tossing out options of things you could do that would fix this so you could choose the least bad one for Gecko.

I'm willing to try other things if you have other, better suggestions.

I guess the question is: what is correct for ATK? Based on what you're saying, it seems like collapsed native combo boxes do expose children? Even if we reverted bug 2050939, this still won't work so well for ARIA comboboxes, since the listbox isn't going to be in the tree in that case.

For the record, I'm not asking you to revert it. But, yeah, until ARIA came along, combo boxes in Linux have always had children AFAIK.

What's correct for ATK is a good question. Possibly an addition to ATK and AT-SPI so that ATs can ask for an object's current.... (looking for a word other than value and failing). But that would take time. The object attribute works today. And Orca's been supporting it for around five years now because ARIA and Chromium. So if you're willing to give valuetext + value-changed a try, I think that's the easiest solution and the solution that is best for the users (i.e. because in theory they would never notice the Gecko change, even if they didn't upgrade their version of Orca).

(In reply to Joanmarie Diggs from comment #3)

There's still the question of the event needed to notify ATs when the selected item / value changes. On the one hand it would be would be odd for something that doesn't implement AtkValue to fire object:property-change:accessible-value. On the other hand, I don't think anything prevents it.

Dbus doesn't like it when we fire certain signals on an object which doesn't support the relevant interface; e.g. we get stderr complaints if we accidentally fire text events on a non-text object (entirely theoretical you understand, I'm not speaking from experience, not at all 😉). I'm wondering if we're going to hit that problem here.

But this does raise the question: how is this working in Chromium for ARIA comboboxes?

Flags: needinfo?(jdiggs)

So from my initial investigation, I've discovered several things about the Chromium situation:

  1. Turns out there is exactly one Chromium internal role related to combo boxes which supports valuetext. The internal role for a collapsed native select element has a different internal role. The internal role assigned to ARIA combo boxes depends on the authoring. But it looks like only focusable combo boxes which lack a text input expose it. Not sure if that was intentional or not. But I think it probably makes sense. See next item.

  2. From testing various ARIA combo boxes with Chromium, Orca presented most of them: if there is a popup, that popup fires accessibility events as the active descendant / selected item changes. If there is an input with no popup, but the text content changes when you up/down arrow, there are text-changed events which Orca presents. I had to create a focusable div with a combobox role whose text content changed when arrowing to achieve no presentation. (And I've locally fixed that in Chromium without any need to change Orca.)

  3. The platform-agnostic accessibility code in Chromium does emit value-changed events for collapsed native select elements, even though they have children. The ATK implementation returns early on objects where range-value is not supported. HOWEVER I locally just tried firing it on a native select and it worked. Ditto for my silly focusable div combo box. I'm not seeing any console spew or errors. It appears that the ATK bridge doesn't care. It appears it also trashes the value, even in the case of range-supporting widgets. See https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/main/atk-adaptor/event.c?ref_type=heads#L718-722

  else
    {
      emit_event (accessible, ITF_EVENT_OBJECT, PCHANGE, pname, 0, 0,
                  DBUS_TYPE_INT32_AS_STRING, 0, append_basic);
    }

That's the end of property_event_listener() which handles a bunch of event types, but does nothing special for accessible-value.

N.B. AtkValue does have it's own value-changed event. Don't fire it on the combo boxes (just like you shouldn't fire AtkText events on objects which don't implement AtkText). Instead, fire object:property-changed:accessible-value, give it whatever value data you want because it's going to be tossed by the bridge, and Bob's your uncle. 😀

I think I'm going to clean up my experiment and do a Chromium CL for this work.

Flags: needinfo?(jdiggs)

I'm dealing with this over in bug 1732284.

Flags: needinfo?(eitan)
Depends on: 1732284

:eeejay, since you are the author of the regressor, bug 2050939, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(eitan)

Bad bot!

Assignee: nobody → jteh
Status: NEW → ASSIGNED
Flags: needinfo?(eitan)

Thanks for fixing this in bug 1732284! Can we close this as a dup?

Flags: needinfo?(jteh)
Status: ASSIGNED → RESOLVED
Closed: 13 days ago
Duplicate of bug: 1732284
Resolution: --- → DUPLICATE
No longer duplicate of bug: 1732284
Resolution: DUPLICATE → FIXED
Target Milestone: --- → 162 Branch

It was unclear to me whether this should be marked as a dup or not, given that this one is marked as a regression and the other one isn't, etc. It seems there's disagreement among others about that too. :)

Flags: needinfo?(jteh)
QA Whiteboard: [qa-triage-done-c163/b162]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: