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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/animations/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 27 matching lines...) Expand all
38 var bodyElement = document.documentElement.lastChild; 38 var bodyElement = document.documentElement.lastChild;
39 bodyElement.insertBefore(iframeElement, document.getElementById("description ")); 39 bodyElement.insertBefore(iframeElement, document.getElementById("description "));
40 } 40 }
41 41
42 function iframeLoaded() { 42 function iframeLoaded() {
43 rootSVGElement = iframeElement.getSVGDocument().rootElement; 43 rootSVGElement = iframeElement.getSVGDocument().rootElement;
44 } 44 }
45 45
46 function clickAt(x, y) { 46 function clickAt(x, y) {
47 // Translation due to <h1> above us 47 // Translation due to <h1> above us
48 x = x + rootSVGElement.offsetLeft; 48 var clientRect = rootSVGElement.getBoundingClientRect();
49 y = y + rootSVGElement.offsetTop; 49 x = x + clientRect.left;
50 y = y + clientRect.top;
50 51
51 if (window.eventSender) { 52 if (window.eventSender) {
52 eventSender.mouseMoveTo(x, y); 53 eventSender.mouseMoveTo(x, y);
53 eventSender.mouseDown(); 54 eventSender.mouseDown();
54 eventSender.mouseUp(); 55 eventSender.mouseUp();
55 } 56 }
56 } 57 }
57 58
58 function completeTest() { 59 function completeTest() {
59 finishJSTest(); 60 finishJSTest();
60 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698