diff --git a/cssom-view-1/Overview.bs b/cssom-view-1/Overview.bs index db4a565fa6f..6529ceee843 100644 --- a/cssom-view-1/Overview.bs +++ b/cssom-view-1/Overview.bs @@ -1015,9 +1015,13 @@ Note: Some non-conforming implementations are known to return 32 instead of 24. partial interface Document { Element? elementFromPoint(double x, double y); sequence<Element> elementsFromPoint(double x, double y); - CaretPosition? caretPositionFromPoint(double x, double y, ShadowRoot... shadowRoots); + CaretPosition? caretPositionFromPoint(double x, double y, optional CaretPositionFromPointOptions options = {}); readonly attribute Element? scrollingElement; }; + +dictionary CaretPositionFromPointOptions { + sequence<ShadowRoot> shadowRoots = []; +}; The elementFromPoint(x, y) method must follow these steps: @@ -1046,7 +1050,7 @@ instance, an element can be excluded from being a target for hit testing by usin 1. If the document has a [=root element=], and the last item in sequence is not the [=root element=], append the [=root element=] to sequence. 1. Return sequence. -The caretPositionFromPoint(x, y, ...shadowRoots) method must return the +The caretPositionFromPoint(x, y, options) method must return the result of running these steps: 1. If there is no viewport associated with the document, return null. @@ -1076,7 +1080,7 @@ result of running these steps: 1. Let caretPosition be a tuple consisting of a caretPositionNode (a node) and a caretPositionOffset (a non-negative integer) for the position where the text insertion point indicator would have been inserted when applying the transforms that apply to the descendants of the viewport. 1. Let startNode be the caretPositionNode of the caretPosition, and let startOffset be the caretPositionOffset of the caretPosition. - 1. While startNode is a [=node=], startNode's [=tree/root=] is a [=shadow root=], and startNode's [=tree/root=] is not a [=shadow-including inclusive ancestor=] of any of shadowRoots, repeat these steps: + 1. While startNode is a [=node=], startNode's [=tree/root=] is a [=shadow root=], and startNode's [=tree/root=] is not a [=shadow-including inclusive ancestor=] of any of options["{{CaretPositionFromPointOptions/shadowRoots}}"], repeat these steps: 1. Set startOffset to [=tree/index=] of startNode's [=tree/root=]'s [=host=]. 1. Set startNode to startNode's [=tree/root=]'s [=host=]'s [=tree/parent=]. 1. Return a caret position with its properties set as follows: