equal-access icon indicating copy to clipboard operation
equal-access copied to clipboard

Overlay highlighting incorrect when issue is in a scrollable portion of page

Open ekaufman opened this issue 1 year ago • 4 comments

Describe the bug When running the checker on a page that contains scrollable regions (especially but not only if those regions are iframes), the logic that determines the location of the bounding rectangle for highlighting the element is failing.

One part of the issue is that it isn't scrolling the element into view before calculating the position, it's drawing the rectangle farther down the screen where the element would appear were it not hidden by the scroll.

Another issue I'm seeing is that elements inside an iframe are calculate relative to that iframes window without adjusting for the iframes location within it's parent.

To Reproduce Steps to reproduce the behavior:

  1. Attaching an example project that contains two scrollable regions, one is in an iframe.
  2. Run a scan.
  3. Select the issue it reports on "/document[1] /main[1] /list[1] /listitem[9] /button[1]" for not having an associated label.
  4. This should highlight the button in that first scrollable list, but since it is not scrolled into view the rectangle does not highlight the button.
  5. Select the issue it reports on "/document[1] /main[1] /document[1] /textbox[1]".
  6. This should highlight the textbox that has no label, but since it isn't accounting for the bounds of the iframe being contained within the parent window the position that is highlighted does not match up.

Expected behavior It should highlight the element that contains the issue. If it needs to scroll that element into view then it should do that.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version 137

Definition of Done

  • [ ] Design artifacts reviewed
  • [ ] Work item implemented
  • [ ] Automated test case created (when applicable)
  • [ ] Unit test completed
  • [ ] Run Checker (when applicable)
  • [ ] Manual and Screen Reader Testing (when applicable)
  • [ ] Video recording of user experience walkthrough (if impact to UX)
  • [ ] PR created

ekaufman avatar Jun 18 '25 20:06 ekaufman

Attaching example project used for reproduction steps/screenshot.

example.zip

ekaufman avatar Jun 18 '25 20:06 ekaufman

Note - it would not be correct to scroll the content into view because that can change the results. For example, if the issue is to check that the item is visible when it receives focus, moving it into view would cause it to be visible when it wasn't already visible. It's fairly standard when an item is outside of its container to still highlight it where it would be if the container were larger.

tombrunet avatar Jul 24 '25 15:07 tombrunet

Closing as works as designed. Chrome devtools has the exact same behavior:

Image

tombrunet avatar Sep 02 '25 15:09 tombrunet

Sorry- re-opening since I didn't read the second half of the issue, and the example doesn't trigger these when loading the HTML as a local file (due to browser security issues). The calculation of the bounds within the frame does appear to be incorrect (steps 5/6 above). But 3/4 are working as designed.

tombrunet avatar Sep 02 '25 15:09 tombrunet