Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#43415 closed defect (bug) (fixed)

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

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

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 9 years ago.
I added patch for media.php

Download all attachments as: .zip

Change History (13)

#1 @audrasjb
9 years ago

  • Focuses accessibility added
  • Keywords good-first-bug added
  • Milestone Awaiting Review → Future Release

@Shital Patel
9 years ago

I added patch for media.php

#2 @Shital Patel
9 years ago

  • Keywords has-patch added

#3 @Shital Patel
9 years ago

  • Version → 4.9.4

#4 @afercia
9 years 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
9 years ago

  • Component General → Media
  • Milestone Future Release → 5.0

#6 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → 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.


9 years ago

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


9 years ago

#9 @chetan200891
9 years ago

  • Keywords needs-refresh removed

#10 @audrasjb
8 years ago

  • Keywords fixed-major added
  • Resolution fixed
  • Status closed → reopened

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

#11 @SergeyBiryukov
8 years ago

  • Milestone 5.0 → 4.9.9

#12 @pento
8 years ago

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