diff --git a/extensions/amp-mustache/validator-amp-mustache.protoascii b/extensions/amp-mustache/validator-amp-mustache.protoascii index c48de699a937..bca89f9b190b 100644 --- a/extensions/amp-mustache/validator-amp-mustache.protoascii +++ b/extensions/amp-mustache/validator-amp-mustache.protoascii @@ -77,6 +77,132 @@ tags: { disallowed_ancestor: "FORM DIV [submitting][template]" disallowed_ancestor: "FORM DIV [verify-error][template]" requires_extension: "amp-mustache" + attrs: { + name: "id" + add_value_to_set: TEMPLATE_IDS + # When updating this blacklisted_value_regex, also update elsewhere in this + # file, and in mandatory-id-attr and $GLOBAL_ATTRS in + # validator-main.protoascii, and validator-amp-script.protoascii. + blacklisted_value_regex: "(^|\\s)(" # Values are space separated + "__amp_\\S*|" + "__count__|" + "__defineGetter__|" + "__defineSetter__|" + "__lookupGetter__|" + "__lookupSetter__|" + "__noSuchMethod__|" + "__parent__|" + "__proto__|" + "__AMP_\\S*|" + "\\$p|" + "\\$proxy|" + "acceptCharset|" + "addEventListener|" + "appendChild|" + "assignedSlot|" + "attachShadow|" + "AMP|" + "baseURI|" + "checkValidity|" + "childElementCount|" + "childNodes|" + "classList|" + "className|" + "clientHeight|" + "clientLeft|" + "clientTop|" + "clientWidth|" + "compareDocumentPosition|" + "computedName|" + "computedRole|" + "contentEditable|" + "createShadowRoot|" + "enqueAction|" + "firstChild|" + "firstElementChild|" + "getAnimations|" + "getAttribute|" + "getAttributeNS|" + "getAttributeNode|" + "getAttributeNodeNS|" + "getBoundingClientRect|" + "getClientRects|" + "getDestinationInsertionPoints|" + "getElementsByClassName|" + "getElementsByTagName|" + "getElementsByTagNameNS|" + "getRootNode|" + "hasAttribute|" + "hasAttributeNS|" + "hasAttributes|" + "hasChildNodes|" + "hasPointerCapture|" + "i-amphtml-\\S*|" + "innerHTML|" + "innerText|" + "inputMode|" + "insertAdjacentElement|" + "insertAdjacentHTML|" + "insertAdjacentText|" + "isContentEditable|" + "isDefaultNamespace|" + "isEqualNode|" + "isSameNode|" + "lastChild|" + "lastElementChild|" + "lookupNamespaceURI|" + "namespaceURI|" + "nextElementSibling|" + "nextSibling|" + "nodeName|" + "nodeType|" + "nodeValue|" + "offsetHeight|" + "offsetLeft|" + "offsetParent|" + "offsetTop|" + "offsetWidth|" + "outerHTML|" + "outerText|" + "ownerDocument|" + "parentElement|" + "parentNode|" + "previousElementSibling|" + "previousSibling|" + "querySelector|" + "querySelectorAll|" + "releasePointerCapture|" + "removeAttribute|" + "removeAttributeNS|" + "removeAttributeNode|" + "removeChild|" + "removeEventListener|" + "replaceChild|" + "reportValidity|" + "requestPointerLock|" + "scrollHeight|" + "scrollIntoView|" + "scrollIntoViewIfNeeded|" + "scrollLeft|" + "scrollWidth|" + "setAttribute|" + "setAttributeNS|" + "setAttributeNode|" + "setAttributeNodeNS|" + "setPointerCapture|" + "shadowRoot|" + "styleMap|" + "tabIndex|" + "tagName|" + "textContent|" + "toString|" + "valueOf|" + "(webkit|ms|moz|o)dropzone|" + "(webkit|moz|ms|o)MatchesSelector|" + "(webkit|moz|ms|o)RequestFullScreen|" + "(webkit|moz|ms|o)RequestFullscreen" + ")(\\s|$)" + } attrs: { name: "type" mandatory: true @@ -114,6 +240,132 @@ tags: { # AMP4EMAIL addition. disallowed_ancestor: "FORM DIV [submitting]" requires_extension: "amp-mustache" + attrs: { + name: "id" + add_value_to_set: TEMPLATE_IDS + # When updating this blacklisted_value_regex, also update elsewhere in this + # file, and in mandatory-id-attr and $GLOBAL_ATTRS in + # validator-main.protoascii, and validator-amp-script.protoascii. + blacklisted_value_regex: "(^|\\s)(" # Values are space separated + "__amp_\\S*|" + "__count__|" + "__defineGetter__|" + "__defineSetter__|" + "__lookupGetter__|" + "__lookupSetter__|" + "__noSuchMethod__|" + "__parent__|" + "__proto__|" + "__AMP_\\S*|" + "\\$p|" + "\\$proxy|" + "acceptCharset|" + "addEventListener|" + "appendChild|" + "assignedSlot|" + "attachShadow|" + "AMP|" + "baseURI|" + "checkValidity|" + "childElementCount|" + "childNodes|" + "classList|" + "className|" + "clientHeight|" + "clientLeft|" + "clientTop|" + "clientWidth|" + "compareDocumentPosition|" + "computedName|" + "computedRole|" + "contentEditable|" + "createShadowRoot|" + "enqueAction|" + "firstChild|" + "firstElementChild|" + "getAnimations|" + "getAttribute|" + "getAttributeNS|" + "getAttributeNode|" + "getAttributeNodeNS|" + "getBoundingClientRect|" + "getClientRects|" + "getDestinationInsertionPoints|" + "getElementsByClassName|" + "getElementsByTagName|" + "getElementsByTagNameNS|" + "getRootNode|" + "hasAttribute|" + "hasAttributeNS|" + "hasAttributes|" + "hasChildNodes|" + "hasPointerCapture|" + "i-amphtml-\\S*|" + "innerHTML|" + "innerText|" + "inputMode|" + "insertAdjacentElement|" + "insertAdjacentHTML|" + "insertAdjacentText|" + "isContentEditable|" + "isDefaultNamespace|" + "isEqualNode|" + "isSameNode|" + "lastChild|" + "lastElementChild|" + "lookupNamespaceURI|" + "namespaceURI|" + "nextElementSibling|" + "nextSibling|" + "nodeName|" + "nodeType|" + "nodeValue|" + "offsetHeight|" + "offsetLeft|" + "offsetParent|" + "offsetTop|" + "offsetWidth|" + "outerHTML|" + "outerText|" + "ownerDocument|" + "parentElement|" + "parentNode|" + "previousElementSibling|" + "previousSibling|" + "querySelector|" + "querySelectorAll|" + "releasePointerCapture|" + "removeAttribute|" + "removeAttributeNS|" + "removeAttributeNode|" + "removeChild|" + "removeEventListener|" + "replaceChild|" + "reportValidity|" + "requestPointerLock|" + "scrollHeight|" + "scrollIntoView|" + "scrollIntoViewIfNeeded|" + "scrollLeft|" + "scrollWidth|" + "setAttribute|" + "setAttributeNS|" + "setAttributeNode|" + "setAttributeNodeNS|" + "setPointerCapture|" + "shadowRoot|" + "styleMap|" + "tabIndex|" + "tagName|" + "textContent|" + "toString|" + "valueOf|" + "(webkit|ms|moz|o)dropzone|" + "(webkit|moz|ms|o)MatchesSelector|" + "(webkit|moz|ms|o)RequestFullScreen|" + "(webkit|moz|ms|o)RequestFullscreen" + ")(\\s|$)" + } attrs: { name: "type" mandatory: true @@ -156,8 +408,9 @@ tags: { attrs: { name: "id" add_value_to_set: TEMPLATE_IDS - # When updating this blacklisted_value_regex, also update below, and in - # mandatory-id-attr and $GLOBAL_ATTRS in validator-main.protoascii. + # When updating this blacklisted_value_regex, also update elsewhere in this + # file, and in mandatory-id-attr and $GLOBAL_ATTRS in + # validator-main.protoascii, and validator-amp-script.protoascii. blacklisted_value_regex: "(^|\\s)(" # Values are space separated "__amp_\\S*|" "__count__|" @@ -308,8 +561,9 @@ tags: { attrs: { name: "id" add_value_to_set: TEMPLATE_IDS - # When updating this blacklisted_value_regex, also update above, and in - # mandatory-id-attr and $GLOBAL_ATTRS in validator-main.protoascii. + # When updating this blacklisted_value_regex, also update elsewhere in this + # file, and in mandatory-id-attr and $GLOBAL_ATTRS in + # validator-main.protoascii, and validator-amp-script.protoascii. blacklisted_value_regex: "(^|\\s)(" # Values are space separated "__amp_\\S*|" "__count__|" diff --git a/extensions/amp-script/validator-amp-script.protoascii b/extensions/amp-script/validator-amp-script.protoascii index 7e7d1211b48d..9725ae2e24ee 100644 --- a/extensions/amp-script/validator-amp-script.protoascii +++ b/extensions/amp-script/validator-amp-script.protoascii @@ -33,6 +33,9 @@ tags: { # (local script) name: "id" add_value_to_set: AMP_SCRIPT_IDS mandatory: true + # When updating this blacklisted_value_regex, also update for + # mandatory-id-attr and $GLOBAL_ATTRS in validator-main.protoascii, and + # validator-amp-mustache.protoascii. blacklisted_value_regex: "(^|\\s)(" # Values are space separated "__amp_\\S*|" "__count__|" diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index 812f9c6ab236..36d5b2648de1 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -5485,7 +5485,8 @@ attr_lists: { name: "id" mandatory: true # When updating this blacklisted_value_regex, also update the entry for - # "id" in $GLOBAL_ATTRS and "id" in "amp-script extension local script". + # "id" in $GLOBAL_ATTRS, and also validator-amp-script.protoascii and + # validator-amp-mustache.protoascii. blacklisted_value_regex: "(^|\\s)(" # Values are space separated "__amp_\\S*|" "__count__|" @@ -6517,7 +6518,8 @@ attr_lists: { attrs: { name: "id" # When updating this blacklisted_value_regex, also update for - # mandatory-id-attr and validator-amp-mustache.protoascii. + # mandatory-id-attr, validator-amp-script.protoascii, and + # validator-amp-mustache.protoascii. blacklisted_value_regex: "(^|\\s)(" # Values are space separated "__amp_\\S*|" "__count__|"