w3c / accname

Accessible Name and Description Computation
https://w3c.github.io/accname/
62 stars 22 forks source link

Step 2E should include listbox with combobox #12

Open joanmarie opened 6 years ago

joanmarie commented 6 years ago

(Spinoff issue from https://github.com/WhatSock/w3c-alternative-text-computation/issues/8)

AccName spec's step 2E states, "If the embedded control has role combobox, return the text alternative of the chosen option." Listbox is not mentioned here. At least some of us think that should be changed, with listbox and combobox being treated in the same fashion.

mcking65 commented 6 years ago

I agree with this change. However, it raises a related question ... does step 2E correctly address combobox in all its possible states? What if a combobox has a value in its textbox and that does not correspond to a value in its associated listbox? What if the combobox does not have a listbox?

accdc commented 6 years ago

Hi Matt, The executable AccName prototype already supports all of the supported children of role=combobox, including Listbox, Grid, and Tree, such as the following tests:

<input type="text" id="test" />
  <label for="test">Flash the screen 
    <div role="combobox">
      <div role="textbox"></div>
            <div role="grid">
      <ul role="row" style="list-style-type: none;">
        <li role="gridcell" aria-selected="true">1</li>
    <li role="gridcell">2</li>
    <li role="gridcell">3</li>
      </ul>
    </div>
    </div>
    times.
  </label>

And


<input type="text" id="test" />
  <label for="test">Flash the screen 
    <div role="combobox">
      <div role="textbox"></div>
      <ul role="tree" style="list-style-type: none;">
        <li role="treeitem" aria-selected="true">1</li>
    <li role="treeitem">2</li>
    <li role="treeitem">3</li>
      </ul>
    </div>
    times.
  </label>

All of which are treated as widgets that support explicit values in accordance with the aria-selected model for selectable children.

I'm not sure if these are clearly conveyed in the spec though.

An ARIA Combobox only has a value when one of it's supported children like those above have aria-selected="true", or if the embedded textbox has a value (whether element.value if a native edit field or name from content if a simulated role=textbox), but if it has no value then nothing is returned as the value.

This is how I coded it into the AccName Prototype, but if others have a different interpretation of this, please let me know.

joanmarie commented 6 years ago

Another thing which we need to address: What about multi-select listboxes which multiple items selected?

(Sorry for not thinking about this until now. It's an argument for seeking/doing implementations early on in the process as per our new work flow.)

eps1lon commented 5 years ago

It does now include listbox:

If the embedded control has role combobox or listbox, return the text alternative of the chosen option.

But the point remains about aria-multiselectable. I guess

- [...] return the text alternative of the chosen option.
+ [...] return the text alternative of the selected options.

Would be sufficient and make it more obvious what "chosen" means by using the same terminology (selected and aria-selected).