[wp-trac] [WordPress Trac] #50367: Avoid layout shifting due to images not having dimension attributes

WordPress Trac noreply at wordpress.org
Thu Jun 11 18:48:59 UTC 2020


#50367: Avoid layout shifting due to images not having dimension attributes
--------------------------+---------------------
 Reporter:  flixos90      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.5
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by flixos90):

 Related: https://github.com/WordPress/gutenberg/issues/6177

 However, these two issues don't block or exclude each other.
 `wp_image_add_srcset_and_sizes` already relies on the image's dimensions
 if the `img` tag doesn't provide them, so it should be safe to add them in
 that case.

 Adding the attributes in Gutenberg would improve specifically for
 previewing in the editor as well as catering better for the case where a
 `width` and `height` that do not match the actual image dimensions should
 be used.

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


More information about the wp-trac mailing list