ASSIGNED207724
[iOS] ASSERTION FAILED: index == indexComputedByVisiblePosition in HTMLTextFormControlElement::indexForPosition()
https://bugs.webkit.org/show_bug.cgi?id=207724
Summary [iOS] ASSERTION FAILED: index == indexComputedByVisiblePosition in HTMLTextFo...
Daniel Bates
Reported 2020-02-13 15:01:57 PST
Steps to repro: 1. Visit <data:text/html,<input placeholder="placeholder" oninput="this.selectionStart">> 2. Tap field. 3. Press ‘h’ on the keyboard.
Attachments
Patch (2.64 KB, patch)
2020-02-13 15:10 PST, Daniel Bates
pvollan: review+
Daniel Bates
Comment 1 2020-02-13 15:05:08 PST
Assert is always incorrect because of FIXME in HTMLTextFormControlElement::indexForPosition(). Well, FIXME is correct: [[ index = std::min(index, length); // FIXME: We shouldn't have to call innerTextValue() just to ignore the last LF. See finishText. ]] <https://trac.webkit.org/browser/trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp?rev=256197#L652> but doesn't explain why. innerTextValue() is wrong because it represents the AFTER insertion value of the field. But the passed position is BEFORE insertion. So, guaranteed mismatch if indexForPosition() is called when the text input event is dispatched.
Daniel Bates
Comment 2 2020-02-13 15:06:03 PST
I am just going to get rid of the assert because I would need to study the code to actually fix it up. The code has had the original FIXME since it was written in 2014!
Daniel Bates
Comment 3 2020-02-13 15:10:48 PST
Per Arne Vollan
Comment 4 2020-02-13 15:11:42 PST
Comment on attachment 390692 [details] Patch R=me.
Daniel Bates
Comment 5 2020-02-13 15:19:44 PST
Note You need to log in before you can comment on or make changes to this bug.