-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit site: prevent enqueuing entire stylesheet in iframe #54254
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.4/script-loader.php |
Size Change: -46 B (0%) Total Size: 1.52 MB
ℹ️ View Unchanged
|
@@ -27,7 +27,7 @@ | |||
* } | |||
*/ | |||
function _gutenberg_get_iframed_editor_assets() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are changing something on the 6.3 folder which may make it easier to miss during the backport to 6.4. I guess we could remove this function from the 6.3 file and add it updated in an equivalent wordpress-6.4 file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, though I wanted to avoid copying over the entire thing again. And this change would still work ok even in 6.3. I added the PHP back port label so it should be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a little uncommon to make changes in a 6.3 folder after 6.3 is released but yes provided we don't miss the backport and it still works it is fine by me to keep it there. Feel free to merge 👍
@@ -90,10 +90,6 @@ | |||
} | |||
} | |||
|
|||
.edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rule seems now useless and in my tests could be safely removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than considering making the php changes in a wordpress-6.4 folder the PR looks good to me 👍
@ellatrix, @jorgefilipecosta, just checking that this is on your radar to backport before the 6.4 beta tomorrow? |
@SiobhyB, I can handle this one. |
Removes enqueuing the `'wp-edit-site'` stylesheet from the iframed assets in `_wp_get_iframed_editor_assets()`. The global `$pagenow` is also removed as it is no longer used within the function. References: * [WordPress/gutenberg#54254 Gutenberg PR 54254] Props ellatrix, jorgefilipecosta, Mamaduka, mukesh27. Follow-up to [56047], [53160]. Fixes #59456. git-svn-id: https://develop.svn.wordpress.org/trunk@56736 602fd350-edb4-49c9-b593-d223f7449a82
Removes enqueuing the `'wp-edit-site'` stylesheet from the iframed assets in `_wp_get_iframed_editor_assets()`. The global `$pagenow` is also removed as it is no longer used within the function. References: * [WordPress/gutenberg#54254 Gutenberg PR 54254] Props ellatrix, jorgefilipecosta, Mamaduka, mukesh27. Follow-up to [56047], [53160]. Fixes #59456. Built from https://develop.svn.wordpress.org/trunk@56736 git-svn-id: http://core.svn.wordpress.org/trunk@56248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes enqueuing the `'wp-edit-site'` stylesheet from the iframed assets in `_wp_get_iframed_editor_assets()`. The global `$pagenow` is also removed as it is no longer used within the function. References: * [WordPress/gutenberg#54254 Gutenberg PR 54254] Props ellatrix, jorgefilipecosta, Mamaduka, mukesh27. Follow-up to [56047], [53160]. Fixes #59456. Built from https://develop.svn.wordpress.org/trunk@56736 git-svn-id: https://core.svn.wordpress.org/trunk@56248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The changes have been committed into Core https://core.trac.wordpress.org/changeset/56736, though after Beta 1. Sorry I missed it yesterday. |
Removes enqueuing the `'wp-edit-site'` stylesheet from the iframed assets in `_wp_get_iframed_editor_assets()`. The global `$pagenow` is also removed as it is no longer used within the function. References: * [WordPress/gutenberg#54254 Gutenberg PR 54254] Props ellatrix, jorgefilipecosta, Mamaduka, mukesh27. Follow-up to [56047], [53160]. Fixes #59456. git-svn-id: https://develop.svn.wordpress.org/trunk@56736 602fd350-edb4-49c9-b593-d223f7449a82
What?
I tried to remove enqueuing the
edit-site
stylesheet from the iframe. We were forced to enqueue it because it was triggering the compat styles function, and we didn't investigate further.It turns out this is caused by #48941. The addition of the
.wp-block-*
selector causes the compat function to enqueue it in the iframe and log a warning. I removed this line which means the stylesheet can now safely be removed from the iframe. However, I don't understand why this line is necessary. @jorgefilipecosta could you have a look?Why?
The
edit-site
stylesheet is meant to style UI, not editor content. Loading it in the iframe slow it down, and it can potentially clash with editor content rules.How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast