Opened 13 months ago
Closed 13 months ago
#62233 closed defect (bug) (reported-upstream)
New img sizes=auto attribute appears to break HTML validation at w3.org
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | minor | Version: | |
| Component: | General | Keywords: | |
| Focuses: | performance | Cc: |
Description
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.
Change History (2)
#1
@
13 months ago
- Focuses performance added
- Milestone changed from Awaiting Review to 6.7
- Owner set to joemcgill
- Status changed from new to reviewing
#2
@
13 months ago
- Milestone 6.7 deleted
- Resolution set to reported-upstream
- Status changed from reviewing to closed
Indeed, this looks like a bug that has already been reported upstream.
Thanks for the report, @oldrup. As you mention,
sizes="auto"is a relatively new addition to the HTML spec, and already has pretty good browser support, so I suspect that this is a bug with the validator that will need to be updated, but we should look into it to be sure.