iAPI Router: Revert "Handle styles assets on region-based navigation"#69222
iAPI Router: Revert "Handle styles assets on region-based navigation"#69222luisherranz merged 3 commits intotrunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +472 B (+0.03%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
|
@Mamaduka, it would be great if we could land this revert in WordPress 6.8. |
|
@cbravobernal, Gutenberg 20.4 will be part of WP 6.8, so no additional action is required. |
|
I just cherry-picked this PR to the release/20.3 branch to get it included in the next release: 4b7c573 |
|
Thanks, Fabian! 🙏 |
…WordPress#69222) * Revert "iAPI Router: Fix CSS rule order in some constructed style sheets (WordPress#68923)" This reverts commit 4aad5e3. * Revert "iAPI Router: Handle styles assets on region-based navigation (WordPress#67826)" This reverts commit 12f7764. * Add changelog entry
|
I've cherry-picked 7fbba99 to the |
…WordPress#69222) * Revert "iAPI Router: Fix CSS rule order in some constructed style sheets (WordPress#68923)" This reverts commit 4aad5e3. * Revert "iAPI Router: Handle styles assets on region-based navigation (WordPress#67826)" This reverts commit 12f7764. * Add changelog entry
What?
Reverts the work done for the style assets management implementation based on
document.adoptedStyleSheetsand constructedCSSStyleSheetinstances. Specifically, the following PRs are being reverted:This feature won't be included in Gutenberg until we find a solid way to update styles between pages using the iAPI's client-side navigation.
Why?
We've found the approach using
document.adoptedStyleSheetsis unreliable, as it doesn't work for linked style sheets whose content is restricted due to CORS policies. In such a case, our current implementation can't re-create the style sheet by reading its content, throwing the following error:Moreover, a
fetchcall trying to get the text content could also fail if the CSS style sheet is served without the appropriateAccess-Control-Allow-Originheader.For these cases, there's no way to construct a
CSSStyleSheetinstance to be included in theadoptedStyleSheetsproperty.