You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tested the issue with the latest version of the product
Issue Description
Expectation
I would expect no target size violations to occur in the example.
Actual
The link labelled "Incorrectly flagged as target size violation" is in violation of target size, claiming it has 0 offset from both of the the other links.
How to Reproduce
Unfortunately I was not able to reproduce this in jsfiddle (or the like), so the following html will need to be saved and opened as a file in your browser. All instructions to reproduce are in the comment in the code snippet.
<!DOCTYPE html><htmllang="en-US"><head><title>Target Size</title></head>
<body><divstyle="max-width:290px"><p><ahref="#">lorem ipsum dolor</a><ahref="#">amet</a><span>et dolore magna aliqua</span></p><ahref="#" style="display: inline-block;">Incorrectly flagged as target size violation</a></div></body>
<!-- In your browser, do the following (could not replicate in jsfiddle or the like) 1. Open this HTML file 2. Open the devtools console on that page - the rest of the instruction will take place there. 3. Paste in axe source to make the global `axe` available on the page For example: https://www.unpkg.com/axe-core@4.8.3/axe.min.js 4. Configure axe to ONLY report on target size violations axe.configure({ rules: [{id: 'target-size', enabled: true}], disableOtherRules: true }) 5. Run axe and print out the violations axe.run().then(r => console.log(r.violations)); At this point you will observe that the last link is flagged as being in violation of target size. Specifically, it states that it has 0 offset from the other 2 links on the page, despite clearly being far away from them. This can be replicated in Chrome, Firefox, Safari --></html>
Additional context
The test case above is very carefully constructed. Here is what I found to be important about it specifically (and what is not)
the div must be sized such that the paragraph wraps to multiple lines
re: the first paragraph
The 2 links in here must be close enough to each other that they should be flagged as violating offset limitations if the were inline-block (its my understanding inline elements are not caught by axe present day for target-size violations?)
The text after the links must be wrapped in a span
This span must break in the middle as part of the wrapping forced by the div
The final link outside the paragraph must be display: inline-block;
The text was updated successfully, but these errors were encountered:
Notes for myself: It seems that the issue is that the span tag is being counted as an overlapping node in get-target-rects and makes the function return an empty array when it tries to split-rects with the first anchor element in the paragraph and the span. Since the span fully overlaps the anchor there is no space in which they don't overlap so split-rects function returns empty.
// the <a href="#">lorem ipsum dolor</a> nodeRectnodeRect={"x": 8,"y": 16,"width": 118.2109375,"height": 18.5,"top": 16,"right": 126.2109375,"bottom": 34.5,"left": 8}// the <span> element nodeRectobscuringRects=[{"x": 8,"y": 16,"width": 260.375,"height": 37,"top": 16,"right": 268.375,"bottom": 53,"left": 8}]
straker
added
rules
Issue or false result from an axe-core rule
and removed
ungroomed
Ticket needs a maintainer to prioritize and label
labels
Jan 8, 2024
Product
axe-core
Product Version
4.8.3
Latest Version
Issue Description
Expectation
I would expect no target size violations to occur in the example.
Actual
The link labelled "Incorrectly flagged as target size violation" is in violation of target size, claiming it has 0 offset from both of the the other links.
How to Reproduce
Unfortunately I was not able to reproduce this in jsfiddle (or the like), so the following html will need to be saved and opened as a file in your browser. All instructions to reproduce are in the comment in the code snippet.
Additional context
The test case above is very carefully constructed. Here is what I found to be important about it specifically (and what is not)
display: inline-block;
The text was updated successfully, but these errors were encountered: