-
Notifications
You must be signed in to change notification settings - Fork 66
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
SC4-1-1-id test procedure may only check first id and requires full page load #46
Comments
I suggest adding this additional assumption, and adjusting the steps and fail/pass as follows: Assumptions
... Selector Select all elements that match the following CSS selector: *[id] Step 1 If there is no list called 'knownIDs', create an empty list 'knownIDs'. Step 2 For each element, check if the id attribute value exists in 'knownIDs'. if yes, return step2-fail else, add the value for the id attribute of the selected element to 'knownIDs' Step 3 Confirm there were no fails. if yes, return step3-pass ... Fail: "ID [attribute-value] is duplicated on the page." |
I don't think we need to do step 1. We can simply say to check if the ID matches that of another element selected by this rule that there is a failure. That way we compact things in just one step. WDYT? |
So use the node list from the selector as the list of known IDs. That is nice and tidy. Something like below? With assumption and fail/pass as I previously suggested. ... Selector Select all elements that match the following CSS selector: *[id] Step 1 For each element, check if the id attribute matches any other selected element's id attribute. if yes, return step1-fail Step 2 Confirm there were no fails. if yes, return step2-pass ... |
You could just do this: Step 1 Check if the id attribute matches any other selected element's id attribute. if yes, return step1-fail Else return step2-pass |
Not really, because it should check the whole page before returning a pass. The success criteria requires all IDs in the web-page to be unique, so it cannot pass just because one ID is unique. Hence the additional assumption as well as the additional step before returning a pass. |
True, but that's handled by aggregation. The selector finds a bunch of elements, those elements are tested one by one, by going through the test steps. Once that's done the results are aggregated. So if any one of them fails, the page fails. See Aggregation: https://auto-wcag.github.io/auto-wcag/pages/structure/aggregation.html |
Sometimes it's useful to know about things like that. Combining all the above gives something like: ... Assumptions Assumes a full page has loaded to enable comparison. Selector Select all elements that match the following CSS selector: *[id] Step 1 For each element, check if the id attribute matches any other selected element's id attribute. if yes, return step1-fail else, return step1-pass ... Fail: "ID [attribute-value] is duplicated on the page." |
This looks good to me. Feel free to create a PR with this. |
Current rule https://github.com/auto-wcag/auto-wcag/blob/master/_rules/SC4-1-1-id.md includes:
Assumptions
no known assumptions
...
Selector
Select all elements that match the following CSS selector: *[id]
Step 1
...
Fail: "The ID of this element has occurred before on this page"
The text was updated successfully, but these errors were encountered: