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

'landmark-no-duplicate-banner' & 'landmark-no-duplicate-contentinfo' return incorrect element source #978

Closed
iamrafan opened this issue Jun 27, 2018 · 8 comments
Assignees
Labels
Milestone

Comments

@iamrafan
Copy link
Contributor

All the elements that fail these two rules are return as related nodes unlike in the case of duplicate-id failures, where the first matching node is returned as a failure node and the rest of the nodes are returned as related nodes

image

axe-core version: 3.0.3
axe-Coconut version: 3.4.0-alpha.2
@iamrafan iamrafan changed the title 'landmark-no-duplicate-banner' & 'landmark-no-duplicate-contentinfo' return incorrect element source in the issue description 'landmark-no-duplicate-banner' & 'landmark-no-duplicate-contentinfo' return incorrect element source Jun 27, 2018
@WilcoFiers
Copy link
Contributor

This is the same issue as #878.

@WilcoFiers
Copy link
Contributor

Proposal to use the after function to turn the related nodes into matched nodes, so that the result would go from look like this:

[{
   target: 'html'
   relatedNode: [{
     target: '#div1'
   }, {
     target: '#div2'
   }, {
     target: '#div3'
   }]
}]

to looking like this:

[{
  target: '#div1',
  relatedNodes: [{
    target: 'html'
  }]
}, {
  target: '#div2',
  relatedNodes: [{
    target: 'html'
  }]
}, {
  target: '#div3',
  relatedNodes: [{
    target: 'html'
  }]
}]

@marcysutton
Copy link
Contributor

We also talked about limiting results to common ancestors, so we don't get a bunch of extra noise. This will take the region rule from one result to many, to make it easier to understand.

@WilcoFiers
Copy link
Contributor

Me and Jey have been looking into this, and it isn't as simple as tweaking the data in "after". Unfortunately axe-core doesn't let you flip related nodes and selected nodes. We'd have to rewrite these rules to do this I think, which is a bummer. I do think that's probably the right way to do it.

@jeeyyy jeeyyy removed their assignment Jan 15, 2019
@WilcoFiers
Copy link
Contributor

Talking to Steve about this. The way to deal with this is to select all the landmarks in the rule, and use the after method to remove any duplicates after the first. This would be similar to how we do it in #1787 and #1649.

@jeankaplansky
Copy link
Contributor

new rule landmark-no-duplicate-main infrastructure created 1/27/2020

@jeankaplansky
Copy link
Contributor

landmark-no-duplicate-main rule create in axe-core rule help and release notes 2/03/2020

@padmavemulapati
Copy link

Ensuring no duplicate landmarks , verified with the latest axe.
image

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

No branches or pull requests

7 participants