aria-sort is a WAI-ARIA property that "Indicates if items in a table or grid are sorted in ascending or descending order" ( http://www.w3.org/TR/wai-aria/states_and_properties#aria-sort ).

This should be added to table sort, and anywhere else that grid / columns are sorted / sortable.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Everett Zufelt’s picture

This is supported by at least one piece of assistive technology, NVDA 2011.2 ( http://www.nvda-project.org/releaseChanges/nvda_2011.3rc1_changes.html )

Everett Zufelt’s picture

Issue tags: +html5
Everett Zufelt’s picture

Status: Active » Needs review
FileSize
841 bytes

This patch ads the aria-sort attribute to the table header cell of the currently sorted column.

I'm not sure if inline documentation is required, thoughts?

Everett Zufelt’s picture

FileSize
649 bytes

Removed unnecessary variable initialization.

mgifford’s picture

Patch applies nicely. I need to re-install D8 though to review the effect.

mgifford’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
182.85 KB

Ok, after getting D8 again, I can confirm that this works as expected and have included a screenshot with a firebug view.

ksenzee’s picture

Status: Reviewed & tested by the community » Needs work

I think this needs a code comment, since most people won't understand what "aria-sort" is or does.

Everett Zufelt’s picture

@ksenzee

Can you point me to any documentation standards for inline comments of this type? If they exist. I would assume that a URL for the definition in the WAI-ARIA spec would be useful.

Perhaps (obviously only 80 chars / line):

// aria-sort is a WAI-ARIA property that Indicates if items in a table or grid are sorted in ascending or descending order. See http://www.w3.org/TR/wai-aria/states_and_properties#aria-sort

ksenzee’s picture

Yes, that's just the kind of thing I had in mind.

Everett Zufelt’s picture

Status: Needs work » Needs review
FileSize
867 bytes

Added inline comment.

bdone’s picture

Status: Needs review » Patch (to be ported)

I've tested and confirmed that patch #10 adds the WAI-ARIA attribute and comment to core/includes/tablesort.inc.

But, the casing of "Indicates" should be changed to "indicates".

After that's fixed, it should be marked RTBC, in my opinion.

bdone’s picture

Status: Patch (to be ported) » Needs work

Updating status, for the casing in comment #11

Everett Zufelt’s picture

Status: Needs work » Needs review
FileSize
882 bytes

Corrected code comment as per #11

Everett Zufelt’s picture

I'm not in support of backporting to D7.

- This is a markup change.
- This invalidates xhtml 1.0 pages.

Bojhan’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC per #11.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1342760-aria-sort_13.patch, failed testing.

Everett Zufelt’s picture

Status: Needs work » Needs review
FileSize
867 bytes

Not sure why that won't apply, but this should work.

Bojhan’s picture

Status: Needs review » Reviewed & tested by the community
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Marking 'fixed'.

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