Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

feat(rome_js_analyzer): partial implementation for rule noNoninteractiveElementToInteractiveRole #4007

Merged
merged 5 commits into from
Dec 21, 2022

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Dec 7, 2022

Summary

Start implementing #3816
Closes #3950

In order to implement this rule, new metadata were necessary. This metadata describes some of the existing roles, by adding the "concepts".

Concepts are information that tells us how an HTML can be mapped via ARIA roles, for example:

<button>Hit me</button>

Can be mapped with ARIA roles like this:

<input type="button">Hit me</input>
<span role="button">Hit me</span>

This kind of information will be needed for another rule.

Not only that, though. These metadata are also useful to identify whether some HTML elements are non-interactive and if some ARIA roles are interactive.

  • ARIA roles are interactive if they have "widget" in their list of roles
  • HTML elements are deemed non-interactive if they belong to some ARIA role, and if that role is NOT interactive. The rest of the HTML elements can be seen as interactive.

For example, h1 is NOT interactive because there's a role called "heading" that contains it, and this role is not interactive - it doesn't contain "widget"

The implementation of the rule still lacks some logic that I need to figure out, so the rule is still under heavy development.

Test Plan

I added some test cases to make sure the rule works, but I plan to add more test cases once the implementation of the rule is correct.
The old rule had a bug, which I fixed in this version of the rule.

@ematipico ematipico requested review from leops, xunilrj and a team as code owners December 7, 2022 14:36
@netlify
Copy link

netlify bot commented Dec 7, 2022

Deploy Preview for docs-rometools ready!

Name Link
🔨 Latest commit 14afb98
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/63a2d200a83dc00009eb9228
😎 Deploy Preview https://deploy-preview-4007--docs-rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@ematipico ematipico force-pushed the feat/no-non-interative-elements branch from e1cbd12 to bdd63f2 Compare December 7, 2022 14:43
@ematipico ematipico marked this pull request as draft December 7, 2022 15:58
@ematipico ematipico changed the title feat(rome_js_analyzer): rule noNoninteractiveElementToInteractiveRole feat(rome_js_analyzer): partial implementation for rule noNoninteractiveElementToInteractiveRole Dec 12, 2022
@ematipico ematipico force-pushed the feat/no-non-interative-elements branch from bdd63f2 to 247d6cb Compare December 12, 2022 11:44
@ematipico ematipico marked this pull request as ready for review December 12, 2022 11:44
@ematipico ematipico force-pushed the feat/no-non-interative-elements branch from 247d6cb to e52280e Compare December 13, 2022 09:46
@ematipico ematipico requested a review from leops December 19, 2022 11:05
@ematipico ematipico force-pushed the feat/no-non-interative-elements branch from e52280e to a20ec7c Compare December 19, 2022 11:05
@ematipico ematipico force-pushed the feat/no-non-interative-elements branch from a20ec7c to f67c267 Compare December 19, 2022 12:52
@MichaReiser MichaReiser removed their request for review December 20, 2022 13:01
@ematipico
Copy link
Contributor Author

@leops can I get a review here, please? I need this PR merged in order to continue works around other rules

@ematipico ematipico force-pushed the feat/no-non-interative-elements branch from f67c267 to 6061bfe Compare December 20, 2022 13:37
@ematipico ematipico force-pushed the feat/no-non-interative-elements branch 3 times, most recently from 7f48f69 to 6e3bed1 Compare December 21, 2022 09:17
@ematipico ematipico force-pushed the feat/no-non-interative-elements branch from 6e3bed1 to 14afb98 Compare December 21, 2022 09:29
@ematipico ematipico merged commit 7262783 into main Dec 21, 2022
@ematipico ematipico deleted the feat/no-non-interative-elements branch December 21, 2022 09:33
@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 48647 48647 0
Passed 47582 47582 0
Failed 1065 1065 0
Panics 0 0 0
Coverage 97.81% 97.81% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6093 6093 0
Passed 1754 1754 0
Failed 4339 4339 0
Panics 0 0 0
Coverage 28.79% 28.79% 0.00%

ts/babel

Test result main count This PR count Difference
Total 639 639 0
Passed 565 565 0
Failed 74 74 0
Panics 0 0 0
Coverage 88.42% 88.42% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16740 16740 0
Passed 12817 12817 0
Failed 3923 3923 0
Panics 0 0 0
Coverage 76.57% 76.57% 0.00%

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add to rome_aria metadata about baseConcepts
3 participants