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 727593003: Implement MouseEvent buttons attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 1fa3ef12377eccd97dc053e31dd96266d4320402..53df75efb56c6f7568ecc28cb887cf653c460226 100644
--- a/Source/web/WebInputEventConversion.cpp
+++ b/Source/web/WebInputEventConversion.cpp
@@ -95,6 +95,14 @@ PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget, const WebMo
m_movementDelta = IntPoint(scaleDeltaToWindow(widget, e.movementX), scaleDeltaToWindow(widget, e.movementY));
m_button = static_cast<MouseButton>(e.button);
+ m_buttons = 0;
+ if (e.modifiers & WebInputEvent::LeftButtonDown)
Rick Byers 2014/11/14 19:48:09 Please extend the unit tests in WebInputEventConve
Rick Byers 2014/11/14 19:48:09 Oh cool, I didn't realize this data was already pr
zino 2014/11/18 14:19:35 Windows / Linux / Mac works well via layout tests
zino 2014/11/18 14:19:35 I don't think we may need it in new implementation
Rick Byers 2014/11/18 20:29:18 I guess your changes in WebInputConversion.cpp are
Rick Byers 2014/11/18 20:29:18 The behavior I'm worried about here isn't covered
zino 2014/11/24 13:07:07 The modifiers value is passed from ui::EventFlagsF
Rick Byers 2014/11/25 17:44:27 Sounds good, thanks for digging into this!
+ m_buttons |= 1;
+ if (e.modifiers & WebInputEvent::RightButtonDown)
+ m_buttons |= 2;
+ if (e.modifiers & WebInputEvent::MiddleButtonDown)
+ m_buttons |= 4;
+
m_modifiers = 0;
if (e.modifiers & WebInputEvent::ShiftKey)
m_modifiers |= PlatformEvent::ShiftKey;

Powered by Google App Engine
This is Rietveld 408576698