WordPress.org

Make WordPress Core

#43415 closed defect (bug) (fixed)

Remove "aria-required" attribute when "required" attribute is already used

Reported by: audrasjb Owned by: SergeyBiryukov
Milestone: 5.1 Priority: normal
Severity: normal Version: 4.9.4
Component: Media Keywords: good-first-bug has-patch
Focuses: accessibility Cc:
PR Number:

Description

Quote from Andrea in #39045 :

There was a time when both were needed. Today, it's safe to use just required. Instead, aria-required is for custom, non-native, controls. Also, just stumbled upon a good feedback from Adrian Roselli: https://stackoverflow.com/a/37975985

I found both aria-required and required attributes used in the following file:

  • wp-admin/includes/media.php L. 1672, 1674, 1849, 2756, 2763 and note also that it should use required instead of aria-required at L. 2772.

Related: #39045

Attachments (1)

43415.patch (3.3 KB) - added by Shital Patel 22 months ago.
I added patch for media.php

Download all attachments as: .zip

Change History (13)

#1 @audrasjb
22 months ago

  • Focuses accessibility added
  • Keywords good-first-bug added
  • Milestone changed from Awaiting Review to Future Release

@Shital Patel
22 months ago

I added patch for media.php

#2 @Shital Patel
22 months ago

  • Keywords has-patch added

#3 @Shital Patel
22 months ago

  • Version set to 4.9.4

#4 @afercia
22 months ago

  • Keywords needs-refresh added

@Shital Patel thanks for the patch. A good best practice for patches is to try to not introduce unrelated changes, see onclick and readonly in 43415.patch better to not change them. Also, required is a boolean attribute that means it doesn't need to have a specified value required="required" and the correct syntax is just required.

#5 @SergeyBiryukov
22 months ago

  • Component changed from General to Media
  • Milestone changed from Future Release to 5.0

#6 @SergeyBiryukov
22 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 42759:

Media: Remove unnecessary aria-required attribute from legacy (pre-3.5.0) media functions, added in [7888].

At the time, having both required and aria-required meant a wider range of support for browsers and assistive technology. Today, it's safe to use just required.

Props shital-patel, afercia, audrasjb.
Fixes #43415.

This ticket was mentioned in Slack in #accessibility by chetan200891. View the logs.


22 months ago

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


21 months ago

#9 @chetan200891
21 months ago

  • Keywords needs-refresh removed

#10 @audrasjb
15 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 4.9.9 consideration as seen during accessibility team bug-scrub meeting.

#11 @SergeyBiryukov
15 months ago

  • Milestone changed from 5.0 to 4.9.9

#12 @pento
14 months ago

  • Keywords fixed-major removed
  • Milestone changed from 4.9.9 to 5.1
  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.