[wp-trac] [WordPress Trac] #34678: Responsive Images: Check if content images already have a sizes attribute

WordPress Trac noreply at wordpress.org
Sun Nov 22 18:15:24 UTC 2015


#34678: Responsive Images: Check if content images already have a sizes attribute
----------------------------+------------------------
 Reporter:  jaspermdegroot  |       Owner:  joemcgill
     Type:  defect (bug)    |      Status:  reopened
 Priority:  normal          |   Milestone:  4.4
Component:  Media           |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+------------------------

Comment (by azaozz):

 Replying to [comment:11 jaspermdegroot]:

 We chatted few months ago that the next logical stage of "responsive
 images" should be adding srcset and sizes to post_content either directly
 in TinyMCE or on saving a post. That will bring high-res images in the
 editor and will eliminate the use of the display filter for new posts.
 It's likely to happen in 4.6-4.7, after the specs and the browser
 implementations (including in contentEditable) have completely
 "solidified".

 I think it's important to strongly discourage hard-coding `sizes` in
 post_content for this initial implementation:
 - It's hard-coded :)
 - It's useless without `srcset`.
 - It relies on the display filter to add the srcset which can be changed
 by plugins or by core in the future.
 - It may make future back-compat a pain.

 > I think we should decide if there are good use cases for inserting a
 custom `sizes` attribute in the image markup instead of using the filter,
 and if so, I suggest we don't make that harder by requiring a `srcset` as
 well.

 Don't think it is good to add hard-coded attribute that depends on a
 dynamically generated one. Also, this will not display properly in TinyMCE
 which can be pretty disorienting (the image "magically" changes size when
 viewing the post). Perhaps we can support such cases in the next stage if
 we implement adding srcset and sizes in TinyMCE.

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


More information about the wp-trac mailing list