@@ -22,6 +22,8 @@ urlPrefix: https://www.w3.org/TR/xml-names/#NT-
22
22
text: QName; url: QName
23
23
url: https://w3c.github.io/DOM-Parsing/#dom-range-createcontextualfragment
24
24
type: method; text: createContextualFragment(); for: Range
25
+ url: https://w3c.github.io/selection-api/#dom-selection-getrangeat
26
+ type: method; text: getRangeAt(); for: Range
25
27
type: interface
26
28
url: https://w3c.github.io/touch-events/#idl-def-touchevent
27
29
text: TouchEvent
@@ -3034,6 +3036,14 @@ optional <i>suppress observers flag</i>, run these steps:
3034
3036
<li><p> For each <a>live range</a> whose <a for=range>end node</a> is an <a>inclusive descendant</a>
3035
3037
of <var> node</var> , set its <a for=range>end</a> to (<var> parent</var> , <var> index</var> ).
3036
3038
3039
+ <li><p> For each <a>composed live range</a> whose <a for=range>start node</a> is a
3040
+ <a>shadow-including inclusive descendant</a> of <var> node</var> , set its <a for=range>start</a> to
3041
+ (<var> parent</var> , <var> index</var> ).
3042
+
3043
+ <li><p> For each <a>composed live range</a> whose <a for=range>end node</a> is an
3044
+ <a>shadow-including inclusive descendant</a> of <var> node</var> , set its <a for=range>end</a> to
3045
+ (<var> parent</var> , <var> index</var> ).
3046
+
3037
3047
<li><p> For each <a>live range</a> whose <a for=range>start node</a> is <var> parent</var> and
3038
3048
<a for=range>start offset</a> is greater than <var> index</var> , decrease its
3039
3049
<a for=range>start offset</a> by 1.
@@ -5775,7 +5785,8 @@ are:
5775
5785
<hr>
5776
5786
5777
5787
<p> The <dfn method for=Document><code>createRange()</code></dfn> method steps are to return a new
5778
- <a>live range</a> with (<a>this</a> , 0) as its <a for=range>start</a> an <a for=range>end</a> .
5788
+ {{Range}} <a>live range</a> with (<a>this</a> , 0) as its <a for=range>start</a> and <a
5789
+ for=range> end</a> .
5779
5790
5780
5791
<p class=note> The {{Range/Range()}} constructor can be used instead.
5781
5792
@@ -7910,11 +7921,11 @@ range.setEnd(secondText, 4)
7910
7921
<a>node tree</a> above cannot be represented by a <a>range</a> . <a>Ranges</a> are only useful for
7911
7922
<a for=/>nodes</a> .
7912
7923
7913
- <p> {{Range}} objects, unlike {{StaticRange}} objects, are affected by mutations to the
7914
- <a>node tree</a> . Therefore they are also known as <a>live ranges</a> . Such mutations will not
7915
- invalidate them and will try to ensure that it still represents the same piece of content.
7916
- Necessarily, a <a>live range</a> might itself be modified as part of the mutation to the
7917
- <a>node tree</a> when, e.g., part of the content it represents is mutated.
7924
+ <p> {{Range}} objects, unlike {{StaticRange}} objects, are affected by mutations to the <a>node
7925
+ tree</a> . Therefore they are <a>live ranges</a> . Such mutations will not invalidate them and will
7926
+ try to ensure that it still represents the same piece of content. Necessarily, a <a>live range</a>
7927
+ might itself be modified as part of the mutation to the <a>node tree</a> when, e.g., part of the
7928
+ content it represents is mutated.
7918
7929
7919
7930
<p class=note> See the <a for=/>insert</a> and <a for=/>remove</a> algorithms, the
7920
7931
{{Node/normalize()}} method, and the <a>replace data</a> and <a lt="split a Text node">split</a>
@@ -8141,12 +8152,22 @@ interface Range : AbstractRange {
8141
8152
};
8142
8153
</pre>
8143
8154
8144
- <p> Objects implementing the {{Range}} interface are known as
8145
- <dfn export id=concept-live-range>live ranges</dfn> .
8155
+ <p> A <dfn export id=concept-live-range>live range</dfn> is a <a>range</a> that is affected by
8156
+ mutations to the <a>node tree</a> .</p>
8157
+
8158
+ <p> Objects implementing the {{Range}} interface are <a>live ranges</a> .
8146
8159
8147
8160
<p class=note> Algorithms that modify a <a>tree</a> (in particular the <a for=/>insert</a> ,
8148
8161
<a for=/>remove</a> , <a>replace data</a> , and <a lt="split a Text node">split</a> algorithms) modify
8149
- <a>live ranges</a> associated with that <a>tree</a> .
8162
+ <a>live ranges</a> associated with that <a>tree</a> .</p>
8163
+
8164
+ <p> A <dfn export id=concept-composed-live-range>composed live range</dfn> is a <a>live range</a>
8165
+ that has one associated {{Range}} object - <dfn export
8166
+ id=concept-composed-live-range-cached-live-range for="composed live range"> cached live
8167
+ range</dfn> .</p>
8168
+
8169
+ <p class=note> The <a>cached live range</a> is used to maintain backward compatibility with the
8170
+ {{getRangeAt}} API.</p>
8150
8171
8151
8172
<p> The <dfn export id=concept-range-root for="live range">root</dfn> of a <a>live range</a> is the
8152
8173
<a for=tree>root</a> of its <a for=range>start node</a> .
@@ -8216,7 +8237,7 @@ but not its <a for=range>end node</a>, or vice versa.
8216
8237
8217
8238
<dl class=domintro>
8218
8239
<dt><code><var> range</var> = new <a constructor>Range()</a> </code>
8219
- <dd> Returns a new <a>live range</a> .
8240
+ <dd> Returns a new {{Range}} <a>live range</a> .
8220
8241
</dl>
8221
8242
8222
8243
<p> The <dfn constructor for=Range lt="Range()"><code>new Range()</code></dfn> constructor steps are
@@ -8281,6 +8302,10 @@ steps:
8281
8302
8282
8303
<li> Set <var> range</var> 's
8283
8304
<a for=range>start</a> to <var> bp</var> .
8305
+
8306
+ <li> If <var> range</var> is the associated <a>cached live range</a> of a <a>composed live
8307
+ range</a> <var> composed live range</var> , set <var> composed live range</var> ’s <a
8308
+ for="range"> start</a> to <var> bp</var> .
8284
8309
</ol>
8285
8310
<dt> If these steps were invoked as "set the end"
8286
8311
<dd>
@@ -8296,6 +8321,10 @@ steps:
8296
8321
8297
8322
<li> Set <var> range</var> 's
8298
8323
<a for=range>end</a> to <var> bp</var> .
8324
+
8325
+ <li> If <var> range</var> is the associated <a>cached live range</a> of a <a>composed live range</a>
8326
+ <var> composed live range</var> , set <var> composed live range</var> ’s <a for="range">end</a> to
8327
+ <var> bp</var> .
8299
8328
</ol>
8300
8329
</dl>
8301
8330
</ol>
@@ -8576,8 +8605,8 @@ method steps are:
8576
8605
(<var> new node</var> , <var> new offset</var> ).
8577
8606
</ol>
8578
8607
8579
- <p> To <dfn export id=concept-range-extract for="live range">extract</dfn> a <a>live range</a>
8580
- <var> range</var> , run these steps:
8608
+ <p> To <dfn export id=concept-range-extract for="live range">extract</dfn> a {{Range}} <a>live
8609
+ range</a> <var> range</var> , run these steps:
8581
8610
8582
8611
<ol>
8583
8612
<li><p> Let <var> fragment</var> be a new {{DocumentFragment}} <a for=/>node</a> whose
@@ -8753,7 +8782,7 @@ method steps are:
8753
8782
<li> <a>Append</a> <var> clone</var>
8754
8783
to <var> fragment</var> .
8755
8784
8756
- <li> Let <var> subrange</var> be a new <a>live range</a>
8785
+ <li> Let <var> subrange</var> be a new {{Range}} <a>live range</a>
8757
8786
whose <a for=range>start</a> is
8758
8787
(<var> original start node</var> , <var> original start offset</var> ) and
8759
8788
whose <a for=range>end</a> is
@@ -8807,7 +8836,7 @@ method steps are:
8807
8836
<li> <a>Append</a> <var> clone</var>
8808
8837
to <var> fragment</var> .
8809
8838
8810
- <li> Let <var> subrange</var> be a new <a>live range</a>
8839
+ <li> Let <var> subrange</var> be a new {{Range}} <a>live range</a>
8811
8840
whose <a for=range>start</a> is
8812
8841
(<var> last partially contained child</var> , 0) and whose
8813
8842
<a for=range>end</a> is
@@ -8832,7 +8861,7 @@ result of <a for="live range">extracting</a> <a>this</a>.
8832
8861
8833
8862
<p> To
8834
8863
<dfn export id=concept-range-clone for="live range" lt="clone the contents|cloning the contents">clone the contents</dfn>
8835
- of a <a>live range</a> <var> range</var> , run these steps:
8864
+ of a {{Range}} <a>live range</a> <var> range</var> , run these steps:
8836
8865
8837
8866
<ol>
8838
8867
<li><p> Let <var> fragment</var> be a new {{DocumentFragment}} <a for=/>node</a> whose
@@ -8960,7 +8989,7 @@ of a <a>live range</a> <var>range</var>, run these steps:
8960
8989
<li> <a>Append</a> <var> clone</var>
8961
8990
to <var> fragment</var> .
8962
8991
8963
- <li> Let <var> subrange</var> be a new <a>live range</a>
8992
+ <li> Let <var> subrange</var> be a new {{Range}} <a>live range</a>
8964
8993
whose <a for=range>start</a> is
8965
8994
(<var> original start node</var> , <var> original start offset</var> ) and
8966
8995
whose <a for=range>end</a> is
@@ -9018,7 +9047,7 @@ of a <a>live range</a> <var>range</var>, run these steps:
9018
9047
<li> <a>Append</a> <var> clone</var>
9019
9048
to <var> fragment</var> .
9020
9049
9021
- <li> Let <var> subrange</var> be a new <a>live range</a>
9050
+ <li> Let <var> subrange</var> be a new {{Range}} <a>live range</a>
9022
9051
whose <a for=range>start</a> is
9023
9052
(<var> last partially contained child</var> , 0) and whose
9024
9053
<a for=range>end</a> is
@@ -9038,7 +9067,7 @@ of a <a>live range</a> <var>range</var>, run these steps:
9038
9067
result of <a for="live range">cloning the contents</a> of <a>this</a> .
9039
9068
9040
9069
<p> To <dfn export id=concept-range-insert for="live range">insert</dfn> a <a for=/>node</a>
9041
- <var> node</var> into a <a>live range</a> <var> range</var> , run these steps:
9070
+ <var> node</var> into a {{Range}} <a>live range</a> <var> range</var> , run these steps:
9042
9071
9043
9072
<ol>
9044
9073
<li> If <var> range</var> 's <a for=range>start node</a> is a {{ProcessingInstruction}} or {{Comment}}
@@ -9188,7 +9217,8 @@ check first thing, which matches everyone but Firefox.
9188
9217
</ol>
9189
9218
9190
9219
<p> The <dfn method for=Range><code>cloneRange()</code></dfn> method steps are to return a new
9191
- <a>live range</a> with the same <a for=range>start</a> and <a for=range>end</a> as <a>this</a> .
9220
+ {{Range}} <a>live range</a> with the same <a for=range>start</a> and <a for=range>end</a> as
9221
+ <a>this</a> .
9192
9222
9193
9223
<p> The <dfn method for=Range><code>detach()</code></dfn> method steps are to do nothing.
9194
9224
<span class=note> Its functionality (disabling a {{Range}} object) was removed, but the method itself
@@ -10441,6 +10471,7 @@ David Håsäther,
10441
10471
David Hyatt,
10442
10472
Deepak Sherveghar,
10443
10473
Dethe Elza,
10474
+ Di Zhang,
10444
10475
Dimitri Glazkov,
10445
10476
Domenic Denicola,
10446
10477
Dominic Cooney,
0 commit comments