← Back to release summary

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

Ecosystem

Explainers: https://github.com/Igalia/explainers/tree/main/nodes-from-rect

View on chromestatus.com