* @private * @restricted
()
| 498 | * @restricted |
| 499 | */ |
| 500 | startRender_() { |
| 501 | if (this.host) { |
| 502 | this.host.renderStarted(); |
| 503 | } else { |
| 504 | this.signals_.signal(CommonSignals_Enum.RENDER_START); |
| 505 | } |
| 506 | |
| 507 | // TODO(ccordry): remove when no-signing launched. |
| 508 | if (!this.spec.skipHtmlMerge) { |
| 509 | // When not streaming renderStart signal is good enough. |
| 510 | this.renderComplete_.resolve(); |
| 511 | } |
| 512 | |
| 513 | // Common signal RENDER_START indicates time to toggle visibility |
| 514 | setStyle(this.iframe, 'visibility', ''); |
| 515 | if (this.win.document && this.win.document.body) { |
| 516 | this.win.document.documentElement.classList.add('i-amphtml-fie'); |
| 517 | setStyles(dev().assertElement(this.win.document.body), { |
| 518 | opacity: 1, |
| 519 | visibility: 'visible', |
| 520 | animation: 'none', |
| 521 | }); |
| 522 | } |
| 523 | |
| 524 | // Initial load signal signal. |
| 525 | let rect; |
| 526 | if (this.host) { |
| 527 | rect = this.host.getLayoutBox(); |
| 528 | } else { |
| 529 | rect = layoutRectLtwh( |
| 530 | 0, |
| 531 | 0, |
| 532 | this.win./*OK*/ innerWidth, |
| 533 | this.win./*OK*/ innerHeight |
| 534 | ); |
| 535 | } |
| 536 | Promise.all([ |
| 537 | this.whenRenderComplete(), |
| 538 | whenContentIniLoad(this.ampdoc, this.win, rect), |
| 539 | ]).then(() => { |
| 540 | this.signals_.signal(CommonSignals_Enum.INI_LOAD); |
| 541 | }); |
| 542 | } |
| 543 | |
| 544 | /** |
| 545 | * @return {!HTMLBodyElement} |
no test coverage detected