Related to whatwg/dom#772
Currently, Chrome and Firefox returns mutable reference of Range object from Selection.getRangeAt(). Then, the Range can be updated outside the DOM tree, e.g., into a different document, into a disconnected tree. I wrote a test, then, both Chrome and Firefox get same result.
I believe that Selection should not keep storing a range whose boundary points' root is not the document associated with the Selection because this kind of checks are done at Selection.addRange() at least.
Cc: @sefeng211, @smaug----, @zcorpan
Related to whatwg/dom#772
Currently, Chrome and Firefox returns mutable reference of
Rangeobject fromSelection.getRangeAt(). Then, theRangecan be updated outside the DOM tree, e.g., into a different document, into a disconnected tree. I wrote a test, then, both Chrome and Firefox get same result.I believe that
Selectionshould not keep storing a range whose boundary points' root is not the document associated with theSelectionbecause this kind of checks are done atSelection.addRange()at least.Cc: @sefeng211, @smaug----, @zcorpan