[wp-trac] [WordPress Trac] #62233: New img sizes=auto attribute appears to break HTML validation at w3.org

WordPress Trac noreply at wordpress.org
Tue Oct 15 19:37:32 UTC 2024


#62233: New img sizes=auto attribute appears to break HTML validation at w3.org
--------------------------+-----------------------------
 Reporter:  oldrup        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The new sises="auto,..." attribute added to image tag, does trigger an
 error in the HTML validator at w3.org


 Sample error:
 ''
 Bad value auto, (max-width: 384px) 100vw, 384px for attribute sizes on
 element img: Bad CSS number token: Expected a minus sign or a digit but
 saw a instead at auto,.

 <img width="384" height="124" src="https://oldrup.net/wp-
 content/uploads/2024/07/relevanssi-banner-3… 1544w" **sizes="auto**, (max-
 width: 384px) 100vw, 384px" itemprop="image" style="aspect-ratio: 3/1;" />
 ''

 related to https://core.trac.wordpress.org/changeset/59008

 That might be a shortcoming of the validator not recognizing the rather
 new attribute, but just so you are aware, that sites that would validate
 fine under WP 6.6, appears to fail under WP 6.7 beta 3.

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


More information about the wp-trac mailing list