2 <script src=
"../../../resources/js-test.js"></script>
4 <iframe style=
"position:absolute; top:100px; left:100px;" src=
"./resources/touch-inside-iframe-scrolled2.html"></iframe>
5 <p id=
"description"></p>
6 <div id=
"console"></div>
7 <script type=
"text/javascript">
8 description('Test iframes receive touches correctly when scrolled. https://bugs.webkit.org/show_bug.cgi?id=96541');
11 var correctDiv
= false;
13 function testComplete(hitCorrectDiv
, event
)
15 correctDiv
= hitCorrectDiv
;
16 shouldBeTrue("correctDiv");
18 touch
= event
.touches
[0];
19 shouldBe("touch.pageX", "150");
20 shouldBe("touch.pageY", "350");
22 isSuccessfullyParsed();
23 testRunner
.notifyDone();
26 // Backstop to prevent test timeout on incorrect position
27 document
.addEventListener('touchstart', function(event
) {
28 parent
.testComplete(false, event
);
32 if (window
.eventSender
) {
33 // Touch the center of the div in the iframe.
34 // 100px is offset to iframe in main frame,
35 // 2px for the iframe border, 50px to get to centre of the div.
36 eventSender
.addTouchPoint(152, 152);
37 eventSender
.touchStart();
39 debug('This test requires DRT.');
43 if (window
.testRunner
) {
44 testRunner
.waitUntilDone();