[wp-trac] [WordPress Trac] #59464: Images hard-coded in block theme templates lack `width` and `height` attributes (was: Images in 2024 theme do not have modern image features)

WordPress Trac noreply at wordpress.org
Mon Oct 9 19:16:24 UTC 2023


#59464: Images hard-coded in block theme templates lack `width` and `height`
attributes
--------------------------+--------------------------
 Reporter:  spacedmonkey  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.5
Component:  Themes        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  performance
--------------------------+--------------------------
Changes (by flixos90):

 * keywords:  has-patch => needs-patch


Old description:

> Images in 2024 theme do not have modern image features, such as async
> decoding, fetch priority and lazy loading. All images hard coded into
> patterns should have height and width attributes.

New description:

 All images hard coded into block templates and patterns should have height
 and width attributes (applies e.g. to the TT4 theme).

 It also prevents loading optimization attributes from being added to these
 images, so effectively this harms both load time performance and leads to
 layout shifts.

--

Comment:

 @spacedmonkey @joemcgill I've opened #59577 to focus on the lack of image
 loading optimization attributes on images within block templates, which is
 the other bug we found here (i.e. even if we fixed the missing dimensions,
 that bug would still apply). Therefore, I am refocusing this ticket
 specifically on the lack of dimension attributes on in-template images.

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


More information about the wp-trac mailing list