OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |