-
Notifications
You must be signed in to change notification settings - Fork 24
Can we require no FoUC/jank on initial load? #37
Comments
Related: ausi/cq-prolyfill#39 EDIT Note that this thread invalidates my opening statement. |
So, turns out, "async" doesn't mean what I thought it meant, and this is, I think, a non-issue. See https://twitter.com/etportis/status/872575323757436928. Closing. |
Double-turns-out, even though Canary, which I was testing with, currently runs async microtasks to completion before painting, Firefox won't. So the threat of a FoUC, with async evaluation, is real. |
Is this an issue with a native ResizeObserver? |
Shortly after pinging a bunch of issues I had some coffee, and this probably could land in the
but, like, with Better Words, not those words |
@beep, those words are pretty good. If the FOUC is affecting a library in the wild, even better. @tomhodgins, has this bitten you at all with the various things you built? |
Absolutely :D I've written about one technique I used when building with EQCSS to work around it here: How to avoid FOUC with EQCSS Basically the idea is…set In general, the principle applies to all forms of JS-powered styling, not just element queries :D |
Awesome! Remember, the goal here is to expose the limitations in the platform. So, documenting the hack, and possible side effects of that hack are important.
Noob question wrt Houdini.. they must cope with this somehow, no? |
Ok, so to close this issue, we basically should distill @tomhodgins post down as much as possible, and combine it @beep's words above. We then reference @tomhodgins post it as evidence that it's a problem that people have hit. If we know of other techniques, we should cite those too. |
All existing experimental prollyfills are susceptible to some form of FoUC/layout jank.
As elements are laid-out, and then queried asynchronously[1], before being, possibly, re-laid-out, re-queried, &etc — it’s hard (though maybe not impossible?) to implement CQs in a way that doesn't take a few paints to settle down.
This is why Shopify abandoned their CQ solution: https://twitter.com/dfmcphee/status/870458614842105856
Personally, container queries taking effect "a frame later or so"[2] on window resizes bugs me very little. But jank on the initial load bugs me very much.
Are there reasonable, specific requirements we can set up around FoUC/layout jank?
[1]: for the importance of async querying as an essential part of any CQ solution (and not just an unfortunate characteristic of temporary prolyfills), see https://twitter.com/gregwhitworth/status/850129597844701184
[2]: https://lists.w3.org/Archives/Public/public-respimg/2016Sep/0004.html
The text was updated successfully, but these errors were encountered: