Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Side by Side Diff: third_party/WebKit/LayoutTests/svg/custom/touch-events.html

Issue 1405283006: Deprecate SVGElement.offsetParent/offsetTop/offsetLeft/offsetWidth/offsetHeight (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix the tests instead Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script> 4 <script>
5 var eventCount = 0; 5 var eventCount = 0;
6 6
7 function handleClick(evt) { 7 function handleClick(evt) {
8 eventCount++; 8 eventCount++;
9 document.getElementById('click').textContent = 'PASS'; 9 document.getElementById('click').textContent = 'PASS';
10 } 10 }
(...skipping 16 matching lines...) Expand all
27 function handleTouchCancel(evt) { 27 function handleTouchCancel(evt) {
28 eventCount++; 28 eventCount++;
29 document.getElementById('touchcancel').textContent = 'PASS'; 29 document.getElementById('touchcancel').textContent = 'PASS';
30 } 30 }
31 31
32 function fireEvents() { 32 function fireEvents() {
33 if (!window.testRunner || !window.eventSender) { 33 if (!window.testRunner || !window.eventSender) {
34 document.write('This test does not work in manual mode.'); 34 document.write('This test does not work in manual mode.');
35 } else { 35 } else {
36 var svg = document.getElementById('svg'); 36 var svg = document.getElementById('svg');
37 var positionX = svg.offsetLeft + 30; 37 var clientRect = svg.getBoundingClientRect();
38 var positionY = svg.offsetTop + 30; 38 var positionX = clientRect.left + 30;
39 var positionY = clientRect.top + 30;
39 40
40 // Touch, move, end. 41 // Touch, move, end.
41 eventSender.addTouchPoint(positionX, positionY); 42 eventSender.addTouchPoint(positionX, positionY);
42 eventSender.touchStart(); 43 eventSender.touchStart();
43 eventSender.updateTouchPoint(0, positionX + 10, positionY + 10); 44 eventSender.updateTouchPoint(0, positionX + 10, positionY + 10);
44 eventSender.touchMove(); 45 eventSender.touchMove();
45 eventSender.releaseTouchPoint(0); 46 eventSender.releaseTouchPoint(0);
46 eventSender.touchEnd(); 47 eventSender.touchEnd();
47 // Touch, cancel. 48 // Touch, cancel.
48 eventSender.addTouchPoint(positionX, positionY); 49 eventSender.addTouchPoint(positionX, positionY);
(...skipping 27 matching lines...) Expand all
76 onclick fired: <span id="click">FAIL</span><br/> 77 onclick fired: <span id="click">FAIL</span><br/>
77 ontouchstart fired: <span id="touchstart">FAIL</span><br/> 78 ontouchstart fired: <span id="touchstart">FAIL</span><br/>
78 ontouchmove fired: <span id="touchmove">FAIL</span><br/> 79 ontouchmove fired: <span id="touchmove">FAIL</span><br/>
79 ontouchend fired: <span id="touchend">FAIL</span><br/> 80 ontouchend fired: <span id="touchend">FAIL</span><br/>
80 ontouchcancel fired: <span id="touchcancel">FAIL</span><br/> 81 ontouchcancel fired: <span id="touchcancel">FAIL</span><br/>
81 total event count is 6: <span id="eventcount">FAIL</span><br/> 82 total event count is 6: <span id="eventcount">FAIL</span><br/>
82 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xl ink" width="100" height="100" id="svg"> 83 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xl ink" width="100" height="100" id="svg">
83 <rect id="rect" x="20" y="20" width="60" height="60" fill="green" onclick="h andleClick()" ontouchstart="handleTouchStart()" ontouchmove="handleTouchMove()" ontouchend="handleTouchEnd()" ontouchcancel="handleTouchCancel()"/> 84 <rect id="rect" x="20" y="20" width="60" height="60" fill="green" onclick="h andleClick()" ontouchstart="handleTouchStart()" ontouchmove="handleTouchMove()" ontouchend="handleTouchEnd()" ontouchcancel="handleTouchCancel()"/>
84 </svg> 85 </svg>
85 </body> 86 </body>
86 </html> 87 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698