| 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..c8db6a7220fddfdb07472dbb869ee535aa73ae42 100644
|
| --- a/third_party/WebKit/Source/core/events/MouseEvent.cpp
|
| +++ b/third_party/WebKit/Source/core/events/MouseEvent.cpp
|
| @@ -384,6 +384,18 @@ bool MouseEvent::IsMouseEvent() const {
|
| return true;
|
| }
|
|
|
| +short MouseEvent::button() const {
|
| + const AtomicString& event_name = type();
|
| + if (button_ == -1 || event_name == EventTypeNames::mousemove ||
|
| + event_name == EventTypeNames::mouseleave ||
|
| + event_name == EventTypeNames::mouseenter ||
|
| + event_name == EventTypeNames::mouseover ||
|
| + event_name == EventTypeNames::mouseout) {
|
| + return 0;
|
| + }
|
| + return button_;
|
| +}
|
| +
|
| int MouseEvent::which() const {
|
| // For the DOM, the return values for left, middle and right mouse buttons are
|
| // 0, 1, 2, respectively.
|
|
|