no clientRects given when cursor is next to an image in contenteditable div
Reported by
tbri...@gmail.com,
Aug 12 2016
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.57 Safari/537.36 Steps to reproduce the problem: 1. create div with contenteditable attribute that contains an image 2. place cursor on either side of the image 3. execute getSelection().getRangeAt(0).getClientRects() What is the expected behavior? return a ClientRectList with 1 ClientRect representing the cursor What went wrong? returns a ClientRectList with length 0; Did this work before? No Chrome version: 53.0.2785.57 Channel: beta OS Version: 10.0 Flash Version: here is a jsfiddle to test it: https://jsfiddle.net/UziTech/ksr2oers/
,
Aug 15 2016
,
Oct 12 2016
,
Oct 12 2016
,
Aug 11 2017
This is working as intended: When the cursor is next to the image, its Range is a collapsed range at (div, 2) or (div, 4). According to the spec (*), getClientRects() should return: - The range doesn't select any element, so no element's border area is added to result list - The range doesn't select or partially select any Text node, so no rect from Text nodes is added to result list So it returns an empty list. Unless we want to change the spec, say, by adding a special case when the range is collapsed and right next to a Text node or replaced element? (*) https://drafts.csswg.org/cssom-view/#dom-range-getclientrects
,
Aug 16 2017
If a collapsed range inside, or next to, a text node is considered "partially selected" then it seems like a collapsed range next to an image element should also be considered "partially selected". We may have to change the spec to account for partially selected elements
,
Oct 4 2017
,
Oct 4
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
,
Oct 5
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by cbiesin...@chromium.org
, Aug 12 2016