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

Scrolling down changes the outcome of an audit #1626

Open
rcj-siteimprove opened this issue Jun 19, 2024 · 1 comment
Open

Scrolling down changes the outcome of an audit #1626

rcj-siteimprove opened this issue Jun 19, 2024 · 1 comment
Labels
bug Report of unexpected or faulty behaviour in Alfa

Comments

@rcj-siteimprove
Copy link
Contributor

rcj-siteimprove commented Jun 19, 2024

Running an audit on the same page first without scrolling and after scrolling down yields different occurrence counts.

Some targets that are above the viewport is no longer detected.

Rules relying on layout like R111, R113 and the color contrast rules are affected.

The cause is most likely that we have an implicit assumption that bounding boxes were using page coordinates and independent from the view port, but that turned out not to be the case. We should consider converting the boxes to page coordinates.

The following can be used to reproduce the issue e.g. by running the alfa-web-extension on the page with the scrollbar at the top (the color contrast issue should be detected) and then scrolling down enough so that the text is no longer visible and then refreshing the extension (the color contrast issue is no longer detected)

<!doctype html>
<style>
  div.badcontrast {
    background-color: #ffffff; /* White background */
    color: #f1f1f1; /* Light grey text */
  }
  body {
    padding-bottom: 9999px; /* To get the scrollbar to appear */
  }
</style>
<div class="badcontrast">Hello, bad contrast</div>
@rcj-siteimprove rcj-siteimprove added the bug Report of unexpected or faulty behaviour in Alfa label Jun 19, 2024
@rcj-siteimprove
Copy link
Contributor Author

Might be worth looking into this code:

const extendedViewport = Rectangle.of(0, 0, device.viewport.width, Infinity);

@rcj-siteimprove rcj-siteimprove added this to 📮 Backlog in ⚙️ Development via automation Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of unexpected or faulty behaviour in Alfa
Projects
⚙️ Development
  
📮 Backlog
Development

No branches or pull requests

1 participant