[wp-trac] [WordPress Trac] #62731: Inline CSS inserted by wp_print_auto_sizes_contain_css_fix too high in HTML

WordPress Trac noreply at wordpress.org
Tue Jun 10 20:56:25 UTC 2025


#62731: Inline CSS inserted by wp_print_auto_sizes_contain_css_fix too high in HTML
---------------------------+------------------------------
 Reporter:  superpoincare  |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  General        |     Version:  6.7.1
 Severity:  minor          |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------
Changes (by sabernhardt):

 * severity:  normal => minor


Comment:

 I did not find an explanation on #62413 for printing the image style
 instead of enqueuing it.

 The `style` tag is added at priority `1` along with the `<title>` and
 `wp_robots`. Block themes print the title later because
 `_block_template_render_title_tag` [https://github.com/WordPress
 /wordpress-develop/blob/c1f2216287d9c097526caa7ecd456891f0c91537/src/wp-
 includes/block-template.php#L133-L135 replaces `_wp_render_title_tag`],
 adding the `<title>` at the same priority but apparently later in the
 order.

 Twenty Twenty-Four (block theme):

 {{{
 <!DOCTYPE html>
 <html lang="en-US">
 <head>
         <meta charset="UTF-8" />
         <meta name="viewport" content="width=device-width, initial-
 scale=1" />
 <meta name='robots' content='noindex, nofollow' />
         <style>img:is([sizes="auto" i], [sizes^="auto," i]) { contain-
 intrinsic-size: 3000px 1500px }</style>
         <title>Sample Page – Trunk (SVN)</title>
 }}}

 Twenty Twenty-One (classic theme with 'title-tag' support):

 {{{
 <!doctype html>
 <html lang="en-US" >
 <head>
         <meta charset="UTF-8" />
         <meta name="viewport" content="width=device-width, initial-
 scale=1.0" />
         <title>Sample Page – Trunk (SVN)</title>
 <meta name='robots' content='noindex, nofollow' />
         <style>img:is([sizes="auto" i], [sizes^="auto," i]) { contain-
 intrinsic-size: 3000px 1500px }</style>
 }}}

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


More information about the wp-trac mailing list