WordPress.org

Make WordPress Core

Changes between Initial Version and Version 11 of Ticket #43137


Ignore:
Timestamp:
02/21/2019 08:30:29 PM (3 years ago)
Author:
afercia
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #43137

    • Property Keywords has-patch added
    • Property Owner set to afercia
    • Property Status changed from new to reviewing
    • Property Milestone changed from Awaiting Review to 5.2
  • Ticket #43137 – Description

    initial v11  
    11Context: in the front-end, the image alt attribute must describe the purpose of the image or must be empty if the image is not a key part of the content and is purely decorative.
    22
    3 Instead, in the admin screens we're in an editing context. As a user, while authoring content, I need to know what the image is, regardless if the image has or has not an alternative text.
     3Instead, in the admin screens we're in an editing context. As an user, while authoring content, I need to know what the image is, regardless if the image has or has not an alternative text.
    44
    5 The image widget preview already does something to always provide some info about the image. When the image has no alternative text, it uses an `aria-describedby` attribute pointing to a hidden element that contains some info about the image file name:
     5The image widget preview already does something to always provide some info about the image. When the image has no alternative text, it uses an `aria-describedby` attribute pointing to a hidden element that contains info about the image filename:
    66
    77[[Image(https://cldup.com/uoRHlQWnmn.jpg)]]
    88
    9 Pretty smart. Without this the image wouldn't provide any useful information to assistive technologies and users wouldn't have any clue what the image is about. It can be improved a bit, as the proper way to give an accessible name to an image is using an `aria-label` or `aria-labelledby` attribute, not an `aria-describedby` attribute.
     9Pretty smart. Without this, the image wouldn't provide any useful information to assistive technologies and users wouldn't have any clue what the image is about. It can be improved a bit, as the proper way to give an accessible name to an image is by using an `aria-label` or `aria-labelledby` attribute, not an `aria-describedby` attribute.
    1010
    1111Instead, the preview of the new gallery widget introduced in WordPress 4.9 always prints out an empty alt attribute `alt=""` for all the images. Worth reminding images with an empty alt attribute are completely ignored by assistive technologies. When navigating through the preview, the only information provided is the textual content for the "more images" text (it appears only when the gallery contains more than 6 images). Also, each image is within a `<dl>` element, that doesn't give any useful information to users:
     
    1717[[Image(https://cldup.com/wKboHchwkB.jpg)]]
    1818
    19 I'd like to propose to use the same pattern used for the Image preview, and provide some extra info for each image in the gallery. Also, as a user I'd like to know how many images are displayed in the preview: using an unordered list with each image in a `<li>` element would make assistive technologies announce that automatically.
     19I'd like to propose to use the same pattern used for the Image preview, and provide some extra info for each image in the gallery. Also, as a user I'd like to know how many images are displayed in the preview. Using an unordered list with each image in a `<li>` element would make assistive technologies announce that automatically.