| Index: third_party/WebKit/Source/core/events/MouseEvent.cpp
|
| diff --git a/third_party/WebKit/Source/core/events/MouseEvent.cpp b/third_party/WebKit/Source/core/events/MouseEvent.cpp
|
| index ace0d091e15826f7c909f3850f520f6463d59ada..249ff6911f64d52ac64b89acb70edf682f6b541d 100644
|
| --- a/third_party/WebKit/Source/core/events/MouseEvent.cpp
|
| +++ b/third_party/WebKit/Source/core/events/MouseEvent.cpp
|
| @@ -78,6 +78,19 @@ const LayoutObject* FindTargetLayoutObject(Node*& target_node) {
|
| return layout_object;
|
| }
|
|
|
| +unsigned short WebPointerPropertiesButtonToButton(
|
| + const AtomicString& event_name,
|
| + WebPointerProperties::Button button) {
|
| + if (event_name == EventTypeNames::mousemove ||
|
| + event_name == EventTypeNames::mouseleave ||
|
| + event_name == EventTypeNames::mouseenter ||
|
| + event_name == EventTypeNames::mouseover ||
|
| + event_name == EventTypeNames::mouseout) {
|
| + return 0;
|
| + }
|
| + return static_cast<unsigned short>(button);
|
| +}
|
| +
|
| } // namespace
|
|
|
| MouseEvent* MouseEvent::Create(ScriptState* script_state,
|
| @@ -173,7 +186,7 @@ MouseEvent::MouseEvent(const AtomicString& event_type,
|
| screen_location_(event.PositionInScreen().x, event.PositionInScreen().y),
|
| movement_delta_(FlooredIntPoint(event.MovementInRootFrame())),
|
| position_type_(PositionType::kPosition),
|
| - button_(static_cast<short>(event.button)),
|
| + button_(WebPointerPropertiesButtonToButton(event_type, event.button)),
|
| buttons_(WebInputEventModifiersToButtons(event.GetModifiers())),
|
| related_target_(related_target),
|
| synthetic_event_type_(event.FromTouch() ? kFromTouch
|
|
|