Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2126)

Unified Diff: Source/web/WebInputEventConversion.cpp

Issue 933323002: Add experimental Support for DOM3 KeyboardEvent key value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added BugId for fixing lazy initialization Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/WebInputEventConversion.cpp
diff --git a/Source/web/WebInputEventConversion.cpp b/Source/web/WebInputEventConversion.cpp
index f079db9309930e2ba5e1abcbb1f64816480ea628..254c913e854cab26bc399e5af35ccd917f3296e9 100644
--- a/Source/web/WebInputEventConversion.cpp
+++ b/Source/web/WebInputEventConversion.cpp
@@ -306,7 +306,9 @@ PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder(const WebKeyboardEven
m_nativeVirtualKeyCode = e.nativeKeyCode;
m_isKeypad = (e.modifiers & WebInputEvent::IsKeyPad);
m_isSystemKey = e.isSystemKey;
+ // TODO: BUG482880 Fix this initialization to lazy initialization.
m_code = Platform::current()->domCodeStringFromEnum(e.domCode);
+ m_key = Platform::current()->domKeyStringFromEnum(e.domKey);
m_modifiers = toPlatformEventModifiers(e.modifiers);
@@ -627,6 +629,7 @@ WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
return;
nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode();
domCode = Platform::current()->domEnumFromCodeString(event.keyEvent()->code());
+ domKey = Platform::current()->domKeyEnumFromString(event.keyEvent()->key());
unsigned numberOfCharacters = std::min(event.keyEvent()->text().length(), static_cast<unsigned>(textLengthCap));
for (unsigned i = 0; i < numberOfCharacters; ++i) {
text[i] = event.keyEvent()->text()[i];

Powered by Google App Engine
This is Rietveld 408576698