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

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

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move flat tree checks up to the top of isInert 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 onload="runTest()">
8 <p>Ensure that simulated click is still dispatched to an inert node.
9 To test manually, click the CLICK ME label and verify it does change the val ue of the checkbox.</p>
10 <div inert id="container">
11 <div>
12 </div>
13 <input type="checkbox" id="target">
14 </div>
15 <label for="target">CLICK ME</label>
16 <script>
17 function clickOn(element)
18 {
19 if (!window.eventSender)
20 return;
21
22 var absoluteTop = 0;
23 var absoluteLeft = 0;
24 for (var parentNode = element; parentNode; parentNode = parentNode.offsetPar ent) {
25 absoluteLeft += parentNode.offsetLeft;
26 absoluteTop += parentNode.offsetTop;
27 }
28
29 var x = absoluteLeft + element.offsetWidth / 2;
30 var y = absoluteTop + element.offsetHeight / 2;
31 eventSender.mouseMoveTo(x, y);
32 eventSender.mouseDown();
33 eventSender.mouseUp();
34 }
35
36 test(function() {
37 clickOn(document.querySelector('label'));
38 assert_true(document.getElementById('target').checked);
39 }, "Simulated click should still be dispatched to an inert node.");
40 </script>
41 </body>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698