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

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: Rebase 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..619c979ba9b3c66e905046c2055ea72a41f937d8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html
@@ -0,0 +1,62 @@
+<!doctype html>
jbroman 2017/04/24 18:19:49 Should this be shared with web-platform-tests at s
dtapuska 2017/04/24 19:14:39 Yes I need to get the HTML spec clarification push
+<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>
+ <style>
+ #target0 {
jbroman 2017/04/24 18:19:48 Are these properties significant? It's not obvious
dtapuska 2017/04/24 19:14:39 Done.
+ background: purple;
+ border: 1px solid orange;
+ touch-action: none;
+ width: 200px;
+ height: 100px;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Mouse Event: mouse events fired to disabled form controls</h1>
+ <h4>
+ Test Description:
+ Mouse events are dispatched to disabled form controls.
+ </h4>
+ <button id="target0" disabled>Disabled button</button>
+ <div id="complete-notice">
jbroman 2017/04/24 18:19:49 How much of this boilerplate is necessary? e.g. co
dtapuska 2017/04/24 19:14:39 Done.
+ <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
+ </div>
+ <div id="log"></div>
+ <script>
+ var detected_pointertypes = {};
jbroman 2017/04/24 18:19:49 unused variable
dtapuska 2017/04/24 19:14:39 Ugh; you are correct. These were used in a previou
+ var detected_eventTypes = {};
+ var eventList = ['mouseout', 'mouseover', 'mouseenter', 'mousemove', 'mousedown', 'mouseup', 'mouseleave'];
+
+ function resetTestState() {
jbroman 2017/04/24 18:19:49 Unused function?
dtapuska 2017/04/24 19:14:39 Done.
+ detected_eventTypes = {};
+ }
+ var test = async_test("mouse test");
jbroman 2017/04/24 18:19:49 Is this test actually async? Event dispatch is syn
dtapuska 2017/04/24 19:14:39 Done.
+ var target = document.getElementById("target0");
+
+ eventList.forEach(function(eventName) {
+ on_event(target, eventName, function (event) {
+ detected_eventTypes[event.type] = true;
jbroman 2017/04/24 18:19:49 nit: This seems to just be used as a counter, righ
dtapuska 2017/04/24 19:14:39 Yes sorry I had cloned this from a async one but t
+
+ if (Object.keys(detected_eventTypes).length == eventList.length) {
+ test.done();
+ }
+ });
+ });
+ on_event(target, "click", function (event) {
+ assert_unreached("click should not fire on disabled element");
jbroman 2017/04/24 18:19:49 This will appear in the output, but I'm not sure i
dtapuska 2017/04/24 19:14:39 Done.
+ });
+ on_event(document.body, "click", function (event) {
+ assert_unreached("click should not fire on event path");
+ });
+
+ target.click();
+ eventList.forEach(function(eventName) {
+ target.dispatchEvent(new MouseEvent(eventName));
+ });
+ </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.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698