GoogleCloudPlatform/cloud-run-hello

Avoid layout refresh due to unknown image size

steren opened this issue · 1 comments

With the new design (c45d502), the main image is not inlined in the HTML, thus requiring a subsequent request to be downloaded.

However, browsers start to render the page as soon as they have the HTML (and before the image is fully downloaded), leading to a layout refresh once it is downloaded. See the issue in this animation:
screen-capture

This is a common issue with websites, the effect can be mitigated by providing the the exact size or the aspect ratio via CSS or img attributes

I can help with that.

CC @code128 @chemichelle