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

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
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..29e0aed731ca1585e367e54edd098f0a9c85861b
--- /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</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}));
+ });
jbroman 2017/04/24 19:50:32 super-nit: include test name (else you will get a
dtapuska 2017/04/24 19:59:29 Done.
+
+ 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') | third_party/WebKit/Source/core/events/EventPath.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698