Make WordPress Core

Opened 7 years ago

Last modified 4 years ago

#42780 new enhancement

Code Editor: Linter (HTMLHint) should show error if checkbox doesn't have associated <label>

Reported by: shooper's profile shooper Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9
Component: External Libraries Keywords: needs-patch
Focuses: accessibility, javascript, rtl Cc:

Description

The Custom HTML Linter should show an error if an checkbox field does not have an associated label element. This would be a good improvement for accessibility.

To reproduce:

  1. Create a custom HTML widget
  2. Enter the following code:
<input type="checkbox"> Checkbox Label
  1. No warning/error appears.

Change History (11)

#1 @westonruter
7 years ago

You could write a custom HTMLHint rule to enforce this, but a warning is probably better than an error.

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


7 years ago

#3 @afercia
7 years ago

  • Focuses javascript added
  • Version changed from trunk to 4.9

Discussed during today's accessibility bug-scrub. Yes it would be great to have the linter warn for accessibility errors, not just the ones related to a checkbox though :) Will defer the decision to the editor and widgets teams, as we're not even sure it's technically feasible.

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


7 years ago

#5 @westonruter
7 years ago

  • Component changed from Widgets to General
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from Custom HTML Widget Linter should show error if checkbox doesn't have associated <label> to Code Editor: Linter (HTMLHint) should show error if checkbox doesn't have associated <label>

#6 @netweb
7 years ago

  • Keywords needs-patch added

There's a pull request for HTMLHint already created, sadly not merged for this:

Unfortunately, it appears the HTMLHint project is unmaintained for now, there's been no response from the maintainer in ~6 months, there are quite a few forks though I'm not sure if it would be possible to use a fork

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


6 years ago

#8 @sabernhardt
4 years ago

That pull request was merged in HTMLHint earlier this year.

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


4 years ago

#10 @sabernhardt
4 years ago

  • Component changed from General to External Libraries

The current HTMLHint version included in WordPress is 0.9.14, and the first version with the label-checking feature was 0.13.0

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


4 years ago

Note: See TracTickets for help on using tickets.