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

New package alfa-painting-order #1756

Merged
merged 38 commits into from
Feb 19, 2025
Merged

New package alfa-painting-order #1756

merged 38 commits into from
Feb 19, 2025

Conversation

rcj-siteimprove
Copy link
Contributor

This PR introduces a new package which contains functionality for computing the painting order of HTML elements based on the specification: https://drafts.csswg.org/css2/#painting-order.

The process for computing the painting order is fairly complex and that reflects in the implementation. This is the first step to make something that works in most common use cases. There are possibly room for caching some computations and other optimizations as well as making the algorithm easier to follow and less error-prone.

The current implementation does not consider scrolling frames, but that could be a logical next step if needed.

The painting order can be used for e.g. detecting if elements are fully or partially covered by other elements, which is relevant when determining the clickable area of an element. More on that in future PRs.

@rcj-siteimprove rcj-siteimprove requested a review from a team as a code owner February 6, 2025 14:57
Copy link

changeset-bot bot commented Feb 6, 2025

🦋 Changeset detected

Latest commit: 38bae09

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-css Minor
@siteimprove/alfa-style Minor
@siteimprove/alfa-device Minor
@siteimprove/alfa-painting-order Minor
@siteimprove/alfa-cascade Minor
@siteimprove/alfa-css-feature Minor
@siteimprove/alfa-dom Minor
@siteimprove/alfa-rules Minor
@siteimprove/alfa-selector Minor
@siteimprove/alfa-aria Minor
@siteimprove/alfa-web Minor
@siteimprove/alfa-table 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-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-rectangle 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 6, 2025
@rcj-siteimprove rcj-siteimprove added the minor Backwards-compatible change that touches public API label Feb 6, 2025
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.

Looks good. Some code organisation comments.

@rcj-siteimprove
Copy link
Contributor Author

!pr extract

@rcj-siteimprove
Copy link
Contributor Author

!pr extract

@rcj-siteimprove
Copy link
Contributor Author

@Jym77 I addressed most of the comments, except two that I would like to look into in a follow up PR, but after the other work that depend on this one (using it to compute clickable area).

@rcj-siteimprove
Copy link
Contributor Author

!pr extract

@rcj-siteimprove rcj-siteimprove added this pull request to the merge queue Feb 19, 2025
Merged via the queue into main with commit 3767bbd Feb 19, 2025
6 of 7 checks passed
@rcj-siteimprove rcj-siteimprove deleted the alfa-painting-order branch February 19, 2025 15:01
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: 🏁 Done
Development

Successfully merging this pull request may close these issues.

2 participants