Problem/Motivation
Tabledrag library has a button to swap between draggable handles, and numeric weight fields, which is important for assistive tech users (screen readers, speech control) and keyboard-only users. The button has a clear label, so that's good.
However it also has a title attribute, which provides a slightly more verbose explanation of what the button is for. The trouble is, this title attribute is basically useless. It can only be perceived by sighted mouse users (i.e. hover-capable pointers). More importantly, the title attribute can't be perceived by the intended audience - people who need to use the row weights feature. The title attribute is not available to sighted keyboard users, speech control users, or (most) screen reader users. When the button element has text content (like this one does) the title attribute is not supposed to be used when calculating the button's accessible name for assistive technology. Screen magnifier users with a mouse can trigger it, but it's a long title which may not fit in their magnifier viewport.
Background reading: Using the HTML title attribute.
Drupal has a lot of unnecessary title attributes, and it's something we have been called out for in the wider accessibility community (see Tenon Research first glimpse: The best & worst of content management systems).
Note also:
- We have another variant of this in MediaLibraryWidget (which says "media items" instead of rows).
- The behaviour of this button is documented in System module's hook_help. This can stay, and we'll probably also document it with the help_topics, once #2920309: Add experimental module for Help Topics lands.
Proposed resolution
Remove the title attribute from the "show/hide row weights" button.
Also remove the similar title attribute from MediaLibraryWidget.
Remaining tasks
Patch to remove the title attribute from these buttons:
- Update tabledrag.es6.js, and re-compile the JS in tabledrag.js.
- Update MediaLibraryWidget.php
Does this affect any tests? The title string appears in core/modules/migrate_drupal/tests/fixtures/drupal7.php
- is this relevant?
User interface changes
Remove some title attributes which are of very little use, and cannot be perceived by the intended audience.
Removes a couple of translatable strings, which are no longer used.