In order for editors to move the selections temporary, do some work in other regions, then restore the selections back, we need a new APIs.
This APIs not only save all public properties of selections but also internal states as well, so that the selections can really be restored.
There are some details we need to take care of, such as IME uncommitted strings. Usually IME uncommitted strings are committed when the selections are changed. But since IME uncommitted strings are part of the internal selection states, and since we want to restore it later, UA should cancel them on save (or save then move the selection.) Not sure whether this should be spec'ed, just an informative note, or not needed in the spec though.
Forked from w3c/editing-explainer#39.
To summarize:
In order for editors to move the selections temporary, do some work in other regions, then restore the selections back, we need a new APIs. This APIs not only save all public properties of selections but also internal states as well, so that the selections can really be restored. There are some details we need to take care of, such as IME uncommitted strings. Usually IME uncommitted strings are committed when the selections are changed. But since IME uncommitted strings are part of the internal selection states, and since we want to restore it later, UA should cancel them on save (or save then move the selection.) Not sure whether this should be spec'ed, just an informative note, or not needed in the spec though.