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

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: Fix up some tests Created 4 years, 6 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script> 4 <script>
5 function clickOn(element) 5 function clickOn(element)
6 { 6 {
7 if (!window.eventSender) 7 if (!window.eventSender)
8 return; 8 return;
9 9
10 var absoluteTop = 0; 10 var absoluteTop = 0;
11 var absoluteLeft = 0; 11 var absoluteLeft = 0;
12 for (var parentNode = element; parentNode; parentNode = parentNode.offsetPar ent) { 12 for (var parentNode = element; parentNode; parentNode = parentNode.offsetPar ent) {
13 absoluteLeft += parentNode.offsetLeft; 13 absoluteLeft += parentNode.offsetLeft;
14 absoluteTop += parentNode.offsetTop; 14 absoluteTop += parentNode.offsetTop;
15 } 15 }
16 16
17 var x = absoluteLeft + element.offsetWidth / 2; 17 var x = absoluteLeft + element.offsetWidth / 2;
18 var y = absoluteTop + element.offsetHeight / 2; 18 var y = absoluteTop + element.offsetHeight / 2;
19 eventSender.mouseMoveTo(x, y); 19 eventSender.mouseMoveTo(x, y);
20 eventSender.mouseDown(); 20 eventSender.mouseDown();
21 eventSender.mouseUp(); 21 eventSender.mouseUp();
22 } 22 }
23 23
24 function runTest() 24 function runTest()
25 { 25 {
26 if (window.testRunner) 26 if (window.testRunner)
27 testRunner.dumpAsText(); 27 testRunner.dumpAsText();
28 28
29 document.querySelector('dialog').showModal();
30 clickOn(document.querySelector('label')); 29 clickOn(document.querySelector('label'));
31 document.querySelector('div').textContent = document.getElementById('target' ).checked ? 'PASS' : 'FAIL'; 30 document.querySelector('div').textContent = document.getElementById('target' ).checked ? 'PASS' : 'FAIL';
32 } 31 }
33 </script> 32 </script>
34 </head> 33 </head>
35 <body onload="runTest()"> 34 <body onload="runTest()">
36 <p>Ensure that simulated click is still dispatched to an inert node. 35 <p>Ensure that simulated click is still dispatched to an inert node.
37 To test manually, click the CLICK ME label and verify it does change the val ue of the checkbox.</p> 36 To test manually, click the CLICK ME label and verify it does change the val ue of the checkbox.</p>
37 <div inert id="container">
38 <div> 38 <div>
39 </div> 39 </div>
40 <input type="checkbox" id="target"> 40 <input type="checkbox" id="target">
41 <dialog><label for="target">CLICK ME</label></dialog> 41 </div>
42 <label for="target">CLICK ME</label>
42 </body> 43 </body>
43 </html> 44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698