4 <script src=
"../../../../resources/js-test.js"></script>
5 <script src=
"resources/gesture-helpers.js"></script>
6 <style type=
"text/css">
56 <body style=
"margin:0" onload=
"runTest();">
58 <div id=
"touchtargetdiv">
59 <table border=
"0" cellspacing=
"0px" >
60 <tr><td><div id=
"yellowbox"></div></td></tr>
61 <tr><td><div id=
"bluebox"></div></td></tr>
62 <tr><td><div id=
"yellowbox"></div></td></tr>
63 <tr><td><div id=
"bluebox"></div></td></tr>
67 <table id=
"table_to_fill" border=
"0" cellspacing=
"0px">
68 <tr><td><div id=
"greenbox"></div></td></tr>
69 <tr><td><div id=
"redbox"></div></td></tr>
72 <p id=
"description"></p>
73 <div id=
"console"></div>
74 <script type=
"text/javascript">
77 var expectedGesturesTotal
= 2;
78 var gesturesOccurred
= 0;
79 var scrollAmountX
= ['0', '0'];
80 var scrollAmountY
= ['0', '0'];
81 var wheelEventsOccurred
= 0;
82 var expectedWheelEventsOccurred
= ['0', '0'];
83 var scrollEventsOccurred
= 0;
84 var scrolledElement
= 'document.documentElement';
85 var scrollEventsOccurred
= 0;
86 var expectedScrollEventsOccurred
= '1';
88 // Always construct a page larger than the vertical height of the window.
91 var table
= document
.getElementById('table_to_fill');
92 var targetHeight
= document
.body
.offsetHeight
;
93 var cellPairHeight
= table
.offsetHeight
;
94 var numberOfReps
= targetHeight
/ cellPairHeight
* 2;
96 for (i
= 0; i
< numberOfReps
; i
++) {
97 var p
= document
.createElement('tr');
98 p
.innerHTML
= '<td><div id="greenbox"></div></td>';
100 var p
= document
.createElement('tr');
101 p
.innerHTML
= '<td><div id="redbox"></div></td>';
102 table
.appendChild(p
);
106 function firstGestureScroll()
108 debug("first gesture");
109 eventSender
.gestureScrollBegin(10, 72);
110 eventSender
.gestureScrollUpdate(0, -110, true);
111 eventSender
.gestureScrollEnd(0, 0);
117 function secondGestureScroll()
119 debug("second gesture");
120 eventSender
.gestureScrollBegin(12, 40);
121 eventSender
.gestureScrollUpdate(0, -200, true);
122 eventSender
.gestureScrollUpdate(0, -160, true);
123 eventSender
.gestureScrollEnd(0, 0);
129 if (window
.testRunner
)
130 testRunner
.waitUntilDone();
135 touchtarget
= document
.getElementById('touchtargetdiv');
136 touchtarget
.addEventListener("scroll", recordScroll
);
137 touchtarget
.addEventListener("mousewheel", recordWheel
);
139 if (window
.eventSender
) {
140 description('This tests that a gesture scroll is not propagated from a div ' +
141 'to the page when the div has no remaining scroll offset when ' +
142 'the preventPropagation flag is set for the GestureScrollUpdate event.');
143 if (checkTestDependencies() && window
.eventSender
.gestureScrollUpdate
)
144 firstGestureScroll();
148 debug("This test requires DumpRenderTree. Gesture-scroll the page to validate the implementation.");