14 <div id=
"targetDiv"></div>
16 <script src=
"../resources/js-test.js"></script>
17 <script src=
"resources/touchadjustment.js"></script>
19 function addShadowDOM() {
20 var targetDiv
= document
.getElementById("targetDiv");
21 var root
= targetDiv
.createShadowRoot();
22 var shadowDiv
= document
.createElement("div");
23 shadowDiv
.style
.width
= "50px";
24 shadowDiv
.style
.height
= "50px";
25 shadowDiv
.style
.background
= "#ff0";
26 shadowDiv
.style
.position
= "absolute";
27 shadowDiv
.style
.left
= "0px";
28 shadowDiv
.style
.top
= "0px";
29 shadowDiv
.id
= 'shadowDiv';
30 shadowDiv
.addEventListener('click', function() {}, false);
31 root
.appendChild(shadowDiv
);
35 function runTouchTests() {
36 var shadowDiv
= addShadowDOM();
37 element
= document
.getElementById("targetDiv");
38 element
.addEventListener('click', function() {}, false);
39 document
.addEventListener('click', function() {}, false);
40 testTouchPoint(touchPoint(25, 25, 10), shadowDiv
);
45 if (window
.testRunner
&& window
.internals
&& internals
.touchNodeAdjustedToBestClickableNode
) {
46 description('Test that a hit right in the middle of a shadow dom node returns it and not its host.')