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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js

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 // Force activating pixel tests - this variable is used in resources/js-test.js, when calling setDumpAsText(). 1 // Force activating pixel tests - this variable is used in resources/js-test.js, when calling setDumpAsText().
2 window.enablePixelTesting = true; 2 window.enablePixelTesting = true;
3 3
4 var svgNS = "http://www.w3.org/2000/svg"; 4 var svgNS = "http://www.w3.org/2000/svg";
5 var xlinkNS = "http://www.w3.org/1999/xlink"; 5 var xlinkNS = "http://www.w3.org/1999/xlink";
6 var xhtmlNS = "http://www.w3.org/1999/xhtml"; 6 var xhtmlNS = "http://www.w3.org/1999/xhtml";
7 7
8 var rootSVGElement; 8 var rootSVGElement;
9 var iframeElement; 9 var iframeElement;
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 var bodyElement = document.documentElement.lastChild; 58 var bodyElement = document.documentElement.lastChild;
59 bodyElement.insertBefore(iframeElement, document.getElementById("description ")); 59 bodyElement.insertBefore(iframeElement, document.getElementById("description "));
60 } 60 }
61 61
62 function iframeLoaded() { 62 function iframeLoaded() {
63 rootSVGElement = iframeElement.getSVGDocument().rootElement; 63 rootSVGElement = iframeElement.getSVGDocument().rootElement;
64 } 64 }
65 65
66 function clickAt(x, y) { 66 function clickAt(x, y) {
67 // Translation due to <h1> above us 67 // Translation due to <h1> above us
68 x = x + rootSVGElement.offsetLeft; 68 var clientRect = rootSVGElement.getBoundingClientRect();
69 y = y + rootSVGElement.offsetTop; 69 x = x + clientRect.left;
70 y = y + clientRect.top;
70 71
71 if (window.eventSender) { 72 if (window.eventSender) {
72 eventSender.mouseMoveTo(x, y); 73 eventSender.mouseMoveTo(x, y);
73 eventSender.mouseDown(); 74 eventSender.mouseDown();
74 eventSender.mouseUp(); 75 eventSender.mouseUp();
75 } 76 }
76 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698