Fix several accessibility related issues on the edit Image style page

Created on 2 April 2022, almost 3 years ago
Updated 12 September 2024, 5 months ago

Problem/Motivation

On the edit page for image styles there are several accessibility related issues in the context of alt text, link purpose and focus visibility (WCAG21 SC1.1.1, SC2.4.4, and SC 2.4.7)

alt text (WCAG22 SC1.1.1)

The actual image dimensions on the bottom and the right of the sample images are not directly accessible to screen reader users and could get easily missed.

link purpose (WCAG22 SCSC2.4.4)

First, View actual size is redundant. You have two links with the same link text, but those link texts are missing a context. A screen reader user is unable to distinguish just based on the link text if the link forwards to the original or the derivative image? Second, each sample has two redundant links. Each sample first has the link on the View actual size link and then again on the decorative image.

focus visibility (WCAG22 SC 2.4.7)

You have two preview images. the two are prefixed with a string original (view actual size). but after the focus to the view actual size link you see a focus outline covered in most parts underneath the preview sample image.

Reason is that underneath the image there is a wrapping div containing a link tag as well as the two divs for the horizontal and vertical extent in pixels.

<div class="preview-image-wrapper">
      original (<a href="/core/modules/image/sample.png">view actual size</a>)
      <div class="preview-image original-image" style="width: 160px; height: 120px;">
        <a href="/core/modules/image/sample.png">
          <img width="800" height="600" style="width: 160px; height: 120px;" src="/core/modules/image/sample.png" alt="Sample original image" title="" typeof="foaf:Image">
        </a>
      <div class="height" style="height: 120px"><span>600px</span></div>
      <div class="width" style="width: 160px"><span>800px</span></div>
    </div>
  </div>

Steps to reproduce

- go to admin/config/media/image-styles/manage/large
- tab through the page, ideally with a screen reader active

Proposed resolution

It seems to me the view actual size link before/on top of each picture is enough to reach the full sized image. It isn't really necessary to have another link for the image. There are two options to solve this:

  1. Move the CTA to click for viewing the actual image to the title as text and remove the links from the image labels
  2. Adjust the image labels to the terminology used in code (Source and Derivative)
  3. Adjust the alt text to the new terminology as well and add the actual image dimensions
  4. Make the link in the wrapping div the same size as the image so that the focus outline outlines the whole image and isn't hidden anymore.

Remaining tasks




Review

User interface changes

Before:

After:

Introduced terminology

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Fixed

Version

10.4 โœจ

Component
Image systemย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Pipeline finished with Failed
    6 months ago
    Total: 591s
    #227690
  • Status changed to Needs review 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep_patel Ahmedabad

    Removed link from image and add spacing on top of image so now focus is clearly visible around (view actual size). So now there is only one link to view actual size of image. Attached screenshot(removed_link_from_image_and_focus_visible.png) for the same.

  • Status changed to RTBC 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandansha

    I have tested MR 8816. Now unnecessary link tag removed.
    I moved it to RTBC.
    THANKS!!

  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    This looks like a nice fix.

    After reading the issue summary I see that the proposed resolution here has two options. It should indicate which option has been selected and perhaps even link to the relevant comments. This is also changing the UI so there should be before and after screen shots available in or linked to in the issue summary.

    There are questions in #8 that still need answers. And I don't see any review of the code changes.

    As a reminder, when making screenshot remember to list the steps taken to create them. These should usually be in the issue summary.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    Thanks for the reminder and the comprehensive assessment of the status quo @quiteone, I completely forgot about this issue. I took another look. After reading through everything including the recent change I would suggest the following ( in case there is an agreement i would update the issue summary accordingly).

    1. I would go with the solution @tinto added in #7 ๐Ÿ› A Image style page has two unnecessary link tags as well as a hidden focus Needs work . From my perspective that looks the cleaner approach compared to the one taken in MR8816.
    2. the div of the preview image currently has margin: auto. i would suggest to change that to margin: 0.5em auto auto auto. that way the focus outline for the view actual size link is completely visibleand not hidden in part underneath the preview image.
    3. and one additional detail i've noticed while revisiting this issue, which could be either done within this issue or in a follow up issue, is adding the width and height value to the alt text. at the moment you only get "sample original image" announced when the preview image gets into focus. At the moment a screen you have to start reading with VO-A and that way you get "sample original image" then "600px" and then "800px". Even if you let the screenreader read through the page that way you still wouldnt know if 600px is the width or height. by adding both in context to the alt text the information would be easily accessible.
  • Assigned to rkoller
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    I've played around with it a bit more and came to the conclusion that it would make sense to cover all the three points mentioned in #17 ๐Ÿ› A Image style page has two unnecessary link tags as well as a hidden focus Needs work within this issue. i've already have a working copy locally (see the two videos - current.mp4 is the current state without the changes applied, update.mp4 demonstrates these changes). i will hone things a little further and if there are no other issues discuss it at the usability meeting tomorrow to get some more opinions and feedback in regards of the micro copy.

  • Merge request !9060Resolve #3273099 "Image style focus" โ†’ (Closed) created by rkoller
  • Pipeline finished with Failed
    6 months ago
    Total: 193s
    #242717
  • Pipeline finished with Failed
    6 months ago
    Total: 476s
    #242734
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    Usability review

    We discussed this issue at ๐Ÿ“Œ Drupal Usability Meeting 2024-08-02 Needs work . That issue will have a link to a recording of the meeting. For the record, the attendees at today's usability meeting were @benjifisher, @rkoller, @shaal, and @worldlinemine.

    If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

    In general the group was in agreement with the proposed changes. It was also noted that the newly added keyboard and screen reader related changes are in scope for this issue, since the issue summary already raises the point that there are two redundant links, the view actual size link and the decorative image, for each sample.

    The View actual size link was in lack of context. A screen reader user was unable to determine when tabbing to the link if the actual size for the "source" or the "derivative image" should be viewed, the link text was identical. My initial idea that i brought to the meeting was to add an aria-label to the link. But the consensus in the group was to remove the link entirely and append Click for actual images to the title Preview.

    For the image label there was a clear consensus to move from Original which is sort of unclear to Source image and to drop the usage of the image style name which could be quite lengthy in a few cases and go with Derivative image instead. At first we were uncertain if Derivative would be a too abstract and complicated term in particular for none native speakers and novice users. But for one the image style settings are only available to administrators and site builders aka advanced users, and derivative is the clearest unambiguous term in particular in combination with the term Source. An additional plus the terminology used in code becomes inline with the user facing micro copy.

    The group also agreed on altering the alt text further and adjust it to the new image label terminology plus adding some punctuation to the newly added width and height values.

  • Issue was unassigned.
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    In regards of the remaining tasks, the usability review in #20 ๐Ÿ› A Image style page has two unnecessary link tags as well as a hidden focus Needs work covered the questions raised in #8 ๐Ÿ› A Image style page has two unnecessary link tags as well as a hidden focus Needs work . I've also added before and after screenshot based on the recents changes from the usability review. And i have updated the issue summary accordingly (removed "problem 2" and adjusted the problem section as well as the proposed resolution section)

    There are two open questions:

    1. To those more familiar with tests, i've managed the MR pass the linters but it is failing tests. But i am not sure if the failing of tests is because of one of my changes (in the context of php i've only changed the micro copy and not actual code) or something completely arbitrary? If someone more familiar with tests could take a look please? Therefore I keep the issue at needs work status.
    2. While making the changes and writing up the comment with the summary of the usability meeting i've realized it might be not necessarily clear for screen reader users just based on the alt text that the image in focus is NOT the image but an decorative preview sample. "technically" with the announcement with the announcements of the dimensions of the actual image screen reader users wouldnt have to click and follow the link at all. so maybe the alt text could be improved further?
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    and adjusted the title since it wasnt reflecting the actual scope anymore properly.

  • Status changed to Needs review 6 months ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    in regards of #21 ๐Ÿ› A Image style page has two unnecessary link tags as well as a hidden focus Needs work .2 i've asked for feedback on the #accessibility channel and @mgifford thought 21.2 shouldnt be a problem. so i am setting the issue to needs review

  • Pipeline finished with Success
    5 months ago
    Total: 734s
    #257379
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    Just rebased MR9060 to fix a problem that lead to an error checking out the feature branch. for reference the error is caused by a spelling fix committed in https://git.drupalcode.org/project/drupal/-/commit/8b368d712d83900765744... that is causing the error on non case sensitive file systems like for macos in my case.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    smustgrave โ†’ changed the visibility of the branch 3273099-a-image-style to hidden.

  • Status changed to RTBC 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Definitely agree it's a cleaner look

    Focus appears to highlight the entire link.

    Checked the alt text and definitely more descriptive.

    Going to mark

    • nod_ โ†’ committed 82984b58 on 10.4.x
      Issue #3273099 by rkoller, jaydeep_patel, tinto, smustgrave: Fix several...
    • nod_ โ†’ committed 843bf350 on 11.x
      Issue #3273099 by rkoller, jaydeep_patel, tinto, smustgrave: Fix several...
  • Status changed to Fixed 5 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance nod_ Lille

    Committed and pushed 843bf350040 to 11.x and 82984b589f5 to 10.4.x. Thanks!

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

Production build 0.71.5 2024