[wp-trac] [WordPress Trac] #62413: WordPress 6.7 Auto-sizes Reducing Image Sizes

WordPress Trac noreply at wordpress.org
Tue Oct 7 06:22:24 UTC 2025


#62413: WordPress 6.7 Auto-sizes Reducing Image Sizes
-------------------------------------------------+-------------------------
 Reporter:  dooperweb                            |       Owner:  joemcgill
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.7.1
Component:  Media                                |     Version:  6.7
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-test-info has-patch has-unit-    |     Focuses:
  tests fixed-major commit dev-reviewed          |  performance
-------------------------------------------------+-------------------------

Comment (by westonruter):

 In [changeset:"60910" 60910]:
 {{{
 #!CommitTicketReference repository="" revision="60910"
 Media: Switch to enqueueing `contain-intrinsic-size` CSS fix for `IMG`
 tags having `sizes=auto`.

 This deprecates the `wp_print_auto_sizes_contain_css_fix()` function
 running at `wp_head` priority 1, in favor of a
 `wp_enqueue_img_auto_sizes_contain_css_fix()` function which runs just
 before at `wp_head` priority 0. The latter function unhooks the former
 while also enqueueing an inline style to be printed with all other styles
 but up front to preserve the cascade. This eliminates directly printing
 the `STYLE` tag, which was a change done similarly before for the emoji
 styles. See #58775.

 For backwards compatibility, the CSS can still be prevented from being
 enqueued/printed via:

     remove_action( 'wp_head', 'wp_print_auto_sizes_contain_css_fix', 1 );

 This change ensures that all styles are printed together using the correct
 API for emitting styles.

 Developed in https://github.com/WordPress/wordpress-develop/pull/8954.

 Follow-up to [59435].

 Props westonruter, sabernhardt, SirLouen, flixos90, joemcgill,
 SergeyBiryukov, superpoincare.
 See #62413.
 Fixes #62731.
 }}}

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


More information about the wp-trac mailing list