validator icon indicating copy to clipboard operation
validator copied to clipboard

aria-readonly on role="slider"

Open babielmam opened this issue 3 years ago • 0 comments

According to the spec, aria-readonly can be used on elements with role slider, see https://w3c.github.io/aria/#aria-readonly

Equivalently it is described in the spec for role slider as supported property, see https://w3c.github.io/aria/#slider

However, the validator says, that it cannot be used on a div element. That is of course correct, but it should check the role of the element in this case, to see whether the element has a different role.

Code to reproduce error:

<!DOCTYPE html>
<html lang="">
<head>
<title>Test</title>
</head>
<body>
<div role="slider" aria-valuemin="1" aria-valuemax="10" aria-valuenow="5" aria-valuetext="5 / 10" aria-readonly="true"></div>
</body>
</html>
Error: Attribute aria-readonly not allowed on element [div](https://html.spec.whatwg.org/multipage/#the-div-element) at this point.

babielmam avatar Sep 12 '23 08:09 babielmam