| <title>Touch Adjustment : Correct for frame positions - bug 82043</title> |
| <script src="../fast/js/resources/js-test-pre.js"></script> |
| #myframe { position: absolute; left: 200px; top: 100px; width: 400px; height: 300px;} |
| <body onload="runTests()"> |
| <iframe id=myframe src="resources/inner-frame.html"></iframe> |
| function testRoundTouch(x, y, radius) |
| var adjustedNode = internals.touchNodeAdjustedToBestClickableNode(x, y, width, height, document); |
| if (adjustedNode.nodeType == 3) // TEXT node |
| adjustedNode = adjustedNode.parentNode; |
| function testDirectTouches() |
| debug('Test fat direct touches.'); |
| adjustedNode = testRoundTouch(260, 200, 200); |
| shouldBeEqualToString('adjustedNode.id', 'a1'); |
| adjustedNode = testRoundTouch(340, 200, 200); |
| shouldBeEqualToString('adjustedNode.id', 'a2'); |
| if (window.testRunner && window.internals && internals.touchNodeAdjustedToBestClickableNode) { |
| description('Test touch-adjustment on links in an iframe. Making sure we iframe position is correctly adjusted for.'); |
| <script src="../fast/js/resources/js-test-post.js"></script> |