- From: TAMURA, Kent <notifications@github.com>
- Date: Sun, 19 Feb 2017 23:44:35 -0800
- To: w3c/selection-api <selection-api@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 20 February 2017 07:45:09 UTC
The specification doesn't define ```Selection``` interface behavior in a case where browsing context was lost. ``` <!DOCTYPE html> <iframe src="about:blank"></iframe> <p>abc</p> <script> window.onload = function() { var iframe = document.querySelector('iframe'); var selection = iframe.contentWindow.getSelection(); iframe.remove(); selection.removeAllRanges(); var range = document.createRange(); range.setStart(document, 0); selection.addRange(range); selection.extend(document, 1); alert('rangeCount=' + selection.rangeCount); }; </script> ``` With this code, Safari, Edge, and Chrome: ```selection``` functions look to do nothing. ```alert()``` shows "rangeCount=0" Firefox: ```addRange()``` succeeds, but ```extend()``` results in ```NS_ERROR_FAILURE``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/selection-api/issues/82
Received on Monday, 20 February 2017 07:45:09 UTC