Description
When writing the initial color contrast rule, widgets were voluntarily left out since they need to be tested in different states (e.g. a link can be visited or not, an input can have a valid or invalid value, …) and the rule first needed to tackle the important difficulty of the color contrast itself…
I recently tried to write the corresponding rule for widgets (#1455). My idea is that the rule should check a widget in all states it can be through its life on the web page. In order to approximate that, I am using the CSS pseudo-classes (e.g. :visited
, :focus
, …) and check widgets that match a set of these.
This does leave out various states of "ARIA+JS" widgets that change appearance due to scripting rather than selectors. For example, a <span class="link" role="link" onclick="this.class='visited'">
would only be checked in its default state, not in its visited state since that is not reflected in pseudo-classes (links are maybe not too often in that situation, but other widgets are and links tend to be an easier example to reason about…)
Wilco thinks this is not good enough. I think this is not perfect but is valuable (and will flag real issues, even if not all of them). See further discussion at #1455 (comment)
So, we probably need more brainstorming and ideas on how to shape out that rule.