3 ms·
The CSS animation only comes into play as a fallback mechanism. The AMP script will force a draw sooner otherwise.
by SquareWheel 8y ago
The CSS animation only comes into play as a fallback mechanism. The AMP script will force a draw sooner otherwise.
- gregable 8y agoPrecisely. The exact code is here: https://www.ampproject.org/docs/fundamentals/spec/amp-boilerplate https://www.ampproject.org/docs/fundamentals/spec/amp-boiler... Here it is pretty-printed and simplified to not have the vendor-specific stuff: <style amp-boilerplate> body{ animation:-amp-start 8s steps(1,end) 0s 1 normal both } @keyframes -amp-start{ from{visibility:hidden}to{visibility:visible} } </style> <noscript> <style amp-boilerplate> body{animation:none} </style> </noscript> The first bit is for browsers with javascript, but where the network is poor and can't load the minimal required highly cacheable javascript file within 8 seconds. It uses CSS just in case javascript really isn't working anyway such as being disabled per domain or something. The second bit is for browsers without javascript - the page is unblocked immediately.