New issue
Advanced search Search tips

Issue 671104 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Backward searching of word boundary does not work with first-letter

Project Member Reported by xiaoche...@chromium.org, Dec 5 2016

Issue description

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...
 
extend_backward_by_word_first_letter.html
258 bytes View Download

Comment 1 by yosin@chromium.org, Mar 16 2017

Components: -Blink>Editing Blink>Editing>Selection
The patch[1] makes Selection#modify() not to use backward word boundary search.


[1] http://crrev.com/754543004: Make Selection#modify() with word granularity not to skip punctuation
Project Member

Comment 2 by sheriffbot@chromium.org, Apr 6 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 3 by yosin@chromium.org, Apr 18 2018

Status: Available (was: Untriaged)

Sign in to add a comment