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

WordPress Trac noreply at wordpress.org
Fri Jun 12 01:27:58 UTC 2020


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

Comment (by westonruter):

 It also works well in my testing. I tried throwing every possible image
 into the content, from floats to inlines to full-bleeds, including both
 image blocks and classic block.

 To help test I also created a test plugin to slow down the images in the
 content:
 https://gist.github.com/westonruter/340dfb31c09e7f82240161529e5ec93c

 Adding the width/height makes a huge difference with this plugin. Without
 the width/height insertion, there is a bunch of content shifting. But when
 the width/height are in place, the layout is stable.

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


More information about the wp-trac mailing list