Make WordPress Core

Opened 2 months ago

Closed 2 months ago

#63965 closed defect (bug) (duplicate)

HTML Validation Error: wp_print_speculation_rules uses type="speculationrules"

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

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
2 months ago

  • Description modified (diff)
  • Focuses accessibility javascript coding-standards removed
  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 6.8.2 deleted

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.