-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI events containing lone surrogates #227
Comments
@annevk Thanks a lot for getting the ball rolling on this! I created a reduced test case (JS only, no wasm): http://paaru.pbworks.com/w/file/fetch/132853233/input-bug.html I was able to reproduce it with Windows 10 (64-bit) with the following browsers:
Interestingly, I could not reproduce it with these browsers (they do not have this bug):
|
https://hsivonen.com/test/moz/input.html is probably of interest when testing. |
The Windows 10 onscreen keyboard generates a keydown/keyup pair for each surrogate in Firefox but a keydown/keyup pair per scalar value in Edge. (Note that multi-scalar value emoji generate multiple keydown/keyup pairs in Edge, i.e. every scalar value of an emoji is a keystroke.) |
Hah. https://docs.microsoft.com/en-us/windows/desktop/inputdev/wm-unichar says this goes back to XP! |
Correction: Edge doesn't issue keyup events for emoji. |
Chrome seems to expose the unpaired surrogate in |
@hsivonen Thanks! I'm excited to see this fixed in browsers proper, so we won't need any more workarounds. |
IE has been able to report a single keystroke (with a surrogate pair in the |
@travisleithead, are you aware of any reason why other browsers shouldn't adopt the Trident/EdgeHTML behavior here? (Firefox on Linux appears to have been shy to report astral keystrokes as keystrokes and instead emits fake composition events for them. Based on the source comments, it looks this wasn't motivated by a concrete Web compat reason and was done just in case.) |
Per WebAssembly/interface-types#21 (comment) it's possible for
input
events to contain lone surrogates, at least on Windows. Perhaps we should require browsers to coalesce such events, if possible, to prevent none scalar values from being handed to JavaScript.cc @Pauan @alexcrichton @lukewagner
The text was updated successfully, but these errors were encountered: