Bug 8068 - tlwebadm pages can briefly load without CSS
Summary: tlwebadm pages can briefly load without CSS
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Web Administration (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords: prosaic
Depends on:
Blocks:
 
Reported: 2023-01-10 16:51 CET by Pierre Ossman
Modified: 2023-03-03 16:22 CET (History)
0 users

See Also:
Acceptance Criteria:
* The page should always be shown with the correct styling/layout, even whilst loading * Non-critical items, such as images and fonts, can be shown later


Attachments

Description Pierre Ossman cendio 2023-01-10 16:51:22 CET
If the CSS isn't cached (or the cache is disabled), then the browser will briefly display most pages in tlwebadm without any CSS. Once the CSS loads, the page will adjust and look the way it is intended.

This stutter can be ugly and annoying. Most users should rarely see it, though, as the CSS should be cached after the first page visit.

This can mostly be seen in Firefox, but some effect is also seen in Chrome.

tlwebaccess doesn't have this problem, and some pages in tlwebadm are also free from it. The reason being that they have JavaScript on them. Apparently that forces the browser to wait the scripts before considering the page loaded, and the scripts in turn are guaranteed to have CSS loaded. This odd requirement is described here:

https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event

It also talks about "deferred scripts", but that doesn't seem to be necessary as an empty `<script></script>` section is enough to resolve the issue.
Comment 1 Pierre Ossman cendio 2023-03-02 11:08:03 CET
Need to do this now and as we need to add a script to all pages as part of bug 7909. In other words, we'll get the effect we want here as a side effect.

To avoid this detail getting lost, we'll fix this bug with something more explicit in place.
Comment 2 Pierre Ossman cendio 2023-03-03 16:22:41 CET
We ended up scrapping that plan for bug 7909, so this bug is back on the queue.

Note You need to log in before you can comment on or make changes to this bug.