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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/inert/synthetic-click-inert.html

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/testharness.js"></script>
5 <script src="../../../resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <button inert>Click me</button>
9 <div id="div" inert>Click me too</div>
10 <script>
11 button = document.querySelector('button');
12 div = document.getElementById('div');
13 clicked = null;
14
15 function testClick(element) {
16 element.addEventListener('click', function(e) { clicked = element; });
17 expectedElement = element;
18
19 clicked = null;
20 element.click();
21 assert_equals(clicked, expectedElement);
22
23 clicked = null;
24 element.dispatchEvent(new Event('click'));
25 assert_equals(clicked, expectedElement);
26 }
27
28 test(function() {
29 testClick(button);
30 }, "Programmatic click events may still be sent to inert button");
31
32 test(function() {
33 testClick(div);
34 }, "Programmatic click events may still be sent to inert div");
35
36 </script>
37 </body>
38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698