CSSOM Document.nodesFromRect API
- Category
- CSS
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
An API on Document for returning the sequence of elements or text nodes within a rectangle.
Motivation
Browsers provide a variety of built-in interaction modes for HTML content. However, there are use cases where these built-ins aren't enough: for example, the browser’s selection mechanism only works in the text-flow direction. In certain contexts, users want to interact with content in more specialised ways. A common example is the ability to select an area of the screen to interact with a grouping of content (e.g. to copy it or to move its position). This feature's goal is to provide web developers the ability to get access to content within a specific area of a web page. This is useful for creating custom interaction models beyond those provided by browsers. While this is possible today, the solutions are limited and require heavy lifting from developers.
Standards & signals
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/u/1/issues/445911489
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=cssom-document-nodesfromrect-api
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+CSSOM%20Document.nodesFromRect%20API
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=CSSOM%20Document.nodesFromRect%20API
- Baseline status: https://webstatus.dev/?q=CSSOM%20Document.nodesFromRect%20API
Explainers: https://github.com/Igalia/explainers/tree/main/nodes-from-rect