diff --git a/dom.bs b/dom.bs index 09595a60..059b8c94 100644 --- a/dom.bs +++ b/dom.bs @@ -2788,11 +2788,13 @@ before a child, with an optional suppress observers flag, run

If child is non-null:

    -
  1. For each live range whose start node is parent and +

  2. For each live range or composed range whose + start node is parent and start offset is greater than child's index, increase its start offset by count. -

  3. For each live range whose end node is parent and +

  4. For each live range or composed range whose + end node is parent and end offset is greater than child's index, increase its end offset by count.

@@ -4647,20 +4649,24 @@ each descendant exclusive Text node nod

While currentNode is an exclusive Text node:

    -
  1. For each live range whose start node is currentNode, +

  2. For each live range or composed range whose + start node is currentNode, add length to its start offset and set its start node to node. -

  3. For each live range whose end node is currentNode, add +

  4. For each live range or composed range whose + end node is currentNode, add length to its end offset and set its end node to node. -

  5. For each live range whose start node is currentNode's +

  6. For each live range or composed range whose + start node is currentNode's parent and start offset is currentNode's index, set its start node to node and its start offset to length. -

  7. For each live range whose end node is currentNode's +

  8. For each live range or composed range whose + end node is currentNode's parent and end offset is currentNode's index, set its end node to node and its end offset to length. @@ -5925,7 +5931,7 @@ are:


    The createRange() method steps are to return a new -live range with (this, 0) as its start an end. +live range with (this, 0) as its start and end.

    The {{Range/Range()}} constructor can be used instead. @@ -7734,21 +7740,25 @@ string called data. node's data. -

  9. For each live range whose start node is node and +

  10. For each live range or composed range whose + start node is node and start offset is greater than offset but less than or equal to offset plus count, set its start offset to offset. -

  11. For each live range whose end node is node and +

  12. For each live range or composed range whose + end node is node and end offset is greater than offset but less than or equal to offset plus count, set its end offset to offset. -

  13. For each live range whose start node is node and +

  14. For each live range or composed range whose + start node is node and start offset is greater than offset plus count, increase its start offset by data's length and decrease it by count. -

  15. For each live range whose end node is node and +

  16. For each live range or composed range whose + end node is node and end offset is greater than offset plus count, increase its end offset by data's length and decrease it by count. @@ -7940,22 +7950,26 @@ constructor steps are to set this's data to -

  17. For each live range whose start node is node and +

  18. For each live range or composed range whose + start node is node and start offset is greater than offset, set its start node to new node and decrease its start offset by offset. -

  19. For each live range whose end node is node and +

  20. For each live range or composed range whose + end node is node and end offset is greater than offset, set its end node to new node and decrease its end offset by offset. -

  21. For each live range whose start node is parent and +

  22. For each live range or composed range whose + start node is parent and start offset is equal to the index of node plus 1, increase its start offset by 1. -

  23. For each live range whose end node is parent and +

  24. For each live range or composed range whose + end node is parent and end offset is equal to the index of node plus 1, increase its end offset by 1.

@@ -8135,6 +8149,43 @@ be between 0 and the boundary point's node's +

The +composed position of a +boundary point (nodeA, offsetA) relative to a boundary point +(nodeB, offsetB) is +composed before, +composed equal, or +composed after, +as returned by these steps: + +

    +
  1. Assert: nodeA and nodeB have the same shadow-including root. + +

  2. If nodeA comes before nodeB in shadow-including tree order, then + return composed before. + +
  3. If nodeA comes after nodeB in shadow-including tree order, then + return composed after. + +
  4. Assert: nodeA is nodeB. + +

  5. +

    If the position of (nodeA, offsetA) + relative to (nodeB, offsetB) is: + +

    +
    before +
    Return composed before. + +
    equal +
    Return composed equal. + +
    after +
    Return composed after. +
    + +
+

Interface {{AbstractRange}}

@@ -8305,6 +8356,13 @@ interface Range : AbstractRange {
 remove, move, replace data, and split
 algorithms) modify live ranges associated with that tree.
 
+

A composed range is a +range with an associated live range called +legacy uncomposed range. + +

The legacy uncomposed range is used to maintain +backward compatibility with the {{Selection/getRangeAt()}} API. +

The root of a live range is the root of its start node. @@ -8386,11 +8444,21 @@ follows:

  • For each live range whose end node is an inclusive descendant of node, set its end to (parent, index). -

  • For each live range whose start node is parent and +

  • For each composed range whose start node is a + shadow-including inclusive descendant of node, set its start to + (parent, index). + +

  • For each composed range whose end node is a + shadow-including inclusive descendant of node, set its end to + (parent, index). + +

  • For each live range or composed range whose + start node is parent and start offset is greater than index, decrease its start offset by 1. -

  • For each live range whose end node is parent and +

  • For each live range or composed range whose + end node is parent and end offset is greater than index, decrease its end offset by 1. @@ -8433,9 +8501,9 @@ to set this's start and end to


    To -set the start or end -of a range to a boundary point (node, offset), run these -steps: + +set the start or end of a live range range to a boundary point +(node, offset), run these steps:

    1. If node is a doctype, then throw an @@ -8448,6 +8516,11 @@ steps: boundary point (node, offset). +
    2. Let composed range be null. + +
    3. If range is the legacy uncomposed range of a + composed range, set composed range to that composed range. +
    4. If these steps were invoked as "set the start" @@ -8464,6 +8537,21 @@ steps:
    5. Set range's start to bp. + +
    6. If composed range is not null, then: +
        +
      1. If composed range's start node's + shadow-including root is not the same as + node's shadow-including root, + or if bp is + composed after the + composed range's end, set + composed range's + end to bp. + +
      2. Set composed range’s + start to bp. +
    If these steps were invoked as "set the end"
    @@ -8479,10 +8567,29 @@ steps:
  • Set range's end to bp. + +
  • If composed range is not null, then: +
      +
    1. If composed range's end node's + shadow-including root is not the same as + node's shadow-including root, + or if bp is + composed before the + composed range's start, set + composed range's + start to bp. + +
    2. Set composed range’s + end to bp. +
    +

    The composed range's start and +end can have different roots, but will have the +same shadow-including root. +

    The setStart(node, offset) method steps are to set the start of this to boundary point (node, offset). @@ -10624,6 +10731,7 @@ David Håsäther, David Hyatt, Deepak Sherveghar, Dethe Elza, +Di Zhang, Dimitri Glazkov, Domenic Denicola, Dominic Cooney,