-
Notifications
You must be signed in to change notification settings - Fork 70
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
Rule: SC4-1-2-role-has-required-states-and-properties #167
Rule: SC4-1-2-role-has-required-states-and-properties #167
Conversation
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.
My comment on the original draft was not implemented:
"This read like a note. I think the assumption itself could be slightly more concise. Something along the lines of "leaving out required states and properties if an implicit value for role is specified in WAI-ARIA is not fully accessibility supported.""
Was there something wrong with this comment?
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.
I don't understand why this second expectation is present - wouldn't it be easier to have a separate rule that just says that any aria-* attribute that's used has a valid value?
Second question, why do we not consider it sufficient for required properties to rely on the default values? It seems to me like that's why that stuff is there - and why so many attributes are required as of 1.1.
I'd also like to see a few more examples for this (and have the ''
replaced with "
)
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.
I second @WilcoFiers' point on leaving out the second expectation and implementing a second rule that validates used ARIA attributes, required or otherwise.
As for not relying on implicit values, this has been quite a point of discussion internally at Siteimprove. Our conclusion was that implicit values cannot be relied on for required states and properties based on the following paragraph from the ARIA spec:
Content authors MUST provide a non-empty value for required states and properties. Content authors MUST NOT use the value undefined for required states and properties, unless undefined is an explicitly-supported value of that state or property.
@kasperisager I'm not sure you're right about that. I did some quick testing, and browsers certainly seem to just assume the default value if you don't set anything. Having default values doesn't also make a whole lot of sense if you than don't allow content authors to use them. I've created an issue on the ARIA github repo, hopefully someone there can give some insight: |
I sure hope I'm wrong for the same reason you mention; it would make implicit values pretty useless. |
fixed quotation mark in second failed test case.
Replaces ' ' with " " in passed test case
Removed second test case which relates to #176
Removed aria-controls value from Passed text case as the property value is now out of scope.
Added second test case to cover the assumption that @annethyme will update.
Updating "Assumptions" to handle comments from ShadowBB, WilcoFiers and kasperisager about support for implicit values.
Split out Passed test case in two, one for state and one for property, and edited note on second Failed test case. Added note for Expectation.
Split out Expectation 2 in seperate rule and edited Assumption. Please see if you can approve changes.
Split out Expectation 2 in seperate rule and edited Assumption. Please see if you can approve changes
@ShadowBB and @WilcoFiers, I think @Brynanders and I have handled all of your comments. |
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.
@annethyme I do not believe that attributes required attributes with default values should be mandatory. We've not had a clear answer from the ARIA group, but it seems fairly obvious that this is how it's intended. As far as I can tell when testing with AT, the default values are used when attributes are omitted.
This comment has been minimized.
This comment has been minimized.
Requested change, argued as not mandatory. Review again.
|
||
### Expectation | ||
|
||
For each test target all attributes listed under [required states and properties](https://www.w3.org/TR/wai-aria/#requiredState) in [WAI-ARIA](https://www.w3.org/TR/wai-aria) for that role are present and [non-empty](#non-empty), unless they have a default value listed under [implicit value for role](https://www.w3.org/TR/wai-aria-1.1/#implictValueForRole). | ||
For each test target, the [required states and properties](https://www.w3.org/TR/wai-aria/#requiredState) for the role is present, unless the attribute has a default value listed under [implicit value for role](https://www.w3.org/TR/wai-aria-1.1/#implictValueForRole). The list of required attributes for a role can be found in [WAI-ARIA 1.1](https://www.w3.org/TR/wai-aria)" |
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.
"for the role are".
All comments are hopefully handled. Please review again
Should be fixed now. Please review again.
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.
Besides all my comments, make sure to replace ´ with ` in several of the examples' comments
|
||
### Expectation | ||
|
||
For each test target, the [required states and properties](https://www.w3.org/TR/wai-aria/#requiredState) for the role are present, unless the state or property has a default value listed under [implicit value for role](https://www.w3.org/TR/wai-aria-1.1/#implictValueForRole). The list of required states and properties for a role can be found in [WAI-ARIA 1.1](https://www.w3.org/TR/wai-aria)" |
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.
The second sentence can be moved to a note, since it is not part of the expectation, but just something to help assess it.
|
||
**Note:** This rule does not test whether the required states and properties has a correct value, only that the attributes are present and [non-empty](#non-empty). | ||
|
||
## Assumptions |
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.
This assumption is confusing to me for the following reasons:
1 - The applicability is for elements with an explicit semantic role. This assumption applies to elements with implicit semantic roles.
2 - The assumption's reason to exist seems to be to justify the applicability. If that is case, then why isn't it just a note on the applicability?
3 - It is hard to read. There are too many negatives (no element that has an implicit semantic role + does not define native attributes). Can't this be rephrased?
|
||
## Accessibility Support | ||
|
||
This rule relies on browsers and assistive technologies to support leaving out [required states and properties](https://www.w3.org/TR/wai-aria-1.1/#requiredState) when an [implicit value for role](https://www.w3.org/TR/wai-aria-1.1/#implictValueForRole) is specified in [WAI-ARIA 1.1](https://www.w3.org/TR/wai-aria-1.1). |
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.
Once more, the applicability is for elements with explicit semantic roles, and this section mentions issues for elements with implicit semantic roles. I'm sorry, but I must be having problems with understanding this rule.
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.
@carlosapaduarte, actually here it is talking about implicit value for roles which is different from the implicit roles. I can see how this is totally confusing. Not sure what to do about it, though since "implicit value for roles" is the term used in the WAI-ARIA spec...
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.
Maybe prefixing or suffixing these terms with "WAI-ARIA" will help clarify the source of these terms (as well as the target of the link)?
|
||
#### Passed example 5 | ||
|
||
Element has required properties (no states required for this role) |
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.
There is a required state (aria-expanded
) but it has a default value, so this is a pass anyway. But the comment needs to be updated.
|
||
## Test Cases | ||
|
||
### Passed |
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.
Add a test case with a value for a state or a property that is non-empty but not correct. The rule should still pass since it does not test the correctness of this value.
Rule changed per comments. Please review again. |
|
||
For each test target, the [required states and properties](https://www.w3.org/TR/wai-aria-1.1/#requiredState) for the role are present, unless the state or property has a default value listed under [implicit value for role](https://www.w3.org/TR/wai-aria-1.1/#implictValueForRole). | ||
|
||
**Note:** The list of required states and properties for each role can be found in [WAI-ARIA 1.1](https://www.w3.org/TR/wai-aria-1.1). |
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.
Minor suggestion: change the link text in the above paragraph from "required states and properties" to "WAI-ARIA required states and properties" or to "required states and properties in WAI-ARIA" or to "required states and properties (WAI-ARIA)", so that you clarify the link target in the link text and can get rid of this note.
|
||
**Note:** The list of required states and properties for each role can be found in [WAI-ARIA 1.1](https://www.w3.org/TR/wai-aria-1.1). | ||
|
||
**Note:** This rule does not test whether the required states and properties has a correct value, only that the attributes are present and [non-empty](#non-empty). |
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.
"whether the required states and properties has a correct value" -> "whether the required states and properties have correct values"
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.
Pending some minor editorial comments, for editor's discretion
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.
Great update. I'm happy with it (@nitedog points out some minor editorial changes that should be addressed)
Checklist for Pull Request
🚨Please review the guidelines for contributing to this repository.
DRAFT
orFINAL
accordingly. For more details, read Rule Design Guidelines#Reviewing Guidelines
DRAFT
PR's, leave any comments you have and approve if you’ve reviewed the entire pull request.FINAL
PR's, review and approve changes to be merged.How to Review And Approve
Description
Final PR based on Draft - #163
💔Thank you!