4 <script src=
"../../../../resources/js-test.js"></script>
5 <script src=
"resources/gesture-helpers.js"></script>
6 <style type=
"text/css">
34 <body style=
"margin:0" >
37 <table border=
"0" cellspacing=
"0px" >
39 <iframe frameBorder=
"0" style=
"display: block;" id=
"touchtargetiframe" src=
"resources/scroll-inside-editable-iframe.html"></iframe>
42 <div id=
"bluebox"></div>
47 <p id=
"description"></p>
48 <div id=
"console"></div>
49 <script type=
"text/javascript">
55 var iframeDocumentElement
;
56 var expectedGesturesTotal
= 1;
57 var gesturesOccurred
= 0;
58 var scrollAmountX
= ['0'];
59 var scrollAmountY
= ['0'];
60 var wheelEventsOccurred
= 0;
61 var expectedWheelEventsOccurred
= ['0'];
62 var scrollEventsOccurred
= 0;
63 var scrolledElement
= 'movedbox';
64 var scrollEventsOccurred
= 0;
65 var expectedScrollEventsOccurred
= '1';
67 function firstGestureScroll()
70 iframeScrollingElement
= iframe
.contentDocument
.scrollingElement
;
72 debug("first gesture");
73 eventSender
.gestureScrollBegin(10, 72);
74 // Prevent scroll to propagate by passing true for third parameter
75 eventSender
.gestureScrollUpdate(0, -700, true);
76 eventSender
.gestureScrollUpdate(0, -100, true);
77 eventSender
.gestureScrollUpdate(0, -70, true);
78 eventSender
.gestureScrollUpdate(0, -10, true);
79 eventSender
.gestureScrollEnd(0, 0);
81 // Make sure the actual iframe got fully scrolled
82 shouldBe('iframeScrollingElement.scrollHeight - iframeScrollingElement.scrollTop', 'iframe.clientHeight');
88 if (window
.testRunner
)
89 testRunner
.waitUntilDone();
93 movedbox
= document
.getElementById("outerdiv");
94 touchtarget
= document
.getElementById("touchtargetiframe");
95 touchtarget
.contentDocument
.addEventListener("scroll", recordScroll
);
96 touchtarget
.contentDocument
.body
.addEventListener("mousewheel", recordWheel
);
98 if (window
.eventSender
) {
99 description('This tests that a gesture scroll is not propagated from an ' +
100 'iframe to an outer div when the iframe has no remaining ' +
101 'scroll offset when the preventPropagation flag is set for the gesture '+
102 'type GestureScrollUpdate.');
103 if (checkTestDependencies() && window
.eventSender
.gestureScrollUpdate
)
104 firstGestureScroll();
108 debug("This test requires DumpRenderTree. Gesture-scroll the page to validate the implementation.");