| Index: third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html b/third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..decbdf8906e776cf539da48cd64d3e8f94c79869
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html
|
| @@ -0,0 +1,32 @@
|
| +<!doctype html>
|
| +<html>
|
| + <head>
|
| + <title>Mouse Event Dispatching to Disabled Form Controls</title>
|
| + <meta name="viewport" content="width=device-width">
|
| + <script src="../../resources/testharness.js"></script>
|
| + <script src="../../resources/testharnessreport.js"></script>
|
| + </head>
|
| + <body>
|
| + <button id="target0" disabled>Disabled button</button>
|
| + <script>
|
| + var eventList = ['mouseout', 'mouseover', 'mouseenter', 'mousemove', 'mousedown', 'mouseup', 'mouseleave'];
|
| + var target = document.getElementById("target0");
|
| +
|
| + test((t) => {
|
| + target.onclick = t.unreached_func("click should not fire on disabled element");
|
| + document.body.onclick = t.unreached_func("click should not fire on event path");
|
| + target.click();
|
| + target.dispatchEvent(new MouseEvent('click', {capture: true, bubbles: true}));
|
| + }, 'Click should not fire');
|
| +
|
| + for (let eventName of eventList) {
|
| + test((t) => {
|
| + let fired = false;
|
| + on_event(target, eventName, () => fired = true);
|
| + target.dispatchEvent(new MouseEvent(eventName, {capture: true, bubbles: true}));
|
| + assert_true(fired, eventName + ' should be fired');
|
| + }, eventName + ' should be fired');
|
| + }
|
| + </script>
|
| + </body>
|
| +</html>
|
|
|