Commit 2591b1df authored by thestig's avatar thestig Committed by Commit bot

Revert of Use changed_button_flags() when converting MouseEvent to...

Revert of Use changed_button_flags() when converting MouseEvent to blink::WebMouseEvent. (patchset #2 id:20001 of https://codereview.chromium.org/302593002/)

Reason for revert:
Aura builds fail DCHECKs:

ASSERTION FAILED: event.type() == PlatformEvent::MouseMoved || event.button() != NoButton
third_party/WebKit/Source/core/events/MouseEvent.cpp(54)

blink::MouseEvent::create()
blink::Node::dispatchMouseEvent()
blink::EventHandler::dispatchMouseEvent()
blink::EventHandler::handleMousePressEvent()
blink::PageWidgetEventHandler::handleMouseDown()
blink::WebViewImpl::handleMouseDown()
blink::WebViewImpl::handleMouseDown()
blink::PageWidgetDelegate::handleInputEvent()
blink::WebViewImpl::handleInputEvent()
content::RenderWidget::OnHandleInputEvent()

Original issue's description:
> Use changed_button_flags() when converting MouseEvent to blink::WebMouseEvent.
>
> Event::flags() contains all the buttons that are being held down during the event, while MouseEvent::changed_button_flags() contains the buttons that are actually pressed/released during the event (and this is what we really are interested in).
>
> This fixes the issue with LMB being pressed while RMB is being held down. Without the fix, we always get blink::WebMouseEvent::ButtonRight in blink::WebMouseEvent::button.
>
> Committed: https://crrev.com/87e6b0f6d72b12e4b0308b035d1c06f2beb90feb
> Cr-Commit-Position: refs/heads/master@{#293487}

TBR=joleksy@opera.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/563713002

Cr-Commit-Position: refs/heads/master@{#294364}
parent 68096136
......@@ -313,16 +313,11 @@ blink::WebMouseEvent MakeWebMouseEventFromAuraEvent(ui::MouseEvent* event) {
webkit_event.timeStampSeconds = event->time_stamp().InSecondsF();
webkit_event.button = blink::WebMouseEvent::ButtonNone;
int button_flags = event->flags();
if (event->type() == ui::ET_MOUSE_PRESSED ||
event->type() == ui::ET_MOUSE_RELEASED) {
button_flags = event->changed_button_flags();
}
if (button_flags & ui::EF_LEFT_MOUSE_BUTTON)
if (event->flags() & ui::EF_LEFT_MOUSE_BUTTON)
webkit_event.button = blink::WebMouseEvent::ButtonLeft;
if (button_flags & ui::EF_MIDDLE_MOUSE_BUTTON)
if (event->flags() & ui::EF_MIDDLE_MOUSE_BUTTON)
webkit_event.button = blink::WebMouseEvent::ButtonMiddle;
if (button_flags & ui::EF_RIGHT_MOUSE_BUTTON)
if (event->flags() & ui::EF_RIGHT_MOUSE_BUTTON)
webkit_event.button = blink::WebMouseEvent::ButtonRight;
switch (event->type()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment