* Callback passed into DetachedDomStream constructor. Receives updated * document everytime a new chunk is written. * Resolves headPromise when body is available, and streams to body iff * bodyTransfer() has been called. * @param {!Document} detachedDoc
(detachedDoc)
| 68 | * @param {!Document} detachedDoc |
| 69 | */ |
| 70 | onChunk(detachedDoc) { |
| 71 | // <body> is newly formed. |
| 72 | if (!this.detachedBody_ && detachedDoc.body) { |
| 73 | this.detachedBody_ = detachedDoc.body; |
| 74 | this.headResolver_(devAssertElement(detachedDoc.head)); |
| 75 | } |
| 76 | |
| 77 | // If bodyTransfer has already been called, keep transferring on new chunks. |
| 78 | if (this.shouldTransfer_) { |
| 79 | this.transferBodyChunk_(); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Callback passed into DetachedDomStream constructor. Called with complete |
no test coverage detected