Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -9283,6 +9283,17 @@ method steps are:
point.
</ol>

<li>
<p>Set <a>this</a>'s <a for=range>start</a> and <a for=range>end</a> to
(<var>newNode</var>, <var>newOffset</var>).

<p class=note>This is done before performing mutations, because the DOM's built-in
<a>live range</a> maintenance mechanisms
(<a>live range pre-remove steps</a> and <a>replace data</a> range adjustments)
will automatically keep the range valid through the subsequent operations. Collapsing the
range after mutations would be unreliable, since script can run during
<a for=/>removal</a> and modify the DOM.
Comment thread
annevk marked this conversation as resolved.
Outdated

<li><p>If <var>originalStartNode</var> is a {{CharacterData}} <a for=/>node</a>, then
<a>replace data</a> of <var>originalStartNode</var> with <var>originalStartOffset</var>,
<var>originalStartNode</var>'s <a for=Node>length</a> &minus; <var>originalStartOffset</var>, and
Expand All @@ -9294,9 +9305,6 @@ method steps are:
<li><p>If <var>originalEndNode</var> is a {{CharacterData}} <a for=/>node</a>, then
<a>replace data</a> of <var>originalEndNode</var> with 0, <var>originalEndOffset</var>, and
the empty string.

<li><p>Set <a for=range>start</a> and <a for=range>end</a> to
(<var>newNode</var>, <var>newOffset</var>).
</ol>
</div>

Expand Down Expand Up @@ -9414,8 +9422,16 @@ method steps are:
point.
</ol>

<!-- Now we start with mutations, so we can't refer to this anymore unless we carefully consider
how it will have mutated. -->
<li>
<p>Set <var>range</var>'s <a for=range>start</a> and <a for=range>end</a> to
(<var>newNode</var>, <var>newOffset</var>).

<p class=note>This is done before performing mutations, because the DOM's built-in
<a>live range</a> maintenance mechanisms
(<a>live range pre-remove steps</a> and <a>replace data</a> range adjustments)
will automatically keep the range valid through the subsequent operations. Collapsing the
range after mutations would be unreliable, since script can run during
<a for=/>removal</a> and modify the DOM.

<li>
<p>If <var>firstPartiallyContainedChild</var> is a {{CharacterData}} <a for=/>node</a>:
Expand Down Expand Up @@ -9498,9 +9514,6 @@ method steps are:
<li><p><a>Append</a> <var>subfragment</var> to <var>clone</var>.
</ol>

<li><p>Set <var>range</var>'s <a for=range>start</a> and <a for=range>end</a> to
(<var>newNode</var>, <var>newOffset</var>).

<li><p>Return <var>fragment</var>.
</ol>
</div>
Expand Down Expand Up @@ -11284,6 +11297,7 @@ Simon Pieters,
Simon Wülker,
Stef Busking,
Steve Byrne,
Steven Obiajulu,
Stig Halvorsen,
Tab Atkins,
Takashi Sakamoto,
Expand Down
Loading