| Index: third_party/WebKit/Source/core/events/PointerEventFactory.cpp
|
| diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
|
| index 671129364bd1a03a814805c953427551c49a2d0a..ef93631cd36dd7b0459ea194c434603f576bb1d1 100644
|
| --- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
|
| +++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
|
| @@ -21,8 +21,6 @@
|
| case WebPointerProperties::PointerType::Touch:
|
| return "touch";
|
| case WebPointerProperties::PointerType::Pen:
|
| - case WebPointerProperties::PointerType::Eraser:
|
| - // TODO(mustaq): Fix when the spec starts supporting hovering erasers.
|
| return "pen";
|
| case WebPointerProperties::PointerType::Mouse:
|
| return "mouse";
|
| @@ -56,22 +54,16 @@
|
|
|
| unsigned short buttonToButtonsBitfield(WebPointerProperties::Button button)
|
| {
|
| -#define CASE_BUTTON_TO_BUTTONS(enumLabel) \
|
| - case WebPointerProperties::Button::enumLabel:\
|
| - return static_cast<unsigned short>(WebPointerProperties::Buttons::enumLabel)
|
| -
|
| switch (button) {
|
| - CASE_BUTTON_TO_BUTTONS(NoButton);
|
| - CASE_BUTTON_TO_BUTTONS(Left);
|
| - CASE_BUTTON_TO_BUTTONS(Right);
|
| - CASE_BUTTON_TO_BUTTONS(Middle);
|
| - CASE_BUTTON_TO_BUTTONS(X1);
|
| - CASE_BUTTON_TO_BUTTONS(X2);
|
| - CASE_BUTTON_TO_BUTTONS(Eraser);
|
| - }
|
| -
|
| -#undef CASE_BUTTON_TO_BUTTONS
|
| -
|
| + case WebPointerProperties::Button::NoButton:
|
| + return static_cast<unsigned short>(MouseEvent::Buttons::None);
|
| + case WebPointerProperties::Button::Left:
|
| + return static_cast<unsigned short>(MouseEvent::Buttons::Left);
|
| + case WebPointerProperties::Button::Right:
|
| + return static_cast<unsigned short>(MouseEvent::Buttons::Right);
|
| + case WebPointerProperties::Button::Middle:
|
| + return static_cast<unsigned short>(MouseEvent::Buttons::Middle);
|
| + }
|
| NOTREACHED();
|
| return 0;
|
| }
|
| @@ -97,15 +89,7 @@
|
| const IncomingId incomingId(pointerType, pointerProperties.id);
|
| int pointerId = addIdAndActiveButtons(incomingId, buttons != 0);
|
|
|
| - // Tweak the |buttons| to reflect pen eraser mode only if the pen is in
|
| - // active buttons state w/o even considering the eraser button.
|
| - // TODO(mustaq): Fix when the spec starts supporting hovering erasers.
|
| - if (pointerType == WebPointerProperties::PointerType::Eraser && buttons != 0) {
|
| - buttons |= static_cast<unsigned>(WebPointerProperties::Buttons::Eraser);
|
| - buttons &= ~static_cast<unsigned>(WebPointerProperties::Buttons::Left);
|
| - }
|
| pointerEventInit.setButtons(buttons);
|
| -
|
| pointerEventInit.setPointerId(pointerId);
|
| pointerEventInit.setPointerType(pointerTypeNameForWebPointPointerType(pointerType));
|
| pointerEventInit.setIsPrimary(isPrimary(pointerId));
|
| @@ -158,12 +142,7 @@
|
|
|
| if (pointerEventName == EventTypeNames::pointerdown
|
| || pointerEventName == EventTypeNames::pointerup) {
|
| - WebPointerProperties::Button button = mouseEvent.pointerProperties().button;
|
| - // TODO(mustaq): Fix when the spec starts supporting hovering erasers.
|
| - if (mouseEvent.pointerProperties().pointerType == WebPointerProperties::PointerType::Eraser
|
| - && button == WebPointerProperties::Button::Left)
|
| - button = WebPointerProperties::Button::Eraser;
|
| - pointerEventInit.setButton(static_cast<int>(button));
|
| + pointerEventInit.setButton(static_cast<int>(mouseEvent.pointerProperties().button));
|
| } else {
|
| DCHECK(pointerEventName == EventTypeNames::pointermove);
|
| pointerEventInit.setButton(static_cast<int>(WebPointerProperties::Button::NoButton));
|
|
|