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

feat(aria-allowed-attr): report violation for non-global ARIA attrs on element without role #3342

Merged
merged 6 commits into from
Jan 13, 2022

Conversation

straker
Copy link
Contributor

@straker straker commented Jan 10, 2022

This change reintroduces the change to report violations on elements without a role for non-global ARIA attrs, which was reverted when we accidentally released it.

This also introduces a fix for custom elements where we will report Needs Review for any custom element that uses a non-global ARIA attribute (rather than a failure).

Closes issue: #3241

@straker straker requested a review from a team as a code owner January 10, 2022 18:34
@straker
Copy link
Contributor Author

straker commented Jan 10, 2022

The error from aria practices seems to be a legit issue on aria practices? The violation reported on the button_idl.html page is from an anchor element which uses aria-pressed, which shouldn't be allowed.

This is the page: https://www.w3.org/TR/wai-aria-practices-1.2/examples/button/button_idl.html

And the error:

{
    "any": [
        {
            "id": "aria-allowed-attr",
            "data": [
                "aria-pressed=\"false\""
            ],
            "relatedNodes": [],
            "impact": "critical",
            "message": "ARIA attribute is not allowed: aria-pressed=\"false\""
        }
    ],
    "all": [],
    "none": [],
    "impact": "critical",
    "html": "<a tabindex=\"0\" id=\"toggle\" aria-pressed=\"false\">\n          Mute\n          <svg aria-hidden=\"true\" focusable=\"false\">\n            <use xlink:href=\"#icon-sound\"></use>\n          </svg>\n        </a>",
    "target": [
        "#toggle"
    ],
    "failureSummary": "Fix any of the following:\n  ARIA attribute is not allowed: aria-pressed=\"false\""
}

lib/checks/aria/aria-allowed-attr.json Outdated Show resolved Hide resolved
@straker straker merged commit fb5d990 into develop Jan 13, 2022
@straker straker deleted the aria-allowed-custom-elms branch January 13, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants