[wp-trac] [WordPress Trac] #63289: Error in validator.w3 (After updating to version 6.8)

WordPress Trac noreply at wordpress.org
Wed Jan 28 04:53:23 UTC 2026


#63289: Error in validator.w3 (After updating to version 6.8)
--------------------------+----------------------
 Reporter:  mike77777     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:
 Severity:  normal        |  Resolution:  wontfix
 Keywords:                |     Focuses:
--------------------------+----------------------

Comment (by dmsnell):

 I realize that I’m late to the party and this is closed, but I spend a lot
 of time pouring over the HTML spec, implementing HTML parsers, and
 building pieces of browser engines. I wanted to share more context since
 there’s a lot in this thread being tossed around that doesn’t match my
 understanding of how the web and the cooperation between browser vendors,
 the WhatWG, and the W3C works.

 ----

 MDN also has a tendency to lag the specs. If anyone is interested in the
 relevant section:

 > The script element has two core attributes. The type attribute allows
 customization of the type of script represented:
 > ...
 >  - Setting the attribute to an ASCII case-insensitive match for
 "speculationrules" means that the script defines a speculation rule set,
 containing JSON that will be used to describe speculative loads.
 > https://html.spec.whatwg.org/#attr-script-type

 The W3 validator appears to have been updated between the time of
 reporting this and now as the reported input passes validation. WordPress
 //was// producing valid HTML at the time of the report, but HTML is a
 living standard and changes frequently. It just so happened to be ahead of
 the validator.

 > "Bad value “speculationrules” for attribute “type” on element “script”:
 Subtype missing."

 It seems likely that the validator in use was attempting to MIME-decode
 the `type`, which is what a browser should do if the type is not a valid
 JavaScript MIME type essence match (what a mouthful!) or `module`,
 `importmap`, or `speculationrules`. That implies it was outdated and
 thought it should parse in the last category: non-JavaScript MIME types.

 `<script type=speculationrules>` was added in
 [https://github.com/whatwg/html/commit/c6314c8a3b8b356fa04163c53aa85982c5717559
 commit c6314c8a of the HTML spec] on September 10, 2025. Like most changes
 to the HTML spec, they occur //after// at least two
 browsers/“implementors” have [https://whatwg.org/working-mode#additions
 implemented the features]. In this case, Chrome had already been
 supporting the `speculationrules` since around March, 2025.

 It can be very confusing to follow the lifecycle of HTML spec changes,
 particularly because the spec follows actual adoption. In a case like
 this, every browser //must// treat the contents of the `SCRIPT` of unknown
 `type` as opaque text and not execute it. I can sympathize with the desire
 to pass validation; those flags and warnings really eat away at you! But
 in some cases it’s just a false flag.

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


More information about the wp-trac mailing list