RESOLVED FIXED 234094
Layered @import rules in <style> should be preloaded
https://bugs.webkit.org/show_bug.cgi?id=234094
Summary Layered @import rules in <style> should be preloaded
Xiaocheng Hu
Reported 2021-12-09 11:28:34 PST
Created attachment 446576 [details] layered imports not preloaded Test case: https://purring-various-felidae.glitch.me/css-import-preload-layer.html It tests if the following CSS imports are preloaded: <style> @import url('/stylesheet?delay=1001'); @import url('/stylesheet?delay=1002') layer; @import url('/stylesheet?delay=1003') layer(foo); </style> (Here delay=foo means the request takes foo ms to finish) All the three should be preloaded, but as I tested in Safari Technology Preview Release 135 (Safari 15.4, WebKit 17613.1.7.3), the two layered imports are not preloaded. They start loading only after the parser-blocking script have finished, as shown by the attached screenshot. This will hurt the loading performance when using cascade layers, since @import is currently the only way to add an external stylesheet into a layer.
Attachments
layered imports not preloaded (493.72 KB, image/png)
2021-12-09 11:28 PST, Xiaocheng Hu
no flags
Patch (7.39 KB, patch)
2022-01-17 05:35 PST, Antti Koivisto
no flags
Patch (7.35 KB, patch)
2022-01-17 05:41 PST, Antti Koivisto
no flags
Patch (7.53 KB, patch)
2022-01-17 05:42 PST, Antti Koivisto
no flags
Radar WebKit Bug Importer
Comment 1 2021-12-16 11:29:18 PST
Antti Koivisto
Comment 2 2022-01-17 05:35:46 PST
Antti Koivisto
Comment 3 2022-01-17 05:41:17 PST
Antti Koivisto
Comment 4 2022-01-17 05:42:16 PST
EWS
Comment 5 2022-01-17 11:45:23 PST
Committed r288099 (246113@main): <https://commits.webkit.org/246113@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 449330 [details].
Note You need to log in before you can comment on or make changes to this bug.