Load this page into Chrome ToT (attached):
<!doctype html>
<style>div:first-letter {color:red;}</style>
<div contenteditable> hello world'</div>
<script>
const sel = window.getSelection();
sel.collapse(document.querySelector('div').firstChild, 13);
sel.modify('extend', 'backward', 'word');
</script>
Then inspect the value of window.getSelection().focusOffset()
The expected focus offset should be 6, but the reported offset is 5.
Note: the rendered selection is correct (|world'^), which is actually two bugs canceling each other:
1. This issue calculates an incorrect selection, which is shifted by 1 character to the left
2. Issue 406218 : The actually rendered selection is shifted by 1 character to the right compared to the calculated selection, making the rendered selection at the correct position...
|
Deleted:
extend_backward_by_word_first_letter.html
258 bytes
|
|
extend_backward_by_word_first_letter.html
258 bytes
View
Download
|
Comment 1 by yosin@chromium.org
, Mar 16 2017