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

Unified Diff: Source/WebKit/chromium/src/WebInputEventConversion.cpp

Issue 15320003: Fix WebInputEventConversion conversion from Platform to Web KeyboardEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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
« no previous file with comments | « LayoutTests/inspector-protocol/input/dispatchKeyEvent-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/WebInputEventConversion.cpp
diff --git a/Source/WebKit/chromium/src/WebInputEventConversion.cpp b/Source/WebKit/chromium/src/WebInputEventConversion.cpp
index 420bc17aaac06116e245608b15135c871e427846..5a7c4ee9248c3742222d56d1b5a7e79c6eb81670 100644
--- a/Source/WebKit/chromium/src/WebInputEventConversion.cpp
+++ b/Source/WebKit/chromium/src/WebInputEventConversion.cpp
@@ -623,8 +623,8 @@ WebKeyboardEventBuilder::WebKeyboardEventBuilder(const WebCore::PlatformKeyboard
windowsKeyCode = windowsKeyCodeWithoutLocation(event.windowsVirtualKeyCode());
modifiers |= locationModifiersFromWindowsKeyCode(event.windowsVirtualKeyCode());
- memcpy(text, event.text().characters(), std::min(static_cast<unsigned>(textLengthCap), event.text().length()));
- memcpy(unmodifiedText, event.unmodifiedText().characters(), std::min(static_cast<unsigned>(textLengthCap), event.unmodifiedText().length()));
+ memcpy(text, event.text().characters(), std::min(static_cast<unsigned>(textLengthCap), event.text().length()) * sizeof(UChar));
+ memcpy(unmodifiedText, event.unmodifiedText().characters(), std::min(static_cast<unsigned>(textLengthCap), event.unmodifiedText().length()) * sizeof(UChar));
memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), std::min(static_cast<unsigned>(keyIdentifierLengthCap), event.keyIdentifier().length()));
}
« no previous file with comments | « LayoutTests/inspector-protocol/input/dispatchKeyEvent-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698