Open shlyakpavel opened 1 month ago
This html has the same behavior as google.com
<!DOCTYPE html>
<body>
<form>
<input type="text" id="inputField" name="inputField" required>
</form>
</body>
</html>
I suppose any input field is affected
P. S. Also, any 3 Cyrillic character sequence fails the same way, при is just one example for those who are not familiar with it
The underlying error message is:
String::from_utf8: Input was not valid UTF-8
I can also reproduce this, and I think it's something to do with bytes vs. characters. Calling end_offset()
returns three, but there are six bytes. Then, we substring_view()
those with the given offsets which produces an invalid string.
That's no more crashing the browser, although both input and selection are still failing
To reproduce (on macOS, I did not test other OS):
With latest ladybird, open http://google.com
Type при (you will see that the cursor locator is positioned at the wrong location (should be at the end of the line)
Now press cmd+a (or similar) to select the text (all 3 characters you typed)
Press backspace or delete. Voila, browser has crashed!
P. S. If you cannot type Cyrillic character, feel free to copy
при
from this issue. It fails the same way