diff --git a/validator/js/engine/validator.js b/validator/js/engine/validator.js index 58b51449af3f..35cdec3b43b4 100644 --- a/validator/js/engine/validator.js +++ b/validator/js/engine/validator.js @@ -3851,6 +3851,13 @@ function getLayoutSizeDefinedClass() { return 'i-amphtml-layout-size-defined'; } +/** + * @return {string} + */ +function getLayoutAwaitingSizeClass() { + return "i-amphtml-layout-awaiting-size"; +} + /** * @param {!generated.AmpLayout.Layout} layout * @return {boolean} @@ -3866,6 +3873,14 @@ function isLayoutSizeDefined(layout) { layout === generated.AmpLayout.Layout.RESPONSIVE); } +/** + * @param {!generated.AmpLayout.Layout} layout + * @return {boolean} + */ +function isLayoutAwaitingSize(layout) { + return layout === generated.AmpLayout.Layout.FLUID; +} + /** * @param {string} layout * @return {!generated.AmpLayout.Layout} @@ -4439,6 +4454,10 @@ function validateSsrLayout( // i-amphtml-layout-size-defined validInternalClasses[getLayoutSizeDefinedClass()] = 0; } + if (isLayoutAwaitingSize(layout)) { + // i-amphtml-layout-awaiting-size + validInternalClasses[getLayoutAwaitingSizeClass()] = 0; + } const classes = classAttr.split(/[\s+]/); for (const classToken of classes) { if (googString./*OK*/ startsWith(classToken, 'i-amphtml-') &&