-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WCAG22 - focus visible enhanced #936
Conversation
I am very pleased that the new criterion clarifies many of the ambiguities and closes loopholes that existed with SC 2.4.7. I have the following comments:
My notes 1-3 refer to various web pages that I had to check in the past for the WCAG, i.e. they are not made-up examples, but problems that occur in practice. |
One overall comment and two specific ones:
Ir is very common that different parts of a page have different focus styles, this should not be discouraged
I fail to see why this should ever be necessary, beyond ensuring contrast between focused and unfocused state is above 3:1 |
Precisely because it is very common, I mentioned the problem that arises in this context. Have you looked at my example? If we can't make a hard rule out of it for the SC, I suggest that we at least address the problem in Understanding.
The SC says: "all of the following are true: ... Minimum area ...". I.e. if only the font color changes with a contrast of more than 3:1 (or only one letter changes the color) the area of the color change must be larger than 2px × length of the text. |
Jaw-test wrote:
It is already baked in that the focus is a state of a user-interface component, and all the examples keep the focus indicator closely related to the element. I've never come across an example like your codepen, probably because it would take effort to design-in and if you do that, you try to do a better job than the defaults?! I'm really struggling to see how to include that when very, very similar code would be fine: Have others found tricky examples like this, is it something we should add to the understanding doc?
I can see that would useful in some circumstances, but I think it would be harmful in others. For example, if your navigation bar is on a dark blue background, then a white/yellow indicator would be best. If the rest of the links are on a white background, you need a completely different indicator. We have to trust that if people are designing things in, it will generally use colour schemes / brand-guidelines to make things consistent where possible.
I think it is worth pointing out that this is a worst-case example (perhaps I should change that?!). If you use a different hue for the indicator, then for >90% of people it will be completely obvious. E.g. a 2px purple outline around a blue button would be visually obvious to most (including low-vision folk), but could have a 1:1 contrast ratio. Therefore I used the worst case to show that for those who can't see the hues, this is what they get. I went through a lot of examples with the Low Vision task force, the 1px out-set outline was one of the worst performing (that passed), but logically if we increase that requirement we are then ruling-out some indicators that perform well.
NB: I've added the SC text to the understanding preview doc so it's easier to find. We went through a few itterations, I'm open to suggestions. Note that when published "focus indication area" is a defintion that links to this statement:
Jaw-test wrote:
Bounding box is stated to be of the "focused control", so generally the box the focusable element creates. There are some instances where it isn't a box, which is why we used the (fairly well known) concept of bounding box, but it's rare.
Indeed, and if that puts people off using a method that is difficult to track visually, I won't loose sleep. |
Personally I find switching between different focus styles confusing and some harder to spot. For example on one social media site I tab around to buttons which have a border. When I tab agIn it turns out that I am now on a link which is underlined. The underline for a link to identify focus is problematic because it’s not clear to me if the link is always underlined or not. So the switch between styles has me guessing and the underline is ambiguous to me. |
@mraccess77 I can appreciate that, but I don't think we can give a blanket "use one style" across the whole page? With this SC, at least that underline would not pass. It would either have to be 2px thick, or use a complete border... |
As I already wrote, I didn't come up with this idea, but found it out several times during the test. The problem occurs quickly: a focus frame is used, which is around the whole element, but hidden by the surrounding elements due to Your example, slightly altered: I've seen that before.
I had suggested that the focus should be "consistent". I.e. not that it must be identical. Consistent means e.g.
Unfortunately, I don't trust the developers because I've seen too many negative examples already. I'd like it if the hint could at least make it into the Understanding. |
That seems to be a different thing, I'm confused. The first example had a block appearing between links, making it confusing which it was associated with. That's what I was asking for further examples of (from other people), to see if it is common. You're reply above makes it seem like the focus indicator is getting cut off, which is a different issue (IMO). For the ARIA practices example, do you mean this page? It looks ok to me (in FF), so I'm not sure what the issue is, perhaps it was fixed? |
I think it might also be useful for us to talk through something like Material design and see what fails which SC. https://material.io/design/interaction/states.html#focus
|
I did look at some examples already (with the 1px * longest side threshold), see examples 13-21 here. I agree with 1, 2 & 4. Not sure why 3 would fail 1.4.11, which bit do you mean? Is the block as a whole a User Interface Component? |
…c/wcag into wcag22-focus-visible-enhanced
@alastc wrote
I would treat the card as a whole component here because the whole thing is focused. |
I agree we probably can't require this because it's not practical. However, it can be very confusing for users and add cognitive load. |
Because the focus frame around the entire element is hidden on some sides, it is only visible on one side and therefore cannot be clearly assigned to the element. I have only simulated this in my example. The cause in CSS is different, the visual effect is the same.
Yes, this page.
If a SC is difficult to test, it doesn't cause designers to do things differently, because they don't care. But the accessibility testers have a problem. That's why a tool would be good, which helps with the test. |
The focus is poorly visible when the following occurs, especially if several of them occur simultaneously:
All this, as far as I can see, is not currently a violation of any SC (not even 2.4.11). However, all this can make keyboard operation very difficult because focus visibility is a result of 2 things:
Therefore, I am in favour of considering whether 2.4.11 can be made clearer in this respect or whether other SCs can be used (e.g. SC 2.4.3 could be extended to require the focus order to correspond to the visual representation as well). |
@JAWS-test wrote:
That's ok, we're testing the visuals.
Most of those aren't really solvable by defining the focus change at the element level. Unless we add some page level requirements and a tracking animation (like this demo page), I don't think expanding this SC will help (without making it confusing and overly-broad). NB: For particularly egregious examples of focus order, or hidden links, we do fail them under 2.4.3 focus order. If you'd like to pursue those aspects could you open a separate issue please? |
I agree with that. Therefore, I would come back to my original proposal:
|
I'm not sure what this means. An interactive element must be able to receive focus (via 2.1.1), and when that happens, it must have a visible focus indicator (2.4.7 + this SC). We've got definitions for user-interface component and 'focus', I'm not sure what "assigned" means that isn't already covered? |
We have that sort of information for the positive factors (e.g. more size, more change etc). I take the point that we don't talk about the negative factors which are not covered. It isn't something we usually do, as we try to keep the understanding docs based on the SC text. I'm considering a small section towards the bottom such as: The factors outlined above help to make the focus seen more easily. There are also contextual factors to be aware of such as:
That is what the 'contrast of thickness' section says:
|
It is about the problem in my first example at codepen. I'm not sure if this is already covered? There are various forms of this problem. I created an example where the entire focus frame is around the element, but the focus frame is far away from the element, so it also includes other interactive elements - even then it's not clear which element has the focus. |
Ah, I'd probably term that as "focus must be clearly associated with the element".
I think with the definitions of user-interface component ("a part of the content that is perceived by users as a single control for a distinct function") and focus ("The point where the user’s input interacts with the web page.") that is covered. The focus indicator needs to be part of the UI component, so nesting is intrisically a problem. You could still have (odd) examples like your codepen, but without dictating design in some way, I'm not sure what measure/test we could use to eliminate that. |
Test if focus indicator is clearly associated with the element |
Anything with the word 'clearly' in it is going to be too subjective, how could the association be defined? There are many aspects: proximity, spacing, lines, backgrounds. They all work together as 'design', so it's a hard concept to define. |
Maybe "Test if focus indicator is associated with the element" is better? I do not want the focus indicator to be clearly and simply assigned to the element, but rather to be able to be assigned to the element at all. In my examples, the focus indicator cannot be assigned. That is why I would classify my examples as violations. I don't think this is subjective. Every tester can clearly decide whether a focus indicator can be assigned to an element or not. There is only yes or no, but none perhaps. The Understanding could give examples of how this criterion is fulfilled and not fulfilled. |
I analyzed the example from
Did I misread the rules? |
Hi @AutoSponge, For that technique (preview page for others to follow along), from the SC text:
I'm not sure where you got 3px from? -Alastair |
I believe the generator issues are fixed and this pull request can now be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technical review only, this seems to generate ok now.
There are quite a few changes from this PR implementing focus-visible-enhanced.
The SC changes will appear in the editors drafts when merged.
See the understanding doc preview for the main explanation.
Also changed:
This PR thread is ok for comments, but if you want to suggest a change or have an objection to thise PR, please open a separate issue and tag this PR (#936), and label with focus-visible-enhanced.
It is unusual for us to move a WCAG 2.0 SC from AA to A, but this was the prefered option from this survey and meeting.
Preview | Diff