Skip to content

Commit 56120cf

Browse files
authored
[css-highlight-api] Add clarifications to the algorithm for highlightsFromPoint so that StaticRanges are handled correctly
1 parent f8df53e commit 56120cf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

css-highlight-api-1/Overview.bs

+7-3
Original file line numberDiff line numberDiff line change
@@ -668,15 +668,19 @@ method must return the result of running these steps:
668668
* <var>x</var> is greater than the <a>viewport</a> width excluding the size of a rendered scroll bar (if any)
669669
* <var>y</var> is greater than the <a>viewport</a> height excluding the size of a rendered scroll bar (if any)
670670
1. Otherwise, return a [=sequence=] of [=custom highlights=] given by ordering the highlights contained in this {{HighlightRegistry}} in descending order of [=priority=],
671-
excluding the highlights without at least one [=range=] <var>range</var> that satisfies the following constraints:
672-
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>.
671+
including only those highlights that contain at least one {{AbstractRange}} <var>abstractRange</var> that satisfies the following:
672+
673+
* 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,
674+
and [=start offset=] and [=end offset=] are set to <var>abstractRange</var>'s [=start offset=] and [=end offset=] respectively.
675+
676+
* 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>.
673677

674678
Note: The specifics of hit testing are out of scope of this
675679
specification and therefore the exact details of
676680
{{highlightsFromPoint()}} are therefore too. Hit testing
677681
will hopefully be defined in a future revision of CSS or HTML.
678682

679-
1. The <var>range</var>'s {{commonAncestorContainer}} is not in a [=shadow tree=] or is in a [=shadow tree=] whose
683+
* The <var>range</var>'s {{commonAncestorContainer}} is not in a [=shadow tree=] or is in a [=shadow tree=] whose
680684
[=shadow root=] is [=list/contains|contained by=] by <var>options</var>.<var>shadowRoots</var>.
681685

682686
<h2 id=events>

0 commit comments

Comments
 (0)