target property with `:root > div > img` value
See original GitHub issueProduct: 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 </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?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
<img>: The Image Embed element - HTML - MDN Web Docs
The above example shows usage of the <img> element: The src attribute is required, and contains the path to the image you want...
Read more >Using the image tag in React - Dave Ceddia
When you img in a React component, the the src prop needs to be point ... the public folder as the “root” directory...
Read more >How to Target the DOM in Vue - Telerik
In jQuery , you would select an element by targeting it with the $() function, and that would open up a wide variety...
Read more >I want to change src property of image using :target. - Treehouse
I want to change src property of image using :target. I set img id to color. Link targets #color. CSS rule is #color:target...
Read more >5. Working with the Shadow DOM - Modern JavaScript [Book]
A shadow host is a DOM node that contains a shadow root. ... This attribute can be added to a <content> element with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’ve completed the changes for this issue and a release is planned for the end of the month that will incorporate the fix.
Wow! That’s an odd one. No idea how that might happen, but clearly
:root > div > img
is wrong. I’ll look into it!