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 style=
"display: block;" frameBorder=
"0" 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">
54 var iframeScrollingElement
;
55 var iframeDocumentElement
;
56 var expectedGesturesTotal
= 1;
57 var gesturesOccurred
= 0;
58 var scrollAmountX
= ['0'];
59 var scrollAmountY
= ['50'];
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 var amountToScroll
= iframeScrollingElement
.scrollHeight
- iframe
.clientHeight
;
74 iframeScrollingElement
.scrollTop
= amountToScroll
;
76 // Sanity - make sure the iframe is actually fully scrolled
77 shouldBe('iframeScrollingElement.scrollHeight - iframeScrollingElement.scrollTop', 'iframe.clientHeight');
79 eventSender
.gestureScrollBegin(10, 72);
80 // Prevent scroll to propagate by passing true for third parameter
81 eventSender
.gestureScrollUpdate(0, -20, true);
82 eventSender
.gestureScrollUpdate(0, -18, true);
83 eventSender
.gestureScrollUpdate(0, -15, true);
84 eventSender
.gestureScrollUpdate(0, -10, true);
85 eventSender
.gestureScrollEnd(0, 0);
87 amountToScroll
= movedbox
.scrollHeight
- movedbox
.clientHeight
;
88 scrollAmountY
[0] = amountToScroll
.toString();
94 if (window
.testRunner
)
95 testRunner
.waitUntilDone();
99 movedbox
= document
.getElementById("outerdiv");
100 touchtarget
= document
.getElementById("touchtargetiframe");
102 touchtarget
.contentDocument
.addEventListener("scroll", recordScroll
);
103 touchtarget
.contentDocument
.documentElement
.addEventListener("mousewheel", recordWheel
);
105 if (window
.eventSender
) {
106 description('This tests that a fling gesture sent to an iframe with no remaining scroll offset ' +
107 'is correctly targeting the parent container.');
109 if (checkTestDependencies() && window
.eventSender
.gestureScrollUpdate
)
110 firstGestureScroll();
114 debug("This test requires DumpRenderTree. Gesture-scroll the page to validate the implementation.");