| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |