Re: [w3c/selection-api] Clarify how text selection in <input> and <textarea> work with Selection interface (#83)

```
<!DOCTYPE html>
<body><div></div><input value="initial"><div></div>
<script>
var sel = getSelection();
sel.removeAllRanges();
var i = document.querySelector('input');
i.setSelectionRange(1, 1);
alert('before focus: ' + sel.anchorNode + ' ' + sel.anchorOffset +
  ' ' + sel.focusNode + ' ' + sel.focusOffset);

i.focus();
alert('after focus: ' + sel.anchorNode + ' ' + sel.anchorOffset +
  ' ' + sel.focusNode + ' ' + sel.focusOffset);
</script>
</div>
```
&nbsp;  | Firefox | Chrome | WebKit | Edge
-- | ------- | ------ | ------ | ----
before focus | null 0 null 0 | null 0 null 0 | body 1 body 1 | body 1 body 1
after focus | body 1 body 1 | body 1 body 1 | body 1 body 1 | body 1 body 1

It seems a difference is only how text control selection API works without focus.


-- 
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/83#issuecomment-284576605

Received on Tuesday, 7 March 2017 00:07:12 UTC