Bug 159063

Summary: characterSubrange returns a single character range for an empty range
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: enrica, rniwa
Priority: P2    
Version: Safari 9   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=159062

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.