Skip to content
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

Merged

Conversation

jeeyyy
Copy link
Collaborator

@jeeyyy jeeyyy commented Jun 24, 2018

Checklist for Pull Request

🚨Please review the guidelines for contributing to this repository.

  • Make sure you are requesting to pull a issue/feature/bugfix branch (right side). Don't request your master branch!
  • Make sure you are making a pull request against the master branch (left side). Also you should start your branch off master branch.
  • Kindly prefix the pull request name with DRAFT or FINAL accordingly. For more details, read Rule Design Guidelines
  • Provide a reference to the issue being addressed.

#Reviewing Guidelines

  • For DRAFT PR's, leave any comments you have and approve if you’ve reviewed the entire pull request.
  • Once there have been three such reviews the pull request can be merged.
  • Any comments left will be taken up in an updated pull request, which will be necessary before a FINAL release”.
  • For FINAL PR's, review and approve changes to be merged.

How to Review And Approve

  • Go to the “files changed” tab, there you will have the option to leave comments on different lines.
  • Once the review is completed, find the “Review changes” button in the top right, select “approve” and click “Submit review”

Description

Final PR based on Draft - #163

💔Thank you!

Copy link
Collaborator

@ShadowBB ShadowBB left a 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?

Copy link
Member

@WilcoFiers WilcoFiers left a 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 ")

Copy link
Contributor

@kasperisager kasperisager left a 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.

Source: https://www.w3.org/TR/wai-aria/#requiredState

@WilcoFiers
Copy link
Member

@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:
w3c/aria#787

@kasperisager
Copy link
Contributor

I sure hope I'm wrong for the same reason you mention; it would make implicit values pretty useless.

Brynanders and others added 8 commits July 10, 2018 11:47
fixed quotation mark in second failed test case.
Removed Expectation 2 (created new rule to address this #176)
Removed notes under Expectation 2 that relate to #176
Removed second assumption that relates to #176
Removed 3rd Background reference that relates to #176
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.
@annethyme annethyme dismissed WilcoFiers’s stale review July 11, 2018 08:47

Split out Expectation 2 in seperate rule and edited Assumption. Please see if you can approve changes.

@annethyme annethyme dismissed kasperisager’s stale review July 11, 2018 08:48

Split out Expectation 2 in seperate rule and edited Assumption. Please see if you can approve changes

@annethyme
Copy link
Collaborator

@ShadowBB and @WilcoFiers, I think @Brynanders and I have handled all of your comments.
Could you guys review again?

Copy link
Member

@WilcoFiers WilcoFiers left a 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.

@jeeyyy jeeyyy changed the title FINAL: Rule - SC4-1-2-role-has-required-states-and-properties Rule: SC4-1-2-role-has-required-states-and-properties Jul 16, 2018
@ShadowBB

This comment has been minimized.

@jeeyyy jeeyyy dismissed WilcoFiers’s stale review August 6, 2018 08:08

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)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"for the role are".

@annethyme annethyme dismissed WilcoFiers’s stale review October 1, 2018 14:22

All comments are hopefully handled. Please review again

@annethyme annethyme dismissed stale reviews from kasperisager and nitedog October 1, 2018 14:25

Should be fixed now. Please review again.

Copy link
Member

@carlosapaduarte carlosapaduarte left a 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)"
Copy link
Member

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
Copy link
Member

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).
Copy link
Member

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.

Copy link
Collaborator

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...

Copy link
Collaborator

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)
Copy link
Member

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
Copy link
Member

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.

@annethyme
Copy link
Collaborator

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).
Copy link
Collaborator

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).
Copy link
Collaborator

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"

Copy link
Collaborator

@nitedog nitedog left a 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

Copy link
Member

@carlosapaduarte carlosapaduarte left a 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)

@annethyme annethyme merged commit 4e7a3db into master Oct 3, 2018
@jeeyyy jeeyyy deleted the rule-SC4-1-2-role-has-required-states-and-properties branch January 3, 2019 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rule Use this label for a new rule that does not exist already
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants