Prevent render until all CSS is fulfilled #387
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@mossroy , I agree that this is a less risky way of solving (or rather, ameliorating) #381 for a v2.3 release.
I've implemented your helpful suggestions in commit 127ff29. Tested on IE, Edge, FFOS, Firefox Quantum.
I've also, optionally, added a commit 41f1b70 which displays an additional message to the user when the app is retrieving CSS from the ZIM instead of the cache. Because that is slow, and because first impressions often count strongly with apps, giving this additional small piece of feedback could be a user-friendly gesture. The message won't display again on subsequent page loads unless a further piece of CSS needs to be cached.
It's easy to drop that commit if you feel it's unnecessary. On FFOS, because of the very small screen size, it does look a bit cluttered the first time. But I think nowadays most mobiles have more width. However, the message could be abbreviated to just "Caching styles...". See what you think.