* If it makes sense, let the browser paint the current frame before * executing the callback. * @param {!Window} win * @param {function()} cb Callback that should run after a frame was * pumped.
(win, cb)
| 508 | * pumped. |
| 509 | */ |
| 510 | function maybePumpEarlyFrame(win, cb) { |
| 511 | // There is definitely nothing to draw yet, so we might as well |
| 512 | // proceed. |
| 513 | if (!win.document.body) { |
| 514 | cb(); |
| 515 | return; |
| 516 | } |
| 517 | if (hasRenderDelayingServices(win)) { |
| 518 | cb(); |
| 519 | return; |
| 520 | } |
| 521 | Services.timerFor(win).delay(cb, 1); |
| 522 | } |
no test coverage detected