-
-
Notifications
You must be signed in to change notification settings - Fork 638
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
Div actionverbs withattributes rule #787
base: main
Are you sure you want to change the base?
Div actionverbs withattributes rule #787
Conversation
…alled in div-has-apply rule
…i-has-apply-test div with apply should be flagged
…- hasApplyText-test
… well e.g. delete
…ghlight that both are missing not just one
…ly - trying to access when expression.type='Identifier' in ast
…s AND trying accessing variable value in heading -hasAccessibleChild util
….name is undefined
Looks like this PR contains three new rules - could perhaps 2 of them be split off into individual PRs, so they can be evaluated on their own merits? |
Hi @Felicia5, thank you for this comprehensive change proposal. You evidently comprehend the purpose of this plugin. From what I understand, you're proposing 2 concepts here:
For assertion #1, yes, it is preferable for interactive element to be constructed with text content. That will reduce the risk of the visual label diverging from the accessible label. But text content isn't strictly necessary. It's a direction I'm willing to consider, but we wouldn't make this rule required. One tenet of the philosophy of this plugin is that the experience in the assistive technology must be correct and one can achieve a correct experience without a text node in an interactive element, using instead ARIA attributes to associate a label to an element that is transmitted to the accessibility tree. Practically, there are several changes to the implementation I will request if you plan to continue with this PR. For assert #2 (apply), the approach here probably won't work. The biggest hurdle is internationalization. We cannot hard code a vocabulary into the plugin and then only in English. Configuration just isn't a scalable solution for this rule give hundreds of languages one might want to translate this rule into. I recommend removing this rule from the PR to continue forward with it. Thank you for your enthusiasm and initiative with this proposal! Do you plan to continue with it and complete the required content assertion? |
#Addressed user stories:
#Flowchart:
Table 1
details the first case when the role attribute is defined correctly but there are problems with the tabindex attribute. The attribute can be missing, undefined, has empty string as its value or has wrong value: “-1” or “1”. In these cases the error message “Missing or incorrect tabindex attribute…” should be displayed to the developer.
Table 2
details the second case when the tabindex attribute is defined correctly but there are problems with the role attribute. The attribute can be missing, undefined, has empty string as its value or has wrong value: “main” / “navigation”. In these cases the error message “Missing or incorrect role attribute…” should be displayed to the developer.
Table 3
details the third case when there are problems with both attributes, the tabindex and role attributes. Each attribute can be missing, undefined, has empty string as its value, has wrong value. The wrong values can be “-1” or “1” in case of tabindex attribute and “main” / “navigation” in case of role attribute. Table 3 is constructed by combining the cases of Table 1 and Table 2. Tabindex attribute has five different incorrect cases. Each case can be combined and listed with the five different incorrect cases of role attribute. It does not matter if the attributes are present in order of tabindex=”0” role=”button” or role=”button “ tabindex=”0”. Therefore, following the laws of combinatorics the number of invalid cases is 5 x 5, which is 25 different invalid cases. In these cases, the error message “Missing and/or incorrect attributes…” should be displayed to the developer.