[Webkit-unassigned] [Bug 39455] <link> elements with media queries that do not affect the current page can be delayed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 6 04:23:41 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=39455

--- Comment #10 from Vadim Makeev <pepelsbey at gmail.com> ---
There’s another use case for this behavior that might affect performance on some websites. This quite popular CSS lazy-loading trick doesn’t work in Safari:

<link
    rel="stylesheet"
    href="critical.css"
>
<link
    rel="stylesheet"
    href="deferred.css"
    media="print"
    onload="this.media='all'"
>
<noscript>
    <link
        rel="stylesheet"
        href="deferred.css"
    >
</noscript>

All other browsers will render styles from critical.css and keep loading deferred.css in the background to apply them once they’re loaded. But Safari will wait for deferred.css and not render anything until it’s loaded.

See more details in my the post https://pepelsbey.dev/articles/lazy-loading-safari/

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230206/d8defdbc/attachment-0001.htm>


More information about the webkit-unassigned mailing list