| 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..4b4f1ef599d43784b0e9b36299350a0957b6559c 100644
|
| --- a/third_party/WebKit/Source/core/events/MouseEvent.cpp
|
| +++ b/third_party/WebKit/Source/core/events/MouseEvent.cpp
|
| @@ -439,10 +439,20 @@ DispatchEventResult MouseEventDispatchMediator::DispatchEvent(
|
| mouse_event.GetEventPath().AdjustForRelatedTarget(
|
| dispatcher.GetNode(), mouse_event.relatedTarget());
|
|
|
| + bool is_click = mouse_event.type() == EventTypeNames::click;
|
| + bool send_to_disabled_form_controls =
|
| + RuntimeEnabledFeatures::sendMouseEventsDisabledFormControlsEnabled();
|
| +
|
| + if (send_to_disabled_form_controls && is_click &&
|
| + mouse_event.GetEventPath().DisabledFormControlExistsInPath()) {
|
| + return DispatchEventResult::kCanceledBeforeDispatch;
|
| + }
|
| +
|
| if (!mouse_event.isTrusted())
|
| return dispatcher.Dispatch();
|
|
|
| - if (IsDisabledFormControl(&dispatcher.GetNode()))
|
| + if (!send_to_disabled_form_controls &&
|
| + IsDisabledFormControl(&dispatcher.GetNode()))
|
| return DispatchEventResult::kCanceledBeforeDispatch;
|
|
|
| if (mouse_event.type().IsEmpty())
|
| @@ -455,7 +465,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
|
|
|