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

[css-highlight-api] highlightsFromPoint: add support for StaticRanges for #11745 #11779

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ffiori
Copy link
Contributor

@ffiori ffiori commented Feb 25, 2025

Add some clarifications to the algorithm for highlightsFromPoint so it includes StaticRanges too.

See issue #11745

1. The coordinates <var>x</var>,<var>y</var> fall inside at least one of the {{DOMRect}}s returned by calling {{Range/getClientRects()}} on <var>range</var>.
including only those highlights that contain at least one {{AbstractRange}} <var>abstractRange</var> that satisfies the following:

* Let <var>range</var> be a {{Range}} object whose [=start node=] and [=end node=] are set to <var>abstractRange</var>'s [=start node=] and [=end node=] respectively,
Copy link
Member

Choose a reason for hiding this comment

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

This is basically a workaround for the fact that StaticRange doesn't support getClientRects. This is fine for now, but should we also file an issue to support getClientRects (and presumably getBoundingClientRect) on AbstractRange so that it works for all range types?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants