4 ms·
I've found that about half of the sites that render a blank page without JS are just setting style="visibility: hidden" on the <body> element. I cannot think of
by wtallis 7y ago
I've found that about half of the sites that render a blank page without JS are just setting style="visibility: hidden" on the <body> element. I cannot think of any good reason for browsers to continue to allow that CSS property to be set on that element. "Flash of unstyled content" is not a valid concern here.
- saagarjha 7y ago> "Flash of unstyled content" is not a valid concern here. Well, presumably it is to some people, or they wouldn't be setting it…
- onion2k 7y ago"Flash of unstyled content" is not a valid concern here. Except it really is. Most websites are attached to businesses in some way. If you see statistics that the flash of unstyled content means 10% of your traffic leaves the site after less than a second you do what you can to fix it, and unfortunately that's often hiding everything until it's ready. Pragmatically, most businesses would give up users who don't like tracking long before they give up users who care about styling, because there are just a lot more people who care about styling. It's an unfortunate fact of web life.
- wtallis 7y ago> and unfortunately that's often hiding everything until it's ready. These sites usually aren't successful in that goal. Sure, they may be able to prevent content from showing up until the webfont has been loaded, but in my experience it's still extremely common for content to seriously jump around as the ads continue to load, especially on smaller screens (mobile). So using "flash of unstyled content" as an excuse just doesn't hold up: users still have to learn to give a site a few extra seconds to settle before it's safe to interact without the content reflowing under your finger to put an ad where you wanted to tap, and breaking accessibility "for the sake of preventing FOUC" is dumb when you still have FOUC. A similar tactic I've also seen that is even more unjustifiably anti-user is when the <body> element has "overflow: hidden" set until some heinous script that does it's own poor implementation of smooth scrolling can get up and running. These sites are universally improved by blocking such scripts and enabling native scrolling. This is one of the reasons why I believe browsers should be bundling together a large number of permissions that are off by default for every site the user has not flagged as being a web app. Google Maps has a good reason to interfere with scroll behavior; a news article does not.
- pjc50 7y ago> flash of unstyled content means 10% of your traffic leaves the site after less than a second Really? Why does this happen at all? After all the "visible=false" is a styling..
- onion2k 7y agoSome people decide whether or not a site is worth looking at extremely quickly - if it looks "old" or "broken" they hit the back button immediately. They will wait for the first paint though, so it can be better to delay anything appearing until everything is ready. The impact depends a lot on demographics.
- pjc50 7y agoAnd the second part - where does the bug lie that this happens at all?