* Transfers available body elements in vsync cycle. * @return {!Promise}
()
| 135 | * @return {!Promise} |
| 136 | */ |
| 137 | transferBodyChunk_() { |
| 138 | if (this.currentChunkTransferPromise_) { |
| 139 | return this.currentChunkTransferPromise_; |
| 140 | } |
| 141 | |
| 142 | this.currentChunkTransferPromise_ = Promise.all([ |
| 143 | this.targetBodyPromise_, |
| 144 | this.headPromise_, |
| 145 | ]).then((resolvedElements) => { |
| 146 | const transferThrottle = this.transferThrottle_; |
| 147 | return transferThrottle(() => { |
| 148 | this.currentChunkTransferPromise_ = null; |
| 149 | const targetBody = resolvedElements[0]; |
| 150 | removeNoScriptElements(devAssertElement(this.detachedBody_)); |
| 151 | while (this.detachedBody_.firstChild) { |
| 152 | targetBody.appendChild(this.detachedBody_.firstChild); |
| 153 | } |
| 154 | }); |
| 155 | }); |
| 156 | |
| 157 | return this.currentChunkTransferPromise_; |
| 158 | } |
| 159 | } |
no test coverage detected