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 ae1da564be060c79e755b2e07b32b77cddc9a3e5..e5c12ba5b42af861a63276341235636918b9dc90 100644 |
| --- a/third_party/WebKit/Source/core/events/MouseEvent.cpp |
| +++ b/third_party/WebKit/Source/core/events/MouseEvent.cpp |
| @@ -439,10 +439,19 @@ DispatchEventResult MouseEventDispatchMediator::DispatchEvent( |
| mouse_event.GetEventPath().AdjustForRelatedTarget( |
| dispatcher.GetNode(), mouse_event.relatedTarget()); |
| + bool is_click = mouse_event.type() == EventTypeNames::click; |
| + bool send_to_disabled_forms = |
|
jbroman
2017/04/24 18:19:49
super-nit: send_to_disabled_controls or something
dtapuska
2017/04/24 19:14:39
Done.
|
| + RuntimeEnabledFeatures::sendMouseEventsDisabledFormControlsEnabled(); |
| + |
| + if (send_to_disabled_forms && is_click && |
| + mouse_event.GetEventPath().DisabledFormControlExistsInPath()) { |
| + return DispatchEventResult::kCanceledBeforeDispatch; |
| + } |
| + |
| if (!mouse_event.isTrusted()) |
|
jbroman
2017/04/24 18:19:49
Does the layout test cover the logic beyond this p
dtapuska
2017/04/24 19:14:39
Yes that is correct. But the changed logic is *bef
|
| return dispatcher.Dispatch(); |
| - if (IsDisabledFormControl(&dispatcher.GetNode())) |
| + if (!send_to_disabled_forms && IsDisabledFormControl(&dispatcher.GetNode())) |
| return DispatchEventResult::kCanceledBeforeDispatch; |
| if (mouse_event.type().IsEmpty()) |
| @@ -455,7 +464,7 @@ DispatchEventResult MouseEventDispatchMediator::DispatchEvent( |
| DispatchEventResult dispatch_result = dispatcher.Dispatch(); |
| - if (mouse_event.type() != EventTypeNames::click || mouse_event.detail() != 2) |
| + if (!is_click || mouse_event.detail() != 2) |
| return dispatch_result; |
| // Special case: If it's a double click event, we also send the dblclick |