OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
Rick Byers
2014/07/07 18:25:44
nit: for new tests we generally avoid adding any u
Zeeshan Qureshi
2014/07/09 16:10:15
Oh I thought you needed the tags if you added <hea
| |
4 <style> | |
5 #targetDiv { | |
6 background: #00f; | |
7 height: 100px; | |
8 width: 100px; | |
9 position: absolute; | |
10 left: 0px; | |
11 top: 0px; | |
12 } | |
13 </style> | |
14 </head> | |
15 <body> | |
16 <div id="targetDiv"></div> | |
17 | |
18 <script src="../resources/js-test.js"></script> | |
19 <script src="resources/touchadjustment.js"></script> | |
20 <script> | |
21 function addShadowDOM() { | |
22 var targetDiv = document.getElementById("targetDiv"); | |
23 var root = targetDiv.createShadowRoot(); | |
24 var shadowDiv = document.createElement("div"); | |
25 shadowDiv.style.width = "50px"; | |
26 shadowDiv.style.height = "50px"; | |
27 shadowDiv.style.background = "#ff0"; | |
28 shadowDiv.style.position = "absolute"; | |
29 shadowDiv.style.left = "0px"; | |
30 shadowDiv.style.top = "0px"; | |
31 shadowDiv.id = 'shadowDiv'; | |
32 shadowDiv.addEventListener('click', function() {}, false); | |
33 root.appendChild(shadowDiv); | |
34 return shadowDiv; | |
35 } | |
36 | |
37 function runTouchTests() { | |
38 var shadowDiv = addShadowDOM(); | |
39 element = document.getElementById("targetDiv"); | |
40 element.addEventListener('click', function() {}, false); | |
Rick Byers
2014/07/07 18:25:44
what are these two handlers for? Are you just try
Zeeshan Qureshi
2014/07/09 16:10:14
Yes, I borrowed this from the existing shadow dom
| |
41 document.addEventListener('click', function() {}, false); | |
42 testTouchPoint(touchPoint(25, 25, 10), shadowDiv, /* allowTextNodes */ false , /* allowShadowDOM */ true); | |
43 } | |
44 | |
45 function runTests() | |
46 { | |
47 if (window.testRunner && window.internals && internals.touchNodeAdjustedToBe stClickableNode) { | |
48 description('Test that a hit right in the middle of a shadow dom node re turns it and not its host.') | |
49 runTouchTests(); | |
50 } | |
51 } | |
52 runTests(); | |
53 </script> | |
54 </body> | |
55 </html> | |
OLD | NEW |