Bug 159063 - characterSubrange returns a single character range for an empty range
Summary: characterSubrange returns a single character range for an empty range
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 9
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-23 11:06 PDT by Alexey Proskuryakov
Modified: 2016-06-23 11:06 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2016-06-23 11:06:08 PDT
As seen in bug 159062, DictionaryLookup::rangeAtHitTestResult returns a 1-character string when -[LULookupDefinitionModule tokenRangeForString:range:options:] returns (0, 0).

This seems like a pretty crazy bug deep inside editing code - why do we do this? We pass (0, 0) to TextIterator::subrange, then it goes to characterSubrange, and it becomes 1-character when routed through a character iterator.