From e7e1aa82293713a7b45920676207315522cd4ed1 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Mon, 30 Apr 2018 10:51:09 -0700 Subject: [PATCH] Regression: Avoid reflows on lazy image placeholders Now we are applying width: 100% to all placeholders we are causing significant reflows for the entire page. Restrict altering the height on only real images which can be distorted by dimensional changes Bug: T191893 Change-Id: I982d928273dc3b6f30974f2401760d5d44ce4b82 --- resources/skins.minerva.content.styles/images.less | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/skins.minerva.content.styles/images.less b/resources/skins.minerva.content.styles/images.less index d7e195a..b535434 100644 --- a/resources/skins.minerva.content.styles/images.less +++ b/resources/skins.minerva.content.styles/images.less @@ -57,6 +57,12 @@ // make sure that images in articles don't cause a horizontal scrollbar // on small screens max-width: 100% !important; + } + + // Note height auto is only applied to images. Not neeed for the lazy-image-placeholder which is + // a gray box and will cause reflows. + noscript > img, + a > img { height: auto !important; }