Giter VIP home page Giter VIP logo

Comments (8)

WilcoFiers avatar WilcoFiers commented on May 20, 2024 1

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.

EmmaJP avatar EmmaJP commented on May 20, 2024 1

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.

EmmaJP avatar EmmaJP commented on May 20, 2024

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.

EmmaJP avatar EmmaJP commented on May 20, 2024

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.

WilcoFiers avatar WilcoFiers commented on May 20, 2024

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.

EmmaJP avatar EmmaJP commented on May 20, 2024

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.

WilcoFiers avatar WilcoFiers commented on May 20, 2024

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.

WilcoFiers avatar WilcoFiers commented on May 20, 2024

This looks good to me. Feel free to create a PR with this.

from act-rules.github.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.