dequelabs / dequelabs/axe-core

Incorrect reporting of target size violation from incorrect offset calculation

Open
#4,295 4 comments 0 reactions 0 assignees View on GitHub
rules target-size
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

### Product

axe-core

### Product Version

4.8.3

### Latest Version

- [X] 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.

![IMG_2406](https://github.com/dequelabs/axe-core/assets/22206986/34b05eb2-2a6b-49f1-a24d-d1e7c44a5a78)

#### 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.

```html


Target Size





lorem ipsum dolor
amet
et dolore magna aliqua


Incorrectly flagged as target size violation



```

#### 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;`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.