Stepper (aka <input type="number">) doesn't read label in VoiceOver
Categories
(Core :: Disability Access APIs, defect, P3)
Tracking
()
People
(Reporter: aloha, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:98.0) Gecko/20100101 Firefox/98.0
Steps to reproduce:
- Launch FF with VO
- Navigate to data:text/html,<label for="example-number">Your favorite number?</label><input type="number" name="example-number" value="11" id="example-number">
- Move VO cursor to input box
Actual results:
VO says: "11, selected, You're on a text element" or similar, reporting the current value
Expected results:
VO says: "11, Your favourite number?, incrementable edit text" or similar, reporting the current value
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Form Controls' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•4 years ago
|
||
Assuming this ought to be fixed in the a11y side of things, but feel free to put back if this is somehow layout related.
Updated•4 years ago
|
Comment 3•4 years ago
|
||
:aloha thanks for the report! I'm having trouble reproducing this locally -- when I load your data URL and focus the input box, VO reads "11, Your favourite number?, stepper".
Which version of macOS are you running, and which version of Firefox are you testing on?
Updated•4 years ago
|
Np! I'm currently on Mac OSX 12.1. I have the same issue with both FF 98.0b10 and 97.0.2. Sometimes tabbing in I hit the label first, so that's helpful. But most of the time I do not. I've also tried adding a second input and tabbing between them, which produces the same problem.
Comment 5•4 years ago
•
|
||
Oh I see the issue -- it isn't that the input itself doesn't report the label, it's that the text node inside the input doesn't report the label. When you tab into a stepper, the internal text gets selected resulting in the following:
Testing with Safari, expected:
11, content selected, Your favorite number?, incrementable edit text number field
Firefox actual:
11, selected
It looks like Safari reads the same thing whether you focus the input or select the text inside, whereas we read "11, Your favourite number?, stepper" on the input, but "11, selected" on the text. Our attributes here look mostly ok -- Safari is giving the field a role of AXTextField, even though the official mapping is AXIncrementor, which is what we're using.
I think the issue here might be tree structure. Safari doesn't expose an internal text node. Instead, they expose an empty group (?) and the stepper controls.
:eeejay haven't tested it locally, but do you see any potential issues w/ pruning the internal text node from steppers?
Comment 6•4 years ago
|
||
Yeah, I think the role should be in this conditional: https://searchfox.org/mozilla-central/source/accessible/base/nsAccUtils.cpp#389
NIing Jamie to see if removing the text leaf would not break windows. if it does, we will need to do this in mac specifically.
Comment 7•4 years ago
|
||
seems very similar to ENTRY, so it seems like the right place for it..
Comment 8•4 years ago
|
||
Squelching the text leaf here shouldn't break Windows. That said, how does Mac handle contentEditables, since we do include text leaf children there? I worry about a case like this:
<div contenteditable role="spinbutton" aria-valuenow="50">50</div>
Comment 9•4 years ago
|
||
(In reply to James Teh [:Jamie] from comment #8)
Squelching the text leaf here shouldn't break Windows. That said, how does Mac handle contentEditables, since we do include text leaf children there? I worry about a case like this:
<div contenteditable role="spinbutton" aria-valuenow="50">50</div>
We seem to be OK here -- VO speaks "50, stepper" both when focusing the (outer) element and tabbing to the editable content. Safari says "50%, stepper" but I think that's just a difference in how we expose the value string 🤷♀️
| Reporter | ||
Comment 10•4 years ago
|
||
:morgan I wanted to check in and make sure this didn't get stale. Did y'all have a chance to talk it through? Anything else I can provide?
Comment 11•4 years ago
|
||
Thanks for the nudge :) I'll look into getting a patch up for this next week.
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Ugh, this doesn't seem to be as simple as removing the text leaf. I think this is a weird VO/Safari quirk thing:
So like I mentioned above, Safari doesn't actually expose this as an Incrementor, like we do. They expose it as an AXTextField, and by some (internal) role-description logic, VO figures out that this is not a regular text input but a "number" input. Unfortunately this logic doesn't straightforwardly use an attribute, so short of hard-coding that role description we're left debugging VO's behaviour :)
I think this probably has to do with (yet another part of) Safari's tree structure, and it makes me wonder if the reason we're not seeing the label associated here is because VO only does that for specific controls (and it doesn't think this is one of them).
Safari exposes two children of the AXText Field: an empty group, which seems like it'd hold the text leaf if it wasn't pruned, and an AXIncrementor (the dual-button-control that lets you incremenet or decrement the value here).
In our core tree, we expose the spinbutton control as one unit (input and buttons together) with a text leaf child.
I think it's probably nontrivial to change our core tree to render the buttons separately, prune them out on non-mac platforms, and then hope that solves this problem. Happy to be proven otherwise though :)
Updated•4 years ago
|
Comment 13•4 years ago
|
||
The buttons would get rendered as children of the input in our tree except that they are https://searchfox.org/mozilla-central/rev/711e1cea1cb584057c50aac0a26a3f7c969eda66/layout/forms/nsTextControlFrame.cpp#372deliberately aria-hidden. This is necessary because otherwise, they get exposed as part of the text of the control (bug 1609394).
There are two possibilities:
- Expose these buttons (remove aria-hidden) and somehow prevent them from being traversed by HyperTextAccessible, TextLeafPoint and HyperTextAccessibleBase.
- Expose these buttons only on Mac (with an ifdef), ensuring that the Mac text code doesn't traverse them.
Will exposing these actually help, though? These are two separate buttons, but isn't an AXIncrementor a single element?
| Reporter | ||
Comment 14•4 years ago
|
||
:Jamie :morgan Bumping this issue. Have y'all had any chance to work on this?
Comment 15•4 years ago
|
||
Not recently, but I can put it on my todo list
Comment 16•4 years ago
|
||
This appears fixed for me, running 12.5 on Nightly 104 (built from rev a957b284c6130bed2c72787e7795fcc10237e8fc)
:eeejay, :aloha can you reproduce this?
| Reporter | ||
Comment 17•4 years ago
|
||
:morgan, :eeejay I still seem to be able to reproduce it. I'm not 100 percent clear on the expected behavior when first loading a page with voiceover and tabbing around, but if I double the number of text elements (i.e. data:text/html,<label for="example-number">Your favorite number?</label><input type="number" name="example-number" value="11" id="example-number"><label for="example-number">Your favorite number?</label><input type="number" name="example-number" value="11" id="example-number">) and tab between them I still only see/hear the value of the text field and not the label from voiceover.
Comment 18•4 years ago
|
||
(In reply to aloha from comment #17)
:morgan, :eeejay I still seem to be able to reproduce it. I'm not 100 percent clear on the expected behavior when first loading a page with voiceover and tabbing around, but if I double the number of text elements (i.e. data:text/html,<label for="example-number">Your favorite number?</label><input type="number" name="example-number" value="11" id="example-number"><label for="example-number">Your favorite number?</label><input type="number" name="example-number" value="11" id="example-number">) and tab between them I still only see/hear the value of the text field and not the label from voiceover.
What version of macOS are you running?
| Reporter | ||
Comment 19•4 years ago
|
||
What version of macOS are you running?
12.4 (21F79)
Comment 20•4 years ago
|
||
I still experience the same thing aloha does. When tabbing you just hear "11, selected".
Comment 21•4 years ago
|
||
I agree that this is probably due to the very different tree structures between safari and us. FWIW, chrome doesn't work either.
Updated•3 years ago
|
Description
•