From bf69bd03de626ce8b869b0507eab58b0454bc223 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 16 Apr 2024 12:20:24 -0700 Subject: [PATCH] Add Speculation Rules JSON script to validator for AMP html_format --- validator/validator-main.protoascii | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index 2cbe832f1281..5403db277ae4 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -3279,7 +3279,7 @@ tags: { # 4.11 Scripting # 4.11.1 The script element -# Only the amphtml script, custom extensions and the LD/JSON or TEXT/PLAIN +# Only the amphtml script, custom extensions, and the LD/JSON, SPECULATIONRULES, or TEXT/PLAIN # description are allowed. # Note that the type TEXT/PLAIN description is define in # validator-amp-mustache.protoascii. @@ -3632,6 +3632,26 @@ tags: { } } } +# JSON Speculation Rules +tags: { + html_format: AMP + tag_name: "SCRIPT" + spec_name: "script type=speculationrules" + descriptive_name: "script type=speculationrules" + attr_lists: "nonce-attr" + attrs: { + name: "type" + mandatory: true + value_casei: "speculationrules" + dispatch_key: NAME_VALUE_DISPATCH + } + cdata: { + disallowed_cdata_regex: { + regex: "