| 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 |
| 11 if (window.testRunner) { | 11 if (window.testRunner) { |
| 12 var s = document.createElement('style'); | 12 var s = document.createElement('style'); |
| 13 s.innerHTML += ".running h1, .running pre, .running div#console, .running p
{ display:none }"; | |
| 14 s.innerHTML += "h1, pre, div#console, p { opacity: 0 }"; | 13 s.innerHTML += "h1, pre, div#console, p { opacity: 0 }"; |
| 15 s.innerHTML += "body { overflow: hidden }"; | 14 s.innerHTML += "body { overflow: hidden }"; |
| 16 document.head.appendChild(s); | 15 document.head.appendChild(s); |
| 17 document.head.parentNode.classList.add("running"); | |
| 18 } | 16 } |
| 19 | 17 |
| 20 function afterTest() { | 18 function afterTest() { |
| 21 document.head.parentNode.classList.remove("running"); | |
| 22 finishJSTest(); | 19 finishJSTest(); |
| 23 } | 20 } |
| 24 | 21 |
| 25 function createSVGElement(name) { | 22 function createSVGElement(name) { |
| 26 return document.createElementNS(svgNS, "svg:" + name); | 23 return document.createElementNS(svgNS, "svg:" + name); |
| 27 } | 24 } |
| 28 | 25 |
| 29 function shouldHaveBBox(element, width, height) | 26 function shouldHaveBBox(element, width, height) |
| 30 { | 27 { |
| 31 shouldBe(element + ".getBBox().width", width); | 28 shouldBe(element + ".getBBox().width", width); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 var clientRect = rootSVGElement.getBoundingClientRect(); | 65 var clientRect = rootSVGElement.getBoundingClientRect(); |
| 69 x = x + clientRect.left; | 66 x = x + clientRect.left; |
| 70 y = y + clientRect.top; | 67 y = y + clientRect.top; |
| 71 | 68 |
| 72 if (window.eventSender) { | 69 if (window.eventSender) { |
| 73 eventSender.mouseMoveTo(x, y); | 70 eventSender.mouseMoveTo(x, y); |
| 74 eventSender.mouseDown(); | 71 eventSender.mouseDown(); |
| 75 eventSender.mouseUp(); | 72 eventSender.mouseUp(); |
| 76 } | 73 } |
| 77 } | 74 } |
| OLD | NEW |