WordPress.org

Make WordPress Core

Opened 19 months ago

Closed 3 months ago

#39045 closed defect (bug) (fixed)

W3C Validator warning: Attribute aria-required is unnecessary for elements that have attribute required.

Reported by: henry.wright Owned by: lakenh
Milestone: 4.9.5 Priority: normal
Severity: normal Version:
Component: Comments Keywords: required-fields good-first-bug has-patch fixed-major
Focuses: accessibility Cc:

Description

File: wp-includes/comment-template.php

Screenshot incoming.

Attachments (2)

Screenshot 2016-12-04 at 13.10.24.png (12.8 KB) - added by henry.wright 19 months ago.
39045.diff (2.7 KB) - added by lakenh 4 months ago.

Download all attachments as: .zip

Change History (20)

#1 @davidakennedy
19 months ago

  • Focuses accessibility added

Thanks @henry.wright for the ticket!

A few notes:

  • This is a warning, and not an error, so it's not an immediate problem.
  • I believe the form contains both because there was a time that having both meant a wider range of support for both browsers and assistive technology.
  • This is something the accessibility team needs to discuss to decide if it's the right time to remove one of these.

#2 @davidakennedy
19 months ago

  • Milestone changed from Awaiting Review to Future Release

#3 @afercia
19 months ago

  • Keywords required-fields added

#4 @afercia
19 months ago

  • Version 4.6.1 deleted

#5 @afercia
12 months ago

Yep 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

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


4 months ago

#7 @afercia
4 months ago

  • Keywords good-first-bug added
  • Milestone changed from Future Release to 5.0

#8 @afercia
4 months ago

  • Owner set to lakenh
  • Status changed from new to assigned

@lakenh
4 months ago

#9 @lakenh
4 months ago

As discussed in the ticket and meetings, the aria-required attribute was removed from this template, leaving only required.

This patch only covers the particular file that this ticket is about; there very well could be other areas in WordPress that use both of these attributes.

#10 @SergeyBiryukov
4 months ago

  • Component changed from General to Comments

#11 @audrasjb
4 months ago

Hi and thanks for the patch @lakenh Tested and looks good to me :)

The only other place I found both aria-required and required attributes is wp-admin/includes/media.php, but it will need a separated ticket.

Related: #43415

Last edited 4 months ago by audrasjb (previous) (diff)

#12 @Dualcube
4 months ago

  • Keywords has-patch added

#13 @SergeyBiryukov
4 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 42758:

Comments: Remove unnecessary aria-required attribute from comment_form(), added with the function in [12810].

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 lakenh, afercia, davidakennedy, henry.wright.
Fixes #39045.

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


3 months ago

#15 @danieltj
3 months ago

  • Milestone changed from 5.0 to 4.9.5

As per today's bug scrub, moving this forward for inclusion in 4.9.5.

#16 @danieltj
3 months ago

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

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


3 months ago

#18 @ocean90
3 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 42849:

Comments: Remove unnecessary aria-required attribute from comment_form(), added with the function in [12810].

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.

Merge of [42758] to the 4.9 branch.

Props lakenh, afercia, davidakennedy, henry.wright.
Fixes #39045.

Note: See TracTickets for help on using tickets.