| OLD | NEW |
| 1 // Asynchronous tests should manually call finishRepaintTest at the appropriate
time. | 1 // Asynchronous tests should manually call finishRepaintTest at the appropriate
time. |
| 2 window.testIsAsync = false; | 2 window.testIsAsync = false; |
| 3 window.outputRepaintRects = true; | 3 window.outputRepaintRects = true; |
| 4 | 4 |
| 5 if (window.internals) |
| 6 window.internals.settings.setForceCompositingMode(true) |
| 7 |
| 5 function runRepaintTest() | 8 function runRepaintTest() |
| 6 { | 9 { |
| 7 if (!window.testRunner || !window.internals) { | 10 if (!window.testRunner || !window.internals) { |
| 8 setTimeout(repaintTest, 100); | 11 setTimeout(repaintTest, 100); |
| 9 return; | 12 return; |
| 10 } | 13 } |
| 11 | 14 |
| 12 if (window.enablePixelTesting) | 15 if (window.enablePixelTesting) |
| 13 testRunner.dumpAsTextWithPixelResults(); | 16 testRunner.dumpAsTextWithPixelResults(); |
| 14 else | 17 else |
| (...skipping 25 matching lines...) Expand all Loading... |
| 40 document.body.offsetTop; | 43 document.body.offsetTop; |
| 41 else if (document.documentElement) | 44 else if (document.documentElement) |
| 42 document.documentElement.offsetTop; | 45 document.documentElement.offsetTop; |
| 43 } | 46 } |
| 44 | 47 |
| 45 function finishRepaintTest() | 48 function finishRepaintTest() |
| 46 { | 49 { |
| 47 // Force a style recalc. | 50 // Force a style recalc. |
| 48 forceStyleRecalc(); | 51 forceStyleRecalc(); |
| 49 | 52 |
| 50 var repaintRects = window.internals.repaintRectsAsText(document); | 53 var repaintRects = window.internals.layerTreeAsText(document, window.interna
ls.LAYER_TREE_INCLUDES_REPAINT_RECTS); |
| 51 | 54 |
| 52 internals.stopTrackingRepaints(document); | 55 internals.stopTrackingRepaints(document); |
| 53 | 56 |
| 54 if (window.outputRepaintRects) { | 57 if (window.outputRepaintRects) { |
| 55 if (document.body) { | 58 if (document.body) { |
| 56 var root = document.body; | 59 var root = document.body; |
| 57 } else if (document.documentElement) { | 60 } else if (document.documentElement) { |
| 58 var root = document.createElementNS('http://www.w3.org/2000/svg', 'f
oreignObject'); | 61 var root = document.createElementNS('http://www.w3.org/2000/svg', 'f
oreignObject'); |
| 59 document.documentElement.appendChild(root); | 62 document.documentElement.appendChild(root); |
| 60 } | 63 } |
| 61 var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre'
); | 64 var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre'
); |
| 62 // Make this element appear in text dumps, but try to avoid affecting | 65 // Make this element appear in text dumps, but try to avoid affecting |
| 63 // output pixels (being visible, creating overflow, &c). | 66 // output pixels (being visible, creating overflow, &c). |
| 64 pre.style.opacity = 0; | 67 pre.style.opacity = 0; |
| 65 pre.textContent += repaintRects; | 68 pre.textContent += repaintRects; |
| 66 root.appendChild(pre); | 69 root.appendChild(pre); |
| 67 } | 70 } |
| 68 | 71 |
| 69 if (window.afterTest) | 72 if (window.afterTest) |
| 70 window.afterTest(); | 73 window.afterTest(); |
| 71 | 74 |
| 72 if (window.testIsAsync) | 75 if (window.testIsAsync) |
| 73 testRunner.notifyDone(); | 76 testRunner.notifyDone(); |
| 74 } | 77 } |
| OLD | NEW |