Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html

Issue 2832073003: Send mouse events for disabled form controls. (Closed)
Patch Set: Fix nits Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698