Skip to content

Commit

Permalink
Change getComposedRanges() to take a dictionary
Browse files Browse the repository at this point in the history
Closes #176.
  • Loading branch information
dizhang168 authored Sep 30, 2024
1 parent 45f8fe8 commit c0071c7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ <h2>
undefined removeRange(Range range);
undefined removeAllRanges();
undefined empty();
sequence&lt;StaticRange&gt; getComposedRanges(ShadowRoot... shadowRoots);
sequence&lt;StaticRange&gt; getComposedRanges(optional GetComposedRangesOptions options = {});
undefined collapse(Node? node, optional unsigned long offset = 0);
undefined setPosition(Node? node, optional unsigned long offset = 0);
undefined collapseToStart();
Expand All @@ -223,6 +223,10 @@ <h2>
boolean containsNode(Node node, optional boolean allowPartialContainment = false);
stringifier;
};

dictionary GetComposedRangesOptions {
sequence&lt;ShadowRoot&gt; shadowRoots = [];
};
</pre>
<dl>
<dt>
Expand Down Expand Up @@ -411,8 +415,9 @@ <h2>
<li>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:
inclusive ancestor=] of any of
<var>options</var>["{{GetComposedRangesOptions/shadowRoots}}"],
repeat these steps:
<ol>
<li>Set <var>startOffset</var> to [=tree/index=] of
<var>startNode</var>'s [=tree/root=]'s [=host=].
Expand All @@ -429,7 +434,9 @@ <h2>
<li>While <var>endNode</var> is a [=node=], <var>endNode</var>'s
[=tree/root=] is a [=shadow root=], and <var>endNode</var>'s
[=tree/root=] is not a [=shadow-including inclusive ancestor=] of
any of <var>shadowRoots</var>, repeat these steps:
any of
<var>options</var>["{{GetComposedRangesOptions/shadowRoots}}"],
repeat these steps:
<ol>
<li>Set <var>endOffset</var> to [=tree/index=] of
<var>endNode</var>'s [=tree/root=]'s [=host=] plus 1.
Expand Down

0 comments on commit c0071c7

Please sign in to comment.