From 85530de7d5a9d4691feb3e4813ac30c3d51c9a13 Mon Sep 17 00:00:00 2001 From: Jake Fried Date: Thu, 1 Jul 2021 12:14:39 -0400 Subject: [PATCH] amp-fit-text: fix cls by hiding until font size calculation --- extensions/amp-fit-text/0.1/amp-fit-text.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/amp-fit-text/0.1/amp-fit-text.js b/extensions/amp-fit-text/0.1/amp-fit-text.js index e57ce61ac38d..c4682de215ee 100644 --- a/extensions/amp-fit-text/0.1/amp-fit-text.js +++ b/extensions/amp-fit-text/0.1/amp-fit-text.js @@ -74,7 +74,7 @@ class AmpFitText extends AMP.BaseElement { this.content_ = this.element.ownerDocument.createElement('div'); applyFillContent(this.content_); this.content_.classList.add('i-amphtml-fit-text-content'); - setStyles(this.content_, {zIndex: 2}); + setStyles(this.content_, {zIndex: 2, visibility: 'hidden'}); this.contentWrapper_ = this.element.ownerDocument.createElement('div'); setStyles(this.contentWrapper_, {lineHeight: `${LINE_HEIGHT_EM_}em`}); @@ -149,6 +149,7 @@ class AmpFitText extends AMP.BaseElement { } return this.mutateElement(() => { this.updateFontSize_(); + setStyles(this.content_, {visibility: 'visible'}); }); }