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.
focus outline is covered in most parts by the preview image on the image style page
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

Update the proposed resolution
Respond to #8
add before/after screens shot to the issue summary, or links.
Review

User interface changes

Before:
edit image style page with the large 480x480 decorative image in focus and on the right hand the devtools showing the markup of the sample image and its alt text

After:
edit image style page with the derivative decorative image in focus and on the right hand the devtools showing the markup of the sample image and its alt text

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3273099

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rkoller created an issue. See original summary.

rkoller’s picture

Issue summary: View changes
lauriii’s picture

Component: Claro theme » image system

This bug exists in Seven too, moving to the image system component.

tinto’s picture

2. After the focus was on the Edit of machine name: large [Edit] the focus disappears on the next tab. where the focus is going to i was unable to figure out yet. but the focus is hidden for one tab that is for sure.

This part is covered by: #2852724: Machine-name field is not effectively hidden from keyboard and screen reader users. It is awaiting (accessibility) review.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

tinto’s picture

Issue summary: View changes

Improving the issue summary a bit to improve legibility.

tinto’s picture

StatusFileSize
new474 bytes

As there are two proposed solutions in the issue summary, here's a patch for the least severe change (Problem 1 - option 2). It fixes the size of the clickable area holding the image, by making it the exact size.

This patch basically adds a display: block; to both the parent <a> element to make it the same size as the image, and to the <img> element to prevent the weird whitespace underneath the image.

This patch does not address Problem 1 - option 1. If we want to get rid of the clickable image entirely, that would require a different patch, but I thought I'd start with the less severe change first.

Please feel free to contribute your thoughts in the comments. :)

rkoller’s picture

StatusFileSize
new75.31 KB
new185.07 KB
new168.64 KB

Thanks for updating the issue summary @tinto as well as for an initial patch! Finally got my new computer and local environment setup more or less running so I could test and comment on patches more easily again. quite a few to catch up. :/

I've applied your patch. A few thoughts. I like the idea of just applying a display:block. Tested in the latest Safari (15.6)
focus outline for the preview image on the image style page
and latest Edge (103.0.1264.71). Output is identical. But I wonder if it would make sense to also assign a z-index? Because at the moment the bottom and right part of the focus outline are overlaid by the black extent measures?

And another detail I've noted. would it make sense to add a little more spacing between the original (view actual size) line and the images? because currently in case the view actual size link is in focus the bottom of the outline is hidden in part under the image. applies to edge and safari. but in safari there is another oddity I am uncertain where that comes from. somehow the focus outline is eaten away in part as illustrated in the second image.

edge:
view actual size link focus outline in microsoft edge
safari
view actual size link focus outline in safari

about the clickable image and opening a new issue I agree. so far I haven't found or seen any real benefit and purpose of having those clickable images. the user just ends up on a page displaying just a single image without any interface controls or actions to apply. the user has to rely on the browser interface to navigate back. so from a usability perspective that functionality hasn't much purpose or benefit from my understanding. and as a positive side effect there wouldn't be the need to take care of the current focus issues for the links.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

Issue tags: +wcag247

Tagging for 2.4.7

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Jaydeep_patel made their first commit to this issue’s fork.

jaydeep_patel’s picture

Status: Active » Needs review
StatusFileSize
new156.94 KB

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.

chandansha’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new306.57 KB
new229.42 KB

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

quietone’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

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.

rkoller’s picture

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. 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.
rkoller’s picture

Assigned: Unassigned » rkoller
StatusFileSize
new186.5 KB
new280.74 KB

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 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.

rkoller’s picture

Issue tags: +wcag111, +wcag244

Usability review

We discussed this issue at #3463918: Drupal Usability Meeting 2024-08-02. 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.

rkoller’s picture

Assigned: rkoller » Unassigned
Issue summary: View changes
StatusFileSize
new98.2 KB
new100.48 KB

In regards of the remaining tasks, the usability review in #20 covered the questions raised in #8. 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. I reran the test and the MR passes now
  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?
rkoller’s picture

Title: A Image style page has two unnecessary link tags as well as a hidden focus » Fix several accessibility related issues on the edit Image style page

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

rkoller’s picture

Status: Needs work » Needs review

in regards of #21.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

rkoller’s picture

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.

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

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Definitely agree it's a cleaner look

Only local images are allowed.

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...
nod_’s picture

Version: 11.x-dev » 10.4.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: +string change in 10.4.0

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

Status: Fixed » Closed (fixed)

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