This panel style ends up generating a grid of pane titles and content, using the table rows and columns to provide the grid layout. Because it's a layout table, it's not set up for use by assistive technologies that provide specific navigation commands for tables.

The ARIA role of "presentation" will tell assistive technologies such as screenreaders to ignore their specific table handling and just read the table in source code order as text content.

It would be good to add an option to the pane settings that would this role to the table when it's rendered.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cboyden created an issue. See original summary.

cboyden’s picture

Status: Active » Needs review
FileSize
1.16 KB

Patch is attached.

mgifford’s picture

Makes sense to me.

dsnopek’s picture

The patch works, but doesn't include a default value for this new bit of configuration, which causes a PHP notice when rendering regions that were previously configured. I've added a new patch that defaults to TRUE, but I don't really know the accessibility implications of that. Is there a case where that would cause problems? Would defaulting to FALSE be better?

Also, would it help to also use <th> tags instead of <td> for pane titles? I think that would be more semantically correct, but I'm not sure how it would affect accessibility. If it'd be a positive or at least neutral change, then I think we should do that too (we can just set 'header' => TRUE on the cells).

cboyden’s picture

Issue summary: View changes

Pane title cells as THs makes sense in general, but there may be a problem if the table is configured with multiple sets of columns instead of a single set (one title, one value). We'd have to look at what happens if there are two TH tags scoped to the same row. I don't think you want to go down the road of adding explicit headers references to each value cell pointing to its title cell, though it would be programmatically possible.

Also if the role of presentation is added, I believe the semantics of the TH will be ignored and still read as text.

cboyden’s picture

Issue summary: View changes

My inclination would be to have the configuration default to TRUE, but in the interest of not changing existing code, perhaps it could be TRUE for new instances and FALSE for existing instances? Or would that be confusing? Would there need to be an update hook either way?

dsnopek’s picture

Pane title cells as THs makes sense in general, but there may be a problem if the table is configured with multiple sets of columns instead of a single set (one title, one value). We'd have to look at what happens if there are two TH tags scoped to the same row. I don't think you want to go down the road of adding explicit headers references to each value cell pointing to its title cell, though it would be programmatically possible.

Eep! I hadn't considered that. Implementing the explicit headers references actually wouldn't be that hard. I guess the question is if that does the right thing by screenreaders. I think that warrants making it its own issue:

#2842286: Pane titles should be in TH (rather than TR) tags

My inclination would be to have the configuration default to TRUE, but in the interest of not changing existing code, perhaps it could be TRUE for new instances and FALSE for existing instances? Or would that be confusing? Would there need to be an update hook either way?

Defaulting to TRUE or FALSE in all cases doesn't require an update hook. However, having one default for new instances and another for old instances does. I'd prefer to pick just one default and I'm fine with defaulting to TRUE if you see no serious accessibility issues with that choice.

  • dsnopek committed a84e49e on 7.x-1.x authored by cboyden
    Issue #2831571 by dsnopek, cboyden: Add an option to flag the table with...
dsnopek’s picture

Status: Needs review » Fixed

Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.