Make WordPress Core

#63965 closed defect (bug) (duplicate)

HTML Validation Error: wp_print_speculation_rules uses type="speculationrules"

Reported by: svilupporobyone Owned by:
Priority: normal Milestone:
Component: General Version:
Severity: normal Keywords:
Cc: Focuses:

Description (last modified by sabernhardt)

In WordPress, the function wp_print_speculation_rules() generates inline scripts like this:
<script type="speculationrules"> ... </script>
While this works correctly in browsers, it fails HTML validation (e.g., W3C Validator) because type="speculationrules" is not a valid MIME type. The validator reports:
Bad value speculationrules for attribute type on element script: Subtype missing.

Change History (1)

#1 @sabernhardt
12 months ago

  • Description modified (diff)
  • Focuses accessibility javascript coding-standards removed
  • Keywords needs-patch removed
  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed
  • Version 6.8.2

Hi and welcome to WordPress Core Trac!

This was already reported on #63289 and #63801.

The speculationrules value is valid, but the W3C Validator still needs to recognize the speculation rules API.
https://github.com/validator/validator/issues/1814

Note: See TracTickets for help on using tickets.