Script Loader: Refine hoisted stylesheet ordering to preserve original CSS cascade in classic themes.
This introduces placeholder inline `STYLE` tags in the `HEAD` which are used to accurately locate hoisted styles which were printed in the footer. This improves the robustness of the hoisting logic. A style placeholder had been used previously in the inline style for `wp-block-library` for placing core block styles, and new placeholders are added for global styles and non-core block styles. Furthermore, this fixes the cascade for inline styles added to `wp-block-library`. When separate block styles are not used, these styles would have appeared after the single combined `wp-block-library`. However, in 6.9 the order changed so that separate block styles would appear after. To preserve the original cascade, this splits the `wp-block-library` inline style: the first half (likely just the inlined `block-library/common.css`) appears before the block styles, and the remainder appears in a new `STYLE#wp-block-library-inline-css-extra` element. Developed in https://github.com/WordPress/wordpress-develop/pull/10875 Follow-up to r61554, r61174, r61122, r61076, r61008. Props westonruter, joefusco, adamsilverstein, ocean90, mmorris8, ozgursar, vanonsopensource, xwolf, immeet94, george9, joezappie, jorbin, sajib1223, sabernhardt. See #64099, #64354, #64150, #43258. Fixes #64389. git-svn-id: https://develop.svn.wordpress.org/trunk@61945 602fd350-edb4-49c9-b593-d223f7449a82
W
Weston Ruter committed
2016709c6523e3ad19ada35d3dae40714a91c0b8
Parent: 876044b