Make WordPress Core

Changeset 45726 for trunk


Ignore:
Timestamp:
08/03/2019 11:52:51 AM (5 years ago)
Author:
afercia
Message:

Accessibility: Improve the way emojis are announced by screen readers.

Adds an ARIA role="img" to the emojis markup in the front end. While the ARIA role is technically redundant, it helps Safari and VoiceOver to properly announce the emojis as "image". Without the role, they announce a generic "group" role.
Tested with Safari 12.1.1 / VoiceOver 9.

Props pento.
See #37486.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/emoji.js

    r43360 r45726  
    254254                    return ''.concat( options.base, icon, options.ext );
    255255                },
     256                attributes: function() {
     257                    return {
     258                        role: 'img'
     259                    };
     260                },
    256261                onerror: function() {
    257262                    if ( twemoji.parentNode ) {
Note: See TracChangeset for help on using the changeset viewer.