getClientRects returns empty result if the range selects only collapsed whitespaces |
|||
Issue descriptionChrome Version: M63 ToT What steps will reproduce the problem? (1) Create a document with HTML "<div>foo bar</div>" (2) Create a range selecting offset range [5, 6] on the text node (3) Call getClientRects() on the range What is the expected result? getClientRects() returns a "caret" before "bar" What happens instead? getClientRects() returned an empty list The spec (*) is pretty vague on what rects should be returned from a text node. However, we should at least ensure that the result matches selection painting. (*) https://drafts.csswg.org/cssom-view/#dom-range-getclientrects
,
Oct 13 2017
Not going to work on it shortly.
,
Jan 10 2018
,
May 4 2018
I have another test case at http://jsbin.com/nupinokisu/1/edit?html,js,output See Case 5. Note that if only 3 spaces are between "a" and "b", all the collapsed positions next to or between spaces will produce a non-empty rect list. Only with at least 4 spaces does the bug appear. Also note Case 4: when selecting between the first two spaces after "a": while getClientRects() does returns a non-empty list, the width of the first rect is non-zero, which is questionable. |
|||
►
Sign in to add a comment |
|||
Comment 1 by xiaoche...@chromium.org
, Sep 13 2017