Comments (8)
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?
from act-rules.github.io.
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."
Pass: "ID [attribute-value] is unique on the page."
from act-rules.github.io.
I suggest adding this additional assumption, and adjusting the steps and fail/pass as follows:
Assumptions
- Assumes a full page has loaded to enable comparison.
...
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."
Pass: "All id attributes are unique on the page."
from act-rules.github.io.
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
...
from act-rules.github.io.
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
from act-rules.github.io.
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.
from act-rules.github.io.
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
from act-rules.github.io.
This looks good to me. Feel free to create a PR with this.
from act-rules.github.io.
Related Issues (20)
- [chore] Check for missing links (definition) in Glossary HOT 1
- [chore] Update ARIA 1.1 links HOT 1
- Add a test for missing squar-bracket links HOT 1
- meta-refresh rules, add explanation of meta element [bisz58] [bc659a]
- Clarify that "Image resource" can be any supported image format [0va7u6]
- Audio or video element that plays automatically has a control mechanism (4c31df): Inapplicable example 2 has audio
- "Zoomed text node is not clipped with CSS overflow": "link to a full version": source unclear HOT 4
- Verbose examples (rules format) HOT 11
- [4b1c6c]: CG Discuss: Remove rule "Iframe elements with identical accessible names have equivalent purpose " HOT 5
- Form field has non-empty accessible name [e086e5]: add 1.3.1 and 2.5.3 HOT 1
- Multiple <title> tags in a web page HOT 3
- Passed Example 2 of "HTML page has non-empty title" rule is quite ambiguous HOT 3
- "translations into a ..." links are pointing to the wrong URL - Meta viewport allows for zoom (proposed) - b4f0c3 HOT 2
- Passed Example 3 doesn't pass in Chrome - HTML images contain no text [0va7u6] HOT 1
- Add text-shadow failure - Text has minimum contrast [afw4f7]
- "Links with identical accessible names and same context serve equivalent purpose" [fd3a94]: Failed example 2 does not have **same** context
- "Programmatically Determined Link Context" definition is too broad HOT 4
- "Links with identical accessible names and same context serve equivalent purpose" [fd3a94]: Failed examples 4-8 have *huge* images HOT 1
- HTML page has non-empty title [2779a5]: Shadow root example
- Do branch publish for easier reviewing of PRs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from act-rules.github.io.