Closed Bug 1577381 Opened 5 years ago Closed 5 years ago

optgroup not exposed correctly via accessibility APIs for <select size="1">

Categories

(Core :: Disability Access APIs, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla71
Tracking Status
firefox71 --- verified

People

(Reporter: Jamie, Assigned: Jamie)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR (with the NVDA screen reader):

  1. Open this page: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup
  2. Press control+home to move to the start of the document, then c to move to the Choose a dinosaur dropdown.
  3. Press alt+downArrow to expand it.
  4. Press down arrow twice.
  5. Press down arrow again to select Diplodocus.
    • Expected: NVDA should say "Sauropods grouping, Diplodocus 1 of 3 level 2"
    • Actual: NVDA says "Diplodocus 4 of 6"

This regressed with e10s. <select size="1"> is rendered by XUL in the parent process, so the accessibility code we have for optgroups doesn't apply. size>1 is rendered in the content process, so that still behaves as expected.

Note that our mochitests wouldn't pick this up because they run in the same process as the content. We'll need to write a browser test for this.

Thoughts on fixing this:

Relevant code is in SelectParentHelper.populateChildren:
https://searchfox.org/mozilla-central/rev/325c1a707819602feff736f129cb36055ba6d94f/toolkit/actors/SelectParent.jsm#374
When we create the menucaption for the optgroup, set its role attribute to group:
https://searchfox.org/mozilla-central/rev/325c1a707819602feff736f129cb36055ba6d94f/toolkit/actors/SelectParent.jsm#393
If we're inside an optgroup (parentElement is not null), set the aria-owns attribute on parentElement so it owns all of its children. That will require each child to have an id, which we can create using nthChildIndex. Each child should also get aria-level="2".

Turns out it's a bit more complicated than this because XULMenuitemAccessible doesn't like the interspersed group accessibles. The role on the group children is wrong and DOMMenuItemActive fails.

Assignee: nobody → jteh

For remote content documents, select dropdowns (for <select size="1">) are rendered in the parent process using a XUL menupopup.
This means that the accessibility code for HTML selects doesn't apply.

In the menupopup, the optgroup is a sibling of its contained options.
For accessibility, we want to preserve the hierarchy such that the options are inside the optgroup.
We do this using aria-owns on the optgroup item.

This required some tweaks to XULMenuitemAccessible, as it couldn't previously handle grouping Accessibles between the menupopup and its items.

Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ea2c69779571
Correct accessibility exposure for optgroups in content select dropdowns. r=eeejay,NeilDeakin

Backed out changeset ea2c69779571 (bug 1577381) for a11y failures at accessible/tests/mochitest/attributes/test_obj_group.xul

Backout: https://hg.mozilla.org/integration/autoland/rev/d4a0dc365ef9b1c5a4e867f8bacc41f967dd0900

Failure push: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=ea2c6977957107879904ebedf2e6668c2d5d5c47

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=268713099&repo=autoland&lineNumber=1737

[task 2019-09-27T04:33:42.855Z] 04:33:42 INFO - TEST-PASS | accessible/tests/mochitest/attributes/test_obj_group.xul | Test with ID = 'open menu 'menu_item1' ' succeed. Event 'focus' was handled.
[task 2019-09-27T04:33:42.856Z] 04:33:42 INFO - Invoke the 'open submenu 'menu_item2' ' test { scenario #0: expected 'focus' event; }
[task 2019-09-27T04:33:42.856Z] 04:33:42 INFO - Buffered messages finished
[task 2019-09-27T04:33:42.859Z] 04:33:42 INFO - TEST-UNEXPECTED-FAIL | accessible/tests/mochitest/attributes/test_obj_group.xul | Test timed out.
[task 2019-09-27T04:33:42.860Z] 04:33:42 INFO - SimpleTest.ok@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:277:18
[task 2019-09-27T04:33:42.860Z] 04:33:42 INFO - reportError@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:121:22
[task 2019-09-27T04:33:42.861Z] 04:33:42 INFO - TestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:142:18
[task 2019-09-27T04:33:42.861Z] 04:33:42 INFO - setTimeout handlerTestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handler
TestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handlerTestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handler
TestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handlerTestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handler
TestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handlerTestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handler
TestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handlerTestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handler
TestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - setTimeout handlerTestRunner._checkForHangs@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:170:15
[task 2019-09-27T04:33:42.862Z] 04:33:42 INFO - TestRunner.runTests/<@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:388:20
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - promise callback
TestRunner.runTests@chrome://mochikit/content/tests/SimpleTest/TestRunner.js:375:50
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - RunSet.runtests@chrome://mochikit/content/tests/SimpleTest/setup.js:201:14
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - RunSet.runall@chrome://mochikit/content/tests/SimpleTest/setup.js:180:12
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - hookupTests@chrome://mochikit/content/tests/SimpleTest/setup.js:273:12
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - parseTestManifest@chrome://mochikit/content/manifestLibrary.js:50:13
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - getTestManifest/req.onload@chrome://mochikit/content/manifestLibrary.js:61:28
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - EventHandlerNonNullgetTestManifest@chrome://mochikit/content/manifestLibrary.js:57:3
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - hookup@chrome://mochikit/content/tests/SimpleTest/setup.js:253:20
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - linkAndHookup@chrome://mochikit/content/harness.xul:45:3
[task 2019-09-27T04:33:42.863Z] 04:33:42 INFO - parseTestManifest@chrome://mochikit/content/manifestLibrary.js:50:13
[task 2019-09-27T04:33:42.864Z] 04:33:42 INFO - getTestManifest/req.onload@chrome://mochikit/content/manifestLibrary.js:61:28
[task 2019-09-27T04:33:42.864Z] 04:33:42 INFO - EventHandlerNonNull
getTestManifest@chrome://mochikit/content/manifestLibrary.js:57:3
[task 2019-09-27T04:33:42.864Z] 04:33:42 INFO - getTestList@chrome://mochikit/content/chrome-harness.js:258:18
[task 2019-09-27T04:33:42.864Z] 04:33:42 INFO - loadTests@chrome://mochikit/content/harness.xul:24:14
[task 2019-09-27T04:33:42.865Z] 04:33:42 INFO - EventListener.handleEvent*@chrome://mochikit/content/harness.xul:48:12
[task 2019-09-27T04:33:43.572Z] 04:33:43 INFO - GECKO(1158) | MEMORY STAT | vsize 20975255MB | residentFast 1082MB

Flags: needinfo?(jteh)

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:Jamie, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(jteh)
Flags: needinfo?(jteh)
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b1afc99c9bfb
Correct accessibility exposure for optgroups in content select dropdowns. r=eeejay,NeilDeakin
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71

I have managed to reproduce the issue with an old Nightly build 70.0a1 (Build id: 20190828094217) using Windows 10.
Verified - fixed on latest Nightly 72.0a1 (2019-11-20) and latest Beta 71.0b11.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: