Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16466 closed defect (fixed)

[PATCH][CCLA] dijit.popup functionality needs aria roles and attributes

Reported by: mikeb Owned by: bill
Priority: undecided Milestone: 1.8.4
Component: Dijit Version: 1.8.2rc1
Keywords: Cc:
Blocked By: Blocking:

Description

Anything that uses popup functionality from _popup.js needs to have aria-label and aria-role attributes. This is because according to WAI-ARIA, all content needs to be enclosed in either "page landmarks" or in a role=region. The problem is that _popup.js will create a "wrapper" for the popup dijit and appends this domNode to the end of the dom tree. This means that the popup dijit's contents will actually not be enclosed in a role=region or landmark unless the author has set the role attribute on the body tag. Not everybody can or should set role=main on the body element.

The patch takes care of automatically setting role="region" on the wrapper of the domNode. It also has to set aria-label attribute since role=region requires that attribute. I had some trouble trying to figure out what the best way to set the aria-label was, so I just look for various attributes ("aria-label", "label", "name") and eventually fall back on the ID.

I tested with JAWS14 and there is no difference in behavior with this patch.

I also created some automated test cases and verified that the test pages all still work. I think I hit every dijit that uses _popup.

Attachments (1)

add aria-label and role-region to _popup.js.patch (5.3 KB) - added by mikeb 7 years ago.
set role=region and aria-label on the wrapper element of any popup, plus tests, please proxy commit for michael billau ccla on file with ibm.

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by mikeb

set role=region and aria-label on the wrapper element of any popup, plus tests, please proxy commit for michael billau ccla on file with ibm.

comment:1 Changed 7 years ago by bill

Milestone: tbd1.9
Status: newassigned

OK thanks. I needed to modify most of the patch to use modern AMD style (i.e. no reference to the dojo global) and to fix spacing, but I'll check in.

comment:2 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [30213]:

Set role=region for the popup wrapper. Fixes #16466 !strict. Patch from Mike Billau (IBM, CCLA), thanks!

comment:3 Changed 7 years ago by Douglas Hays

Can this go into 1.8 as well?

comment:4 Changed 7 years ago by bill

I guess so, doesn't look like it will break anything.

comment:5 Changed 7 years ago by Douglas Hays

In [30317]:

Refs #16466. Backport [30213] to 1.8. !strict

comment:6 Changed 7 years ago by Douglas Hays

Milestone: 1.91.8.4
Note: See TracTickets for help on using tickets.