It turned out that our rendering engine doesn't support non-canonicalized endpoints for selection and this causes a problem for us. We should ensure selection end points are always canonicalized. In addition, selectionchange event isn't fired when nodeWillBeRemoved and textWillBeReplaced updates end points using setWithoutValidation.