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

WordPress Trac noreply at wordpress.org
Sat Nov 21 21:34:37 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:
----------------------------+------------------------
Changes (by azaozz):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 > If someone adds a custom sizes attribute in the post editor but no
 srcset attribute...

 Can the `sizes` attribute be used without having `srcset` attribute? As
 far as I see it cannot. Why should we support bad/broken HTML and let it
 override the core functionality?

 In my opinion this should be reverted and all the `sizes` checks should be
 removed. If we are generating srcset, we should be generating the sizes to
 go with it.

 If somebody wants to change the sizes attribute, they can use the filter.
 Then we are in better position to ensure backwards compatibility one day.
 If somebody adds invalid/inconsistent attributes, they will get invalid
 HTML.

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


More information about the wp-trac mailing list