4 <title>Touch Adjustment : Correct for frame positions - bug
82043</title>
5 <script src=
"../resources/js-test.js"></script>
7 #myframe { position: absolute; left:
200px; top:
100px; width:
400px; height:
300px;}
10 <body onload=
"runTests()">
12 <iframe id=myframe
src=
"resources/inner-frame.html"></iframe>
14 <p id='description'
></p>
15 <div id='console'
></div>
18 function testRoundTouch(x
, y
, radius
)
22 var width
= radius
* 2;
23 var height
= radius
* 2;
24 var adjustedNode
= internals
.touchNodeAdjustedToBestClickableNode(x
, y
, width
, height
, document
);
25 if (adjustedNode
.nodeType
== 3) // TEXT node
26 adjustedNode
= adjustedNode
.parentNode
;
29 function testDirectTouches()
31 debug('Test fat direct touches.');
33 adjustedNode
= testRoundTouch(260, 200, 200);
34 shouldBeEqualToString('adjustedNode.id', 'a1');
36 adjustedNode
= testRoundTouch(340, 200, 200);
37 shouldBeEqualToString('adjustedNode.id', 'a2');
42 if (window
.testRunner
&& window
.internals
&& internals
.touchNodeAdjustedToBestClickableNode
) {
43 description('Test touch-adjustment on links in an iframe. Making sure we iframe position is correctly adjusted for.');