OLD | NEW |
1 function runRepaintTest() | 1 function runRepaintTest() |
2 { | 2 { |
3 if (window.testRunner && window.internals) { | 3 if (window.testRunner && window.internals) { |
4 window.testRunner.dumpAsText(); | 4 if (window.enablePixelTesting) |
| 5 window.testRunner.dumpAsTextWithPixelResults(); |
| 6 else |
| 7 window.testRunner.dumpAsText(); |
5 | 8 |
6 if (document.body) | 9 if (document.body) |
7 document.body.offsetTop; | 10 document.body.offsetTop; |
8 else if (document.documentElement) | 11 else if (document.documentElement) |
9 document.documentElement.offsetTop; | 12 document.documentElement.offsetTop; |
10 | 13 |
11 window.internals.startTrackingRepaints(document); | 14 window.internals.startTrackingRepaints(document); |
12 | 15 |
13 repaintTest(); | 16 repaintTest(); |
14 | 17 |
15 // force a style recalc. | 18 // force a style recalc. |
16 var dummy = document.body.offsetTop; | 19 var dummy = document.body.offsetTop; |
17 | 20 |
18 var repaintRects = window.internals.repaintRectsAsText(document); | 21 var repaintRects = window.internals.repaintRectsAsText(document); |
19 | 22 |
20 window.internals.stopTrackingRepaints(document); | 23 window.internals.stopTrackingRepaints(document); |
21 | 24 |
22 var pre = document.createElement('pre'); | 25 var pre = document.createElement('pre'); |
23 document.body.appendChild(pre); | 26 document.body.appendChild(pre); |
24 pre.innerHTML = repaintRects; | 27 pre.textContent += repaintRects; |
| 28 |
| 29 if (window.afterTest) |
| 30 window.afterTest(); |
25 } else { | 31 } else { |
26 setTimeout(repaintTest, 100); | 32 setTimeout(repaintTest, 100); |
27 } | 33 } |
28 } | 34 } |
OLD | NEW |