-
Notifications
You must be signed in to change notification settings - Fork 266
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
F87 and custom-styled form controls #1007
Comments
I would say this practice is fine, and doesn't clash with the intent of F87 (since F87, from my reading, is intended to prevent situations where the CSS pseudo elements are the ONLY place where this additional content is defined/presented, whereas the custom checkbox/radio scenario is a progressive enhancement to what is already defined in the markup). Yes, custom stylesheet users may be affected if their custom stylesheets don't cover these situations...but that is up to the users and their custom stylesheets. And yes, if users disable stylesheets altogether, then they'll just see the regular unstyled checks/radios. |
If I understand it correctly, it is as follows:
Unfortunately, F87 was not properly adapted to the new situation and the examples contradict the mentioned intention. You get a better impression with ARIA24. According to ARIA24 it would be okay if the CSS graphics were marked with In your example, however, the checkboxes and radio buttons are not created with CSS font icons (which can be overwritten with userstyles), but with background color and the border attribute. This should not be affected by the relevant userstyles. The problem, however, is that the checkboxes and radio buttons are not visible when adjusting the contrast (the radio buttons in both states, the checkbox only if it is not checked). To what extent High Contrast Mode must be supported according to WCAG is very controversial here. Personally, I consider the wrong display in the High Contrast Mode to be a violation of SC 1.3.1. Also not nice (though not a violation of the WCAG) is that with CSS disabled, the labels are in front of the radiobuttons and checkboxes and not behind them. However, the example includes 2 violations of the WCAG:
|
See also: #907 |
I'd say (chair hat off) that this is a separate technique from (only) adding content with CSS. In F87 it is talking about turning CSS off and that content disapearing. In that technique from W3schools, it is hiding accessible content behind inserted content, so when you turn styles off you still have the default content. Keep in mind there are two scenarios for user-adjusted styles:
F87 helps in the first case. There is some discussion at the moment about requiring visual indicators, and whether user-side CSS could acheive that. Like the W3schools example, case (2) an be affected because the element the user's CSS would act on is hidden. However, there isn't a decision on that yet. Do the above comments answer the question @JamesCatt? |
It is a user scenario, there are aspects of WCAG to help with that e.g. F87. ARIA24 is aimed more at a scenario where there is more limited over-riding, e.g. changing font-styles. The core is that (where there are appropriate structures available) the design is represented in the code (for 1.3.1). |
@alastc In general, I would like to see that the recommended techniques and examples do not violate the WCAG: for example, when I look at https://www.w3.org/WAI/WCAG21/working-examples/aria-icon-font-img-role/, I find that the contrasts of the stars are not sufficient (SC 1.4.11) and when adjusting the text spaces, the stars are not displayed correctly (SC 1.4.12). |
The 'content' is in the source code, each example in ARIA has an alt text / label.
In general I would to, but we're all volunteering our time trying to get as much done as we can, please feel free to make a pull request to fix the aria-icon example. |
Does this mean: If users completely overwrite or disable CSS in the browser according to WCAG, do they have to display alt texts and ARIA labels? I've never read about that. If so, it should certainly be mentioned in the Understanding.
I'd love to do that, but I'm either too stupid or the usability of GitHub is too bad: I haven't figured out how to do a single PR yet. With me, all changes are always assigned to the same PR. See #912 |
It means that in the millions of ways websites can put things together, and the millions of ways users can adapt websites, there are certain things that have been identified to help. We can't document every combination, and it would probably be counter productive if we did. From #912 I can't tell what the source repository was. I think you need to fork the WCAG repo into your own account, create a branch, make the changes, and then make a PR back to the W3C's repo: |
Related to F87, we discussed this in #433 and actually I think that we came to the wrong decision. Since CSS can be a technology that is relied on, there is no reason that the information needs to be viewable when CSS is turned off in a browser. If the content is conveyed to assistive technologies appropriately then using pseudo elements to deliver that content is fine. Last time we discussed this the AT support was not as solid as we would like, so doing this isn't thought to be the best way to deliver content, but it shouldn't be a failure either. |
Thanks for the pointer to the old issue, I re-reviewed that. Previously we focused on font-icons, but there are a couple of different cases here:
What we were not focusing on before was the CSS-inserted content, which could be be important, such as things programmatically created from hidden attributes. E.g. the tooltips on the github editor buttons are added via pseudo elements. The font-icons technique (ARIA24) means that people overriding fonts can stop over-riding those items (only). From a user point of view I can still see three issues:
I agree that CSS can be 'relied on' in an accessibility supported sense, but it is also a very manipulable technology (by design), which is why we have text-spacing and input-purpose. Turning CSS off is a convenient proxy test-method (if we still agree that's appropriate), without that we'll have to get more granular.
People with more extreme CSS over-rides don't have a mechanism to avoid killing-off pseudo element content, or to understand the programmatic alternatives. There isn't a way (that I know of) to consistently show the accessible name of something, or to avoid overriding whatever custom element (or inline style) the author used to generate the content. ARIA24 was a method of tackling that problem for font-icons (supporting scenario 2 above), but other uses (like the examples in F87) are still a problem as there is no 'hook', no predictable structure to target. Content added by before/after pseudo selectors is still very second-class, it can't provide any structure information and can't be 'found' by the browser. In relation to 1.3.1 it is content conveyed by the presentation layer, but it's presentation is not programmatically determinable or in findable text. |
If I take this seriously, examples 1-3 on ARIA24 must be removed because they generate CSS content that is relevant and would not be visible on your 2 issues. Only example 4 could remain because the content here is decorative. The problem could be partially solved (issue 2) by inserting the icons in ARIA24 not as CSS content, but in the HTML source code. |
Hi all, thanks for the spirited discussion. In retrospect, I realize that citing the W3Schools example wasn't ideal, since it arguably also fails F3 for using a Example without
|
I think:
|
I'm going to bump this issue again. Pseudo-content is now very broadly supported in all major browsers and assistive technologies (IE being an exception in some cases). Browser are also now supporting alternative text for pseudo-content (https://www.w3.org/TR/css-content-3/#alt)/ F87 is overly broad in its prohibition of CSS-generated content (further verified by ARIA 24's sufficient technique which prescribes its use). This is leading to confusion. I believe this failure needs to be scoped to the use cases where pseudo-content actually violates 1.3.1 or removed entirely. |
alternative text for pseudo-content doesn't work in Firefox and IE 11 and not very well in Chrome, see: FreedomScientific/standards-support#367 |
Yes, support is not yet complete for alternative text for pseudo-content, but I don't believe this means that pseudo-content cannot be used for text, links, decorative images, or other things that are supported. |
The current version of F87 includes this note in description:
That would indeed be a common way to test, but it could fail uses that are accessibility supported! |
Can I get a final clarification on this? I have tables that have css content icons in them which expand/hide content. Making them keyboard accessible was ok, but now I am not sure if I am still failing F87 or not despite ARIA24. Ultimately it's question of whether the first case is enough or I need the second one for when user disables css:
|
I would like that too. But there are the following problems with your example independent of F87:
|
The above pull request #1016 is removing the accessible name for the element (edit: this is more a problem with the Elements with I am not sure that this modification (making the text "visibly hidden" instead of using I agree that for the current ticket this "scenario is a progressive enhancement to what is already defined in the markup" as @patrickhlauke said. Even if users blindly override CSS rules, they won't want to view hidden CSS elements. |
It's a common practice to visually hide checkbox/radio buttons and use pseudo elements to provide custom-styled alternatives (for example, see https://www.w3schools.com/howto/howto_css_custom_checkbox.asp)
I'm curious what the WG thinks of this practice and whether or not it should be considered a failure of F87.
On the one hand, it does seem to go against the spirit of F87, as the technique involves using pseudo elements to communicate essential information (i.e., the presence and state of a checkbox or radio button). If a user has a custom stylesheet, this information could be lost.
On the other hand, if a user is indeed using a custom stylesheet with pseudo elements for checkboxes/radio buttons, then it may not actually matter that the author-supplied styling is lost—it would simply be replaced by the user styling.
The current wording of the test scenario is somewhat vague:
This could be interpreted in a way that passes—if the user has custom styles defined for checkboxes/radio buttons and their states which simply override the author-supplied styles, then no information would be lost to the user. It could also be possible for the two sets of styling to conflict in a way that makes it incomprehensible. It really depends on what styles each is introducing and how they interact with one another.
The text was updated successfully, but these errors were encountered: