Skip to content

Include position absolute elements in tap targets audit #7365

@mattzeunert

Description

@mattzeunert

Right now all position absolute tap targets are ignored by the audit so we don't falsely report failures where elements have the same x/y position but a different z-index. For example:

screenshot 2019-03-03 at 13 44 08

But ignoring them also misses real failures. To include them we need to detect whether an element is actually visible and we think we can use elementFromPoint to do that:

  • we can treat a target as invisible if the topmost element at its center point isn't part of the tap target
  • elementFromPoint only works within the current viewport, so we need to scroll through the page screen by screen in the gatherer

The axe gatherer already scrolls around the page, so that seems fine?

There might be a way to manually calculate if an element is in the top layer, but elementFromPoint seems easier to use and I think it would also allow us to get rid of filterClientRectsWithinAncestorsVisibleScrollArea.

@patrickhulce @brendankenny What do you think?

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions