[wp-trac] [WordPress Trac] #50909: WordPress 5.5 update adds height and width attributes to images

WordPress Trac noreply at wordpress.org
Wed Aug 12 00:10:35 UTC 2020


#50909: WordPress 5.5 update adds height and width attributes to images
--------------------------+------------------------------
 Reporter:  jeslen        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  5.5
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by jeslen):

 Replying to [comment:6 flixos90]:
 > Replying to [comment:3 jeslen]:
 > > https://make.wordpress.org/core/2020/07/14/lazy-loading-images-in-5-5/
 > >
 > > This states that only images that already have both the width and
 height attributes set will have the lazy-loading applied. That's not the
 case here. Images without width or height are having them applied as well
 as the loading attribute. This is breaking site layouts more than a layout
 shift would.
 >
 > Images will also receive `width` and `height` attributes where that
 information is available. Would you be willing to share which theme you
 are using? Typically themes should specify CSS rules such as `max-width:
 100%; height: auto` to avoid this kind of overflowing.


 This one in particular is child theme based on the timber starter theme
 and built with Bootstrap.

 The images are being displayed via the Gutenberg editor with the {{{wp-
 block-styles}}} theme support added. I can see that {{{ .wp-block-image
 img {max-width: 100%} }}} is set. It might be helpful to add the
 {{{height: auto}}} style here as well.

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


More information about the wp-trac mailing list