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

target property with :root > div > img value #3109

Closed
g-yonchev opened this issue Aug 6, 2021 · 5 comments
Closed

target property with :root > div > img value #3109

g-yonchev opened this issue Aug 6, 2021 · 5 comments
Labels
core Issues in the core code (lib/core) fix Bug fixes pr A pr has been created for the issue

Comments

@g-yonchev
Copy link

Product: axe-core v4.3.2

Expectation: to return a target with which doing document.querySelector(target[0]); to return an html element.

Actual: it returns a target with which doing document.querySelector(target[0]); results with null.

website example: https://kenzdesigns.com.au/
code snippet:

<!doctype html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <title>Document Title</title>
    </head>
    <body>
    <div class="line1">Ethnicraft OLD SADDLE range&nbsp;</div>
    <div class="inner-div">
      <div class="col-xs-6 cat_pro_item">
        <a href="3 Seater">
          <div><img src="https://www.kenzdesigns.com.au/image/cache/catalog/Ethnicraft/20084-N701-3-seater-old-saddle-MAIN-145x200.jpg" class="img-responsive"></div>
        </a>
      </div>
      <div class="col-xs-6 cat_pro_item">
        <a href="1 Seater">
          <div><img src="https://www.kenzdesigns.com.au/image/cache/catalog/Ethnicraft/20082-N701-1-seater-old-saddle-main-145x200.jpg" class="img-responsive"></div>
        </a>
      </div>
      <div class="col-xs-6 cat_pro_item">
        <a href="Corner">
          <div><img src="https://www.kenzdesigns.com.au/image/cache/catalog/Ethnicraft/20080-N701-corner-sofa-old-saddle-145x200.jpg" class="img-responsive"></div>
        </a>
      </div>
      <div class="col-xs-6 cat_pro_item">
        <a href="Ottoman">
          <div><img src="https://www.kenzdesigns.com.au/image/cache/catalog/Ethnicraft/20081-N701-footstool-old-saddle-main-1-145x200.jpg" class="img-responsive"></div>
        </a>
      </div>
    </div>
    </body>
    </html>

when on this snippet I am doing axe.run(document, { runOnly: ['image-alt'] }); it returns

{
  violations: [
    {
      id: "image-alt",
      nodes: [
        {
          html: '<img src="https://www.kenzdesigns.com.au/image/cache/catalog/Ethnicraft/20084-N701-3-seater-old-saddle-MAIN-145x200.jpg" class="img-responsive">',
          target: [':root > div > img']
        }
      ]
    }
  ]
}

which then doing document.querySelector(':root > div > img') it returns null.

I am trying to understand if this is expected behaviour or a bug?

@WilcoFiers
Copy link
Contributor

Wow! That's an odd one. No idea how that might happen, but clearly :root > div > img is wrong. I'll look into it!

@g-yonchev
Copy link
Author

Wow! That's an odd one. No idea how that might happen, but clearly :root > div > img is wrong. I'll look into it!

Thanks, @WilcoFiers

@WilcoFiers WilcoFiers added core Issues in the core code (lib/core) fix Bug fixes labels Aug 9, 2021
@WilcoFiers WilcoFiers added this to the Axe-core 4.4 milestone Aug 9, 2021
@straker straker added the pr A pr has been created for the issue label Oct 14, 2021
@straker straker removed this from the Axe-core 4.4 milestone Nov 10, 2021
@padmavemulapati
Copy link

Verified with the latest dev branch code,
we fixed axe-core to not return that selector anymore
image

@g-yonchev
Copy link
Author

Hello, any updates on this? I am still experiencing the same issue with latest module version axe-core 4.3.5?

@straker
Copy link
Contributor

straker commented Jan 17, 2022

We've completed the changes for this issue and a release is planned for the end of the month that will incorporate the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues in the core code (lib/core) fix Bug fixes pr A pr has been created for the issue
Projects
None yet
Development

No branches or pull requests

4 participants