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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/click-focus-anchor.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 <body> 3 <body>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 5
6 <div id=test-container> 6 <div id=test-container>
7 <p><a id=a1 tabindex=0>Anchor with tab index</a> 7 <p><a id=a1 tabindex=0>Anchor with tab index</a>
8 <p><a id=a2>Anchor without tab index</a> 8 <p><a id=a2>Anchor without tab index</a>
9 <p><a id=a3 href="#">Link without tab index</a> 9 <p><a id=a3 href="#">Link without tab index</a>
10 <p><a id=a4 href="#" tabindex=0>Link with tab index</a> 10 <p><a id=a4 href="#" tabindex=0>Link with tab index</a>
(...skipping 16 matching lines...) Expand all
27 27
28 function handleFocus(e) { 28 function handleFocus(e) {
29 var el = e.target; 29 var el = e.target;
30 debug(el.id + ' received focus'); 30 debug(el.id + ' received focus');
31 } 31 }
32 32
33 document.addEventListener('focus', handleFocus, true); 33 document.addEventListener('focus', handleFocus, true);
34 if (window.testRunner) { 34 if (window.testRunner) {
35 var testAnchors = document.querySelectorAll('p > a, svg > a > text'); 35 var testAnchors = document.querySelectorAll('p > a, svg > a > text');
36 for (var i = 0; i < testAnchors.length; i++) { 36 for (var i = 0; i < testAnchors.length; i++) {
37 var aElement = testAnchors[i]; 37 var clientRect = testAnchors[i].getBoundingClientRect();
38 eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2) ; 38 eventSender.mouseMoveTo(clientRect.left + 2, clientRect.top + 2);
39 eventSender.mouseDown(); 39 eventSender.mouseDown();
40 eventSender.mouseUp(); 40 eventSender.mouseUp();
41 } 41 }
42 42
43 var tc = document.getElementById('test-container'); 43 var tc = document.getElementById('test-container');
44 tc.parentNode.removeChild(tc); 44 tc.parentNode.removeChild(tc);
45 } else { 45 } else {
46 debug('Need testRunner.'); 46 debug('Need testRunner.');
47 } 47 }
48 48
49 </script> 49 </script>
50 </body> 50 </body>
51 </html> 51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698