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

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: addressed comments 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..e2930579f4361e3d2ab03cf5291eae95edd2d144 100644
--- a/Source/web/WebInputEventConversion.cpp
+++ b/Source/web/WebInputEventConversion.cpp
@@ -104,6 +104,12 @@ PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget, const WebMo
m_modifiers |= PlatformEvent::AltKey;
if (e.modifiers & WebInputEvent::MetaKey)
m_modifiers |= PlatformEvent::MetaKey;
+ if (e.modifiers & WebInputEvent::LeftButtonDown)
+ m_modifiers |= PlatformEvent::LeftButtonDown;
+ if (e.modifiers & WebInputEvent::MiddleButtonDown)
+ m_modifiers |= PlatformEvent::MiddleButtonDown;
+ if (e.modifiers & WebInputEvent::RightButtonDown)
+ m_modifiers |= PlatformEvent::RightButtonDown;
m_modifierFlags = e.modifiers;
m_timestamp = e.timeStampSeconds;
@@ -152,6 +158,12 @@ PlatformWheelEventBuilder::PlatformWheelEventBuilder(Widget* widget, const WebMo
m_modifiers |= PlatformEvent::AltKey;
if (e.modifiers & WebInputEvent::MetaKey)
m_modifiers |= PlatformEvent::MetaKey;
+ if (e.modifiers & WebInputEvent::LeftButtonDown)
+ m_modifiers |= PlatformEvent::LeftButtonDown;
+ if (e.modifiers & WebInputEvent::MiddleButtonDown)
+ m_modifiers |= PlatformEvent::MiddleButtonDown;
+ if (e.modifiers & WebInputEvent::RightButtonDown)
+ m_modifiers |= PlatformEvent::RightButtonDown;
m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas;
#if OS(MACOSX)

Powered by Google App Engine
This is Rietveld 408576698