Bug 210166

Summary: Selection.getRangeAt(0) unexpectedly throw IndexSizeError even when node is removed during composition
Product: WebKit Reporter: Xidorn Quan <xidorn-webkit>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: darin, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: CanvaBug, InRadar
Version: Safari 13   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
testcase none

Description Xidorn Quan 2020-04-07 16:55:10 PDT
Created attachment 395760 [details]
testcase

Steps to reproduce:
1. open the attached testcase on Safari on iOS
2. tap on the box (and see the soft keyboard to show up)
3. switch to Japanese keyboard
4. input several characters from the keyboard without picking anything on the word selection bar
5. click "Done" button on top of the soft keyboard

At that point, you should see the text box removed from the page.

Expected result:
The selection info text should say there is no selection (indicating selection.rangeCount is zero).

Actual result:
The selection info text says IndexSizeError (indicating selection.rangeCount is one but getRangeAt(0) throws).
Comment 1 Radar WebKit Bug Importer 2020-04-08 17:00:30 PDT
<rdar://problem/61485999>