Skip to content

Commit ce0c83b

Browse files
siliu1emilio
authored andcommitted
Change shadowRoots from rest parameter to a dictionary with an array of shadow roots.
1 parent 3a7db3e commit ce0c83b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cssom-view-1/Overview.bs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1015,9 +1015,13 @@ Note: Some non-conforming implementations are known to return 32 instead of 24.
10151015
partial interface Document {
10161016
Element? elementFromPoint(double x, double y);
10171017
sequence<Element> elementsFromPoint(double x, double y);
1018-
CaretPosition? caretPositionFromPoint(double x, double y, ShadowRoot... shadowRoots);
1018+
CaretPosition? caretPositionFromPoint(double x, double y, optional <span>CaretPositionFromPointOptions</span> options = {});
10191019
readonly attribute Element? scrollingElement;
10201020
};
1021+
1022+
dictionary <dfn dictionary>CaretPositionFromPointOptions</dfn> {
1023+
sequence&lt;ShadowRoot> <dfn dict-member for="CaretPositionFromPointOptions">shadowRoots</dfn> = [];
1024+
};
10211025
</pre>
10221026

10231027
The <dfn method for=Document caniuse=element-from-point>elementFromPoint(<var>x</var>, <var>y</var>)</dfn> method must follow these steps:
@@ -1046,7 +1050,7 @@ instance, an element can be excluded from being a target for hit testing by usin
10461050
1. If the document has a [=root element=], and the last item in <var>sequence</var> is not the [=root element=], append the [=root element=] to <var>sequence</var>.
10471051
1. Return <var>sequence</var>.
10481052

1049-
The <dfn method for=Document>caretPositionFromPoint(<var>x</var>, <var>y</var>, ...<var>shadowRoots</var>)</dfn> method must return the
1053+
The <dfn method for=Document>caretPositionFromPoint(<var>x</var>, <var>y</var>, <var>options</var>)</dfn> method must return the
10501054
result of running these steps:
10511055

10521056
1. If there is no <a>viewport</a> associated with the document, return null.
@@ -1076,7 +1080,7 @@ result of running these steps:
10761080
1. Let <var>caretPosition</var> be a <a for=/>tuple</a> consisting of a <var>caretPositionNode</var> (a <a for=/>node</a>) and a <var>caretPositionOffset</var> (a non-negative integer) for the position where the text insertion point indicator would have been inserted when applying
10771081
the <a>transforms</a> that apply to the descendants of the <a>viewport</a>.
10781082
1. Let <var>startNode</var> be the <var>caretPositionNode</var> of the <var>caretPosition</var>, and let <var>startOffset</var> be the <var>caretPositionOffset</var> of the <var>caretPosition</var>.
1079-
1. While <var>startNode</var> is a [=node=], <var>startNode</var>'s [=tree/root=] is a [=shadow root=], and <var>startNode</var>'s [=tree/root=] is not a [=shadow-including inclusive ancestor=] of any of <var>shadowRoots</var>, repeat these steps:
1083+
1. While <var>startNode</var> is a [=node=], <var>startNode</var>'s [=tree/root=] is a [=shadow root=], and <var>startNode</var>'s [=tree/root=] is not a [=shadow-including inclusive ancestor=] of any of <var>options</var>["{{CaretPositionFromPointOptions/shadowRoots}}"], repeat these steps:
10801084
1. Set <var>startOffset</var> to [=tree/index=] of <var>startNode</var>'s [=tree/root=]'s [=host=].
10811085
1. Set <var>startNode</var> to <var>startNode</var>'s [=tree/root=]'s [=host=]'s [=tree/parent=].</li>
10821086
1. Return a <a>caret position</a> with its properties set as follows:

0 commit comments

Comments
 (0)