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

Improve Clickable Region Computation for R111 and R113 #1761

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

rcj-siteimprove
Copy link
Contributor

@rcj-siteimprove rcj-siteimprove commented Feb 11, 2025

This implements using the new PaintingOrder to get a better representation of the clickable region of an element by repeatedly subtracting the bounding boxes of elements on top of the target element resulting in a region of constituent boxes.

Copy link

changeset-bot bot commented Feb 11, 2025

🦋 Changeset detected

Latest commit: 7eaf006

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 80 packages
Name Type
@siteimprove/alfa-rules Minor
@siteimprove/alfa-painting-order Minor
@siteimprove/alfa-rectangle Minor
@siteimprove/alfa-dom Minor
@siteimprove/alfa-style Minor
@siteimprove/alfa-aria Minor
@siteimprove/alfa-cascade Minor
@siteimprove/alfa-selector Minor
@siteimprove/alfa-table Minor
@siteimprove/alfa-web Minor
@siteimprove/alfa-xpath Minor
@siteimprove/alfa-act Minor
@siteimprove/alfa-affine Minor
@siteimprove/alfa-applicative Minor
@siteimprove/alfa-array Minor
@siteimprove/alfa-bits Minor
@siteimprove/alfa-branched Minor
@siteimprove/alfa-cache Minor
@siteimprove/alfa-callback Minor
@siteimprove/alfa-clone Minor
@siteimprove/alfa-collection Minor
@siteimprove/alfa-comparable Minor
@siteimprove/alfa-compatibility Minor
@siteimprove/alfa-continuation Minor
@siteimprove/alfa-css-feature Minor
@siteimprove/alfa-css Minor
@siteimprove/alfa-device Minor
@siteimprove/alfa-earl Minor
@siteimprove/alfa-either Minor
@siteimprove/alfa-emitter Minor
@siteimprove/alfa-encoding Minor
@siteimprove/alfa-equatable Minor
@siteimprove/alfa-flags Minor
@siteimprove/alfa-fnv Minor
@siteimprove/alfa-foldable Minor
@siteimprove/alfa-functor Minor
@siteimprove/alfa-future Minor
@siteimprove/alfa-generator Minor
@siteimprove/alfa-graph Minor
@siteimprove/alfa-hash Minor
@siteimprove/alfa-http Minor
@siteimprove/alfa-iana Minor
@siteimprove/alfa-iterable Minor
@siteimprove/alfa-json-ld Minor
@siteimprove/alfa-json Minor
@siteimprove/alfa-lazy Minor
@siteimprove/alfa-list Minor
@siteimprove/alfa-map Minor
@siteimprove/alfa-mapper Minor
@siteimprove/alfa-math Minor
@siteimprove/alfa-monad Minor
@siteimprove/alfa-network Minor
@siteimprove/alfa-option Minor
@siteimprove/alfa-parser Minor
@siteimprove/alfa-performance Minor
@siteimprove/alfa-predicate Minor
@siteimprove/alfa-promise Minor
@siteimprove/alfa-record Minor
@siteimprove/alfa-reducer Minor
@siteimprove/alfa-refinement Minor
@siteimprove/alfa-result Minor
@siteimprove/alfa-rng Minor
@siteimprove/alfa-sarif Minor
@siteimprove/alfa-selective Minor
@siteimprove/alfa-sequence Minor
@siteimprove/alfa-set Minor
@siteimprove/alfa-slice Minor
@siteimprove/alfa-string Minor
@siteimprove/alfa-test-deprecated Minor
@siteimprove/alfa-test Minor
@siteimprove/alfa-thenable Minor
@siteimprove/alfa-thunk Minor
@siteimprove/alfa-time Minor
@siteimprove/alfa-toolchain Minor
@siteimprove/alfa-trampoline Minor
@siteimprove/alfa-tree Minor
@siteimprove/alfa-trilean Minor
@siteimprove/alfa-tuple Minor
@siteimprove/alfa-url Minor
@siteimprove/alfa-wcag Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rcj-siteimprove rcj-siteimprove self-assigned this Feb 11, 2025
@rcj-siteimprove rcj-siteimprove added the minor Backwards-compatible change that touches public API label Feb 11, 2025
@rcj-siteimprove
Copy link
Contributor Author

!pr extract

@rcj-siteimprove rcj-siteimprove marked this pull request as ready for review February 20, 2025 09:59
@rcj-siteimprove rcj-siteimprove requested a review from a team as a code owner February 20, 2025 09:59
@rcj-siteimprove rcj-siteimprove marked this pull request as draft February 20, 2025 14:45
@rcj-siteimprove rcj-siteimprove changed the title Subtraction of Rectangles Improve Clickable Region Computation for R111 and R113 Feb 20, 2025
@rcj-siteimprove
Copy link
Contributor Author

!pr extract

@rcj-siteimprove rcj-siteimprove marked this pull request as ready for review February 26, 2025 15:56
Copy link
Contributor

@Jym77 Jym77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌮

* In painting order computation, `isRendered` has been replaced by the stricter
  `isVisible` predicate when determining which elements are painted.
* `Rectangle.subtract` now accepts one or more rectangles to subtract.
* `getClickableRegion` no longer returns a `Result` since it was used to
  indicate the absense of a clickable region, which can be achieved
  better with an empty `Sequence`.
@rcj-siteimprove
Copy link
Contributor Author

!pr extract

@rcj-siteimprove rcj-siteimprove requested a review from Jym77 March 7, 2025 19:13
@rcj-siteimprove rcj-siteimprove added this pull request to the merge queue Mar 12, 2025
github-merge-queue bot pushed a commit that referenced this pull request Mar 12, 2025
* Add method for subtracting rectangles

* Add changeset

* Add reference

* Extract API

* Use painting order to determine the clickable region of an element

* Add references

* Consider non-descendants and descendant targets when comuting clickable region

* Add changeset

* Add changeset

* Use `isTarget` in clickable region computation

* Sort imports

* Clean up

* Extract API

* Address review comments and fix issues

* In painting order computation, `isRendered` has been replaced by the stricter
  `isVisible` predicate when determining which elements are painted.
* `Rectangle.subtract` now accepts one or more rectangles to subtract.
* `getClickableRegion` no longer returns a `Result` since it was used to
  indicate the absense of a clickable region, which can be achieved
  better with an empty `Sequence`.

* Extract API

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@rcj-siteimprove rcj-siteimprove removed this pull request from the merge queue due to a manual request Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Backwards-compatible change that touches public API
Projects
Status: 🧑‍💻 Doing
Development

Successfully merging this pull request may close these issues.

2 participants