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:
@import url('/stylesheet?delay=1002') layer;
@import url('/stylesheet?delay=1003') layer(foo);
(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 176184.108.40.206), 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.
Created attachment 449326 [details]
Created attachment 449328 [details]
Created attachment 449330 [details]
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].