Closed ajanec01 closed 2 years ago
this whole area has been causing confusion, and there's no clear agreement it seems...
my take on some of these interrelations is here, but not everybody seems to agree https://github.com/w3c/wcag/issues/1775#issuecomment-832110108
Is it a failure of the Non-text contrast criterion if a keyboard focus indicator relies on changing the background colour and the colour of the background in the focused state is than 3:1 with the adjacent background?
With all the controversy on the subject, I would say that C15 clearly violates 1.4.11 and thus should be removed or adjusted
Thinking about it for a bit more, radio buttons and the text field from the live example have a default focus indicator (pulsating caret and a browser outline). The argument could be made that the custom indicators are not required to identify a state and the default focus indicator is enough to pass. I think the examples also pass 1.4.1 for the exact same reason. At the moment, they only pass 2.4.7. Am I right?
caret counts as a focus indication, yes (see https://github.com/w3c/wcag/issues/680). and default focus indicator counts as visual indication (that is not related to just use of color) and is exempt from further non-text contrasts requirements (provided no other styling affects the element and its presentation... i.e. "where the appearance of the component is determined by the user agent and not modified by the author")
Thinking about it for a bit more, radio buttons and the text field from the live example have a default focus indicator
Yes, the elements in the sample file have a default focus that is sufficient. But this is not described in C15, the technique itself uses colors whose contrasts are not sufficient. C15 sounds like the technique could be used without a standard focus - and this is not the case
@ajanec01 based on 1775 the understanding doc for non-text contrast has been updated, see the section "Relationship with Focus Visible" under https://w3c.github.io/wcag/understanding/non-text-contrast.html#figure-two-star-ratings-failing Does that resolve the confusing aspects? It is quite detailed.
Regarding Technique C15, it is only referenced by focus-visible, so anything would work there. It doesn't appear to fail non-text-contrast or focus-appearance due to the default browser indicators as well (tested in FF and Edge). It is dated (I think it was there to highlight the 'new' adjacent selectors?!), but doesn't appear to be an urgent update.
Proposed response:
Hi, @ajanec01
Hopefully these answers to your questions are what you're looking for.
Question 1: "Is changing the background to indicate focus a failure of the use of colour criterion if the hue of the background is changing but the lightness between the two colours is less than 3:1?"
Figure 15 of the updated Non-Text Contrast criterion answers this question:
"The change of background within the component is not in scope of non-text contrast. However, this would not pass Use of color."
The change in contrast ratio between the two states in the example is less than 3:1, so it would fail Use Of Color.
Question 2: Is it a failure of the Non-text contrast criterion if a keyboard focus indicator relies on changing the background colour and the colour of the background in the focused state is than 3:1 with the adjacent background?
[Figure 7](The https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html#figure-two-star-ratings-failing) covers this scenario. If the background color of the focus state is less than 3:1 against the adjacent background, it would fail non-text contrast. Additionally, the "text input using background color" example shows this:
"text inputs that have no border and are differentiated only by a background color must have a 3:1 contrast ratio to the adjacent background".
If you need any more clarification, please let us know. If not, we'll close this issue.
Thanks for the clarification, good to close!
Before this is closed, C15 should be corrected
@JAWS-test Happy to correct that document and the live example. Are you specifically talking about the yellow background that a radio button's label gets when the button is focused?
@fstrr Yes, see https://github.com/w3c/wcag/issues/1847#issuecomment-856576812
C15 updated, so closing this. Thanks @fstrr
Can I please get some clarification about the relationship between the above-mentioned criteria? In the understanding doc for the use of color criterion there is a note that reads:
The way I understand this is that if I had a keyboard focus indicator that relies only on changing the background of an interactive component then if only the hue changes but the difference in lightness between the two backgrounds is less than 3:1 then this is a failure of Use of colour.
The above scenario is a bit more complicated after reading the understanding document for Non-text contrast that says:
Reading this makes me believe that the focus indicator that relies on the change of hue with a contrast ratio of less than 3:1 against the two colours is not a failure of colour only and Non-text contrast. It is also not a failure of focus visible because of the changing hue.
I also understand that the keyboard focus indicator that relies on the change of background with the same hue but different lightness is not a failure of all of the above criteria, because:
It is even more confusing when we take a look at advisory technique C15. In the live example, neither the indicator that uses
background-color: #FF6;
nor the indicator that usesbackground-color: #7FFF00;
have enough contrast ratio with the adjacent background. It looks like this example negates the note in the understanding doc for Non-text contrast.So to summarise my questions: