Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add Speculation Rules JSON script to validator spec for the AMP html_format #39962

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 21 additions & 1 deletion validator/validator-main.protoascii
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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: "<!--"
error_message: "html comments"
}
}
}
# AMP RTC (Real Time Config)
tags: {
html_format: AMP
Expand Down