[wp-trac] [WordPress Trac] #54752: `load-styles.php` stylesheet not properly added in the editor

WordPress Trac noreply at wordpress.org
Tue Jan 11 17:03:33 UTC 2022


#54752: `load-styles.php` stylesheet not properly added in the editor
--------------------------+---------------------
 Reporter:  walbo         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.9
Component:  Editor        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------
Changes (by walbo):

 * keywords:  reporter-feedback =>


Comment:

 Did some more digging and think I know the issue.

 The warning are triggered by
 [https://github.com/WordPress/gutenberg/blob/wp/5.9/packages/block-
 editor/src/components/iframe/index.js#L30-L96 stylesheetCompat] function
 in Gutenberg. The function loads all stylesheets that contains `editor-
 styles-wrapper`, `wp-block`, or `wp-block-*` class selectors into the
 iframe that is used in previews.

 When the `SCRIPT_DEBUG` is set to `false` the `load-styles.php?...`
 concatinates all editor assets and `stylesheetCompat` will pick up the
 stylesheet because it now meets the conditions to include it in the
 iframe.

 From what I can understand none of the styles that are included in
 [https://github.com/WordPress/wordpress-develop/blob/5.9/src/wp-includes
 /script-loader.php#L2791-L2863 wp_add_iframed_editor_assets_html]
 shouldn't be concatinated into `load-styles`, but someone with a deeper
 understanding of how the editor handles styles should be included to
 verify this.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54752#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list