Chromium Code Reviews| 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 9b8d3e1aedffc63db881c837e0fbcaa824911947..129e63d93cd2108636c269b4427a031b436974a9 100644 |
| --- a/third_party/WebKit/Source/core/events/MouseEvent.cpp |
| +++ b/third_party/WebKit/Source/core/events/MouseEvent.cpp |
| @@ -266,7 +266,7 @@ MouseEvent& MouseEventDispatchMediator::event() const |
| return toMouseEvent(EventDispatchMediator::event()); |
| } |
| -bool MouseEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) const |
| +EventTarget::DispatchEventResult MouseEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) const |
| { |
| MouseEvent& mouseEvent = event(); |
| if (!mouseEvent.isTrusted()) { |
| @@ -275,21 +275,20 @@ bool MouseEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons |
| } |
| if (isDisabledFormControl(&dispatcher.node())) |
| - return false; |
| + return EventTarget::DispatchEventResult::HandledSuppressed; |
| if (mouseEvent.type().isEmpty()) |
| - return true; // Shouldn't happen. |
| + return EventTarget::DispatchEventResult::NotHandled; // Shouldn't happen. |
| ASSERT(!mouseEvent.target() || mouseEvent.target() != mouseEvent.relatedTarget()); |
| EventTarget* relatedTarget = mouseEvent.relatedTarget(); |
| mouseEvent.eventPath().adjustForRelatedTarget(dispatcher.node(), relatedTarget); |
| - dispatcher.dispatch(); |
| - bool swallowEvent = mouseEvent.defaultHandled() || mouseEvent.defaultPrevented(); |
| + EventTarget::DispatchEventResult result = dispatcher.dispatch(); |
| if (mouseEvent.type() != EventTypeNames::click || mouseEvent.detail() != 2) |
| - return !swallowEvent; |
| + return result; |
| // Special case: If it's a double click event, we also send the dblclick event. This is not part |
| // of the DOM specs, but is used for compatibility with the ondblclick="" attribute. This is treated |
| @@ -303,10 +302,10 @@ bool MouseEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons |
| doubleClickEvent->setTrusted(mouseEvent.isTrusted()); |
| if (mouseEvent.defaultHandled()) |
| doubleClickEvent->setDefaultHandled(); |
| - EventDispatcher::dispatchEvent(dispatcher.node(), MouseEventDispatchMediator::create(doubleClickEvent)); |
| - if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented()) |
| - return false; |
| - return !swallowEvent; |
| + EventTarget::DispatchEventResult doubleClickEventResult = EventDispatcher::dispatchEvent(dispatcher.node(), MouseEventDispatchMediator::create(doubleClickEvent)); |
| + if (result != EventTarget::DispatchEventResult::NotHandled) |
|
tkent
2016/02/22 01:40:22
The logic looks different from the original code.
dtapuska
2016/02/23 19:14:40
Done.
|
| + return result; |
| + return doubleClickEventResult; |
| } |
| } // namespace blink |