You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The <dfn method for="HighlightRegistry">highlightsFromPoint(<var>x</var>, <var>y</var>, <var>options</var>)</dfn>
663
+
method must return the result of running these steps:
664
+
665
+
1. If any of the following are true, return the empty [=sequence=]:
666
+
* <var>x</var> is negative
667
+
* <var>y</var> is negative
668
+
* <var>x</var> is greater than the <a>viewport</a> width excluding the size of a rendered scroll bar (if any)
669
+
* <var>y</var> is greater than the <a>viewport</a> height excluding the size of a rendered scroll bar (if any)
670
+
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>.
673
+
674
+
Note: The specifics of hit testing are out of scope of this
675
+
specification and therefore the exact details of
676
+
{{highlightsFromPoint()}} are therefore too. Hit testing
677
+
will hopefully be defined in a future revision of CSS or HTML.
678
+
679
+
1. The <var>range</var>'s {{commonAncestorContainer}} is not in a [=shadow tree=] or is in a [=shadow tree=] whose
680
+
[=shadow root=] is [=list/contains|contained by=] by <var>options</var>.<var>shadowRoots</var>.
681
+
582
682
<h2 id=events>
583
683
Event Handling</h2>
584
684
@@ -629,6 +729,9 @@ Changes since the <a href="https://www.w3.org/TR/2020/WD-css-highlight-api-1-202
629
729
In addition to various editorial improvements and minor tweaks,
630
730
the main changes are:
631
731
732
+
* Added a {{HighlightRegistry/highlightsFromPoint}} method to
733
+
{{HighlightRegistry}}.
734
+
(See <a href="https://github.com/w3c/csswg-drafts/pull/7513">Issue 7513</a>)
632
735
* Specified that highlight repainting has to be done asynchronously.
633
736
(See <a href="https://github.com/w3c/csswg-drafts/pull/6987">Issue 6987</a>)
634
737
* Clarify that UAs cannot specify paired default highlight colors for custom highlights.
0 commit comments