w3c / w3c/csswg-drafts

[css-scroll-anchoring-1] Unclear whether a 0-size element at edge of region is eligible as anchor node or not

Open
#3,483 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-scroll-anchoring-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Description

https://drafts.csswg.org/css-scroll-anchoring/#anchor-node-selection defines "fully visible" and "fully clipped" as follows:

A DOM node N is fully visible in a scrolling box S if N’s scroll anchoring bounding rect is entirely within the optimal viewing region of S.
A DOM node N is fully clipped in a scrolling box S if N’s scroll anchoring bounding rect is entirely outside the optimal viewing region of S.

This leaves an edge case undefined (depending on how you interpret "within" vs. "outside"):
What if N's rect has size (0,0) and is positioned exactly on the edge of the optimal viewing region? Is that empty rect considered "entirely within" or "entirely outside" the region?

(This choice will have a user-noticeable impact; if such a node is "entirely within", then the algorithm will terminate and chooses this 0-sized node N; but if it's "entirely outside",, then the algorithm will proceed & choose some other node.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CSS Scroll Anchoring specification's anchor node selection section and review the definitions of “fully visible” and “fully clipped.” Determine how a zero-size rectangle exactly on the optimal viewing region's edge should be classified, then update the specification to make that behavior explicit and verify that the selection algorithm's consequence is clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation, web-dev
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.