Skip to content

Commit

Permalink
Editorial: use JavaScript string length
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Dec 19, 2017
1 parent 12b0698 commit 870ba05
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ can be used to explore this matter in more detail.
<dt>{{Text}}
<dt>{{ProcessingInstruction}}
<dt>{{Comment}}
<dd><p>The number of <a>code units</a> in its <a for=CharacterData>data</a>.
<dd><p>Its <a for=CharacterData>data</a>'s <a for="JavaScript string">length</a>.

<dt>Any other node
<dd><p>Its number of <a>children</a>.
Expand Down Expand Up @@ -7016,10 +7016,8 @@ To <dfn export id=concept-cd-replace>replace data</dfn> of node <var>node</var>
<a for=CharacterData>data</a> after <var>offset</var>
<a>code units</a>.

<li>Let <var>delete offset</var> be <var>offset</var> plus
the number of
<a>code units</a> in
<var>data</var>.
<li>Let <var>delete offset</var> be <var>offset</var> + <var>data</var>'s
<a for="JavaScript string">length</a>.

<li>Starting from <var>delete offset</var>
<a>code units</a>, remove
Expand All @@ -7046,23 +7044,14 @@ To <dfn export id=concept-cd-replace>replace data</dfn> of node <var>node</var>
<a>end offset</a> to
<var>offset</var>.

<li>For each <a>range</a> whose
<a for=Range>start node</a> is
<var>node</var> and
<a>start offset</a> is greater than
<var>offset</var> plus <var>count</var>, increase its
<a>start offset</a> by the number of
<a>code units</a> in
<var>data</var>, then decrease it by <var>count</var>.
<li>For each <a>range</a> whose <a for=Range>start node</a> is <var>node</var> and
<a>start offset</a> is greater than <var>offset</var> plus <var>count</var>, increase its
<a>start offset</a> by <var>data</var>'s <a for="JavaScript string">length</a> and decrease it by
<var>count</var>.

<li>For each <a>range</a> whose
<a for=Range>end node</a> is
<var>node</var> and
<a>end offset</a> is greater than
<var>offset</var> plus <var>count</var>, increase its
<a>end offset</a> by the number of
<a>code units</a> in
<var>data</var>, then decrease it by <var>count</var>.
<li>For each <a>range</a> whose <a for=Range>end node</a> is <var>node</var> and <a>end offset</a>
is greater than <var>offset</var> plus <var>count</var>, increase its <a>end offset</a> by
<var>data</var>'s <a for="JavaScript string">length</a> and decrease it by <var>count</var>.

<li>If <var>node</var> is a {{Text}} node and its <a>parent</a> is not null, run the
<a>child text content change steps</a> for <var>node</var>'s <a>parent</a>.
Expand Down

0 comments on commit 870ba05

Please sign in to comment.