[wp-trac] [WordPress Trac] #35657: Image height calculation not always available on body.load

WordPress Trac noreply at wordpress.org
Fri Jan 29 11:37:03 UTC 2016


#35657: Image height calculation not always available on body.load
--------------------------+-----------------------------
 Reporter:  jipmoors      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Embeds        |    Version:  4.4.1
 Severity:  normal        |   Keywords:
  Focuses:  javascript    |
--------------------------+-----------------------------
 **Situation:**
 Embedding another page from the same blog inline.
 The embedded page has a featured image with the default aspects:
 <img width="600" height="314" src="a-600x314.png" class="attachment-large
 size-large" alt="Google penguin penalizes bad links" srcset="b-250x131.png
 250w, a-600x314.png 600w, c.png 1200w" sizes="(max-width: 600px) 100vw,
 600px" />

 **Issue:**
 When loading the page the iFrame doesn't always get resized to desired
 height properly (about 50% of the time).

 **Problem:**
 Because of the dynamic "height:auto" css property the browser has not
 always calculated the height the image will be displayed at when the
 'body.ready' event is triggered. Though sometimes it is.
 .wp-embed-featured-image img{width:100%;height:auto;border:none}
 This is a style set by 'wp-embed-template.min.css'.

 When loading the image locally everything works fine but when using our
 test image of 400kb on an AWS server it is problematic most of the time.

 See attached files for reproducing the problem.

 **Tested browsers:**
 OSX 10.11.2: Chrome Version 47.0.2526.111 (64-bit)
 OSX 10.11.2: Safari 9.0.2
 Windows 10: Chrome Version 48.0.2564.97 m

 It looks like it does not affect Internet Explorer 11 (11.0.26)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35657>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list