Overview: DOM KeyboardEvents reach plug-ins in Chromium via the WebPluginContainerImpl, which converts them to Chromium's WebKeyboardEvent. The conversion process doesn't currently propagate the keyIdentifier field (presumably because that is never currently passed to plug-ins). Steps to Reproduce: Try to use the keyIdentifier field of the WebKeyboardEvent from plug-in code. Actual Results: The keyIdentifier string will be empty. Expected Results: The keyIdentifier field should contain a character key-value (e.g. U+0041) or key function name (e.g. "Shift"). Build Date & Platform: Build 2011-03-21 on Linux w/ Chromium development build.
Created attachment 86613 [details] Patch
Looks no harm. This patch would be safe to r+ for any reviewers ;-)
Comment on attachment 86613 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=86613&action=review > Source/WebKit/chromium/src/WebInputEventConversion.cpp:339 > + sizeof(keyIdentifier) - 1); I dislike strncpy. It does weird things. (Why fill in all those 0's?) What about memcpy? memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), std::min(sizeof(keyIdentifier) - 1, event.keyIdentifier().ascii().length()); keyIdentifier[event.keyIdentifier().ascii().length()] = '\0'; (Of course, you may want to put event.keyIdentifier().ascii() in a local and possible length as well, so I guess that makes it slightly longer.) What do you think?
fwiw, I tried to find a function in webkit that did this but failed.
Comment on attachment 86613 [details] Patch r- per David's last comment.
https://code.google.com/p/chromium/issues/detail?id=230550