From abeb563b55fa69ffcefeda7ea9f46059db8f2c2e Mon Sep 17 00:00:00 2001 From: Amaltas Date: Wed, 20 Feb 2019 12:04:02 -0800 Subject: [PATCH] Validator rollup (#20961) - cl/234811475 Revision bump for #20913 - cl/234805704 Revision bump for #20911 - cl/234655757 allow render_only_if_payment_method_present for amp-payment-google-button - cl/234162273 Update comment regarding id/name attribute lists - cl/234053286 Update tagspecs using attribute `name` to include blacklist - cl/234038899 Update tagspecs using attribute `id` to include blacklist - cl/234023532 Revision bump for #20772 --- .../validator-amp-ad-exit.protoascii | 5 +- .../validator-amp-app-banner.protoascii | 5 +- .../amp-bind/validator-amp-bind.protoascii | 20 +- .../validator-amp-inputmask.protoascii | 12 +- .../validator-amp-live-list.protoascii | 10 +- ...tor-actions-amp-payment-google-button.html | 9 + ...ator-actions-amp-payment-google-button.out | 11 +- ...dator-amp-payment-google-button.protoascii | 7 +- ...amp-payment-google-inline-async.protoascii | 7 +- ...dator-amp-payment-google-inline.protoascii | 2 +- .../validator-amp-recaptcha-input.protoascii | 5 +- .../validator-amp-selector.protoascii | 2 +- .../amp-story/validator-amp-story.protoascii | 10 +- validator/engine/validator_test.js | 13 + validator/validator-main.protoascii | 549 +++++++++++++----- 15 files changed, 465 insertions(+), 202 deletions(-) diff --git a/extensions/amp-ad-exit/validator-amp-ad-exit.protoascii b/extensions/amp-ad-exit/validator-amp-ad-exit.protoascii index 2b9552d595afd..b6276e3073200 100644 --- a/extensions/amp-ad-exit/validator-amp-ad-exit.protoascii +++ b/extensions/amp-ad-exit/validator-amp-ad-exit.protoascii @@ -29,11 +29,8 @@ tags: { # tag_name: "AMP-AD-EXIT" requires_extension: "amp-ad-exit" requires: "amp-ad-exit configuration JSON" - attrs: { - name: "id" - mandatory: true - } attr_lists: "extended-amp-global" + attr_lists: "mandatory-id-attr" child_tags: { mandatory_num_child_tags: 1 child_tag_name_oneof: "SCRIPT" diff --git a/extensions/amp-app-banner/validator-amp-app-banner.protoascii b/extensions/amp-app-banner/validator-amp-app-banner.protoascii index 3c3f4f989798b..419616e6d206e 100644 --- a/extensions/amp-app-banner/validator-amp-app-banner.protoascii +++ b/extensions/amp-app-banner/validator-amp-app-banner.protoascii @@ -34,11 +34,8 @@ tags: { # # validator-main.protoascii and in turn has an "AMP-APP-BANNER" # mandatory_parent. requires: "amp-app-banner button[open-button]" - attrs: { - name: "id" - mandatory: true - } attr_lists: "extended-amp-global" + attr_lists: "mandatory-id-attr" unique: true spec_url: "https://www.ampproject.org/docs/reference/components/amp-app-banner" amp_layout: { diff --git a/extensions/amp-bind/validator-amp-bind.protoascii b/extensions/amp-bind/validator-amp-bind.protoascii index df43778425093..becba8f404f38 100644 --- a/extensions/amp-bind/validator-amp-bind.protoascii +++ b/extensions/amp-bind/validator-amp-bind.protoascii @@ -67,10 +67,6 @@ tags: { # attrs: { name: "credentials" } - attrs: { - name: "id" - mandatory: true - } attrs: { name: "overridable" } @@ -82,6 +78,7 @@ tags: { # } blacklisted_value_regex: "__amp_source_origin" } + attr_lists: "mandatory-id-attr" # attrs: { name: "[src]" } child_tags: { @@ -101,11 +98,8 @@ tags: { # disallowed_ancestor: "AMP-LIST" disallowed_ancestor: "AMP-STATE" disallowed_ancestor: "TEMPLATE" + attr_lists: "mandatory-id-attr" attr_lists: "optional-src-amp4email" - attrs: { - name: "id" - mandatory: true - } child_tags: { first_child_tag_name_oneof: "SCRIPT" } @@ -124,10 +118,6 @@ tags: { # name: "cross-origin" value: "amp-viewer-auth-token-via-post" } - attrs: { - name: "id" - mandatory: true - } attrs: { name: "overridable" } @@ -139,6 +129,7 @@ tags: { # } blacklisted_value_regex: "__amp_source_origin" } + attr_lists: "mandatory-id-attr" # attrs: { name: "[src]" } child_tags: { @@ -158,9 +149,6 @@ tags: { # name: "expression" mandatory: true } - attrs: { - name: "id" - mandatory: true - } + attr_lists: "mandatory-id-attr" spec_url: "https://www.ampproject.org/docs/reference/components/amp-bind" } diff --git a/extensions/amp-inputmask/validator-amp-inputmask.protoascii b/extensions/amp-inputmask/validator-amp-inputmask.protoascii index a1b30a5be636c..225a4cef1b8a5 100644 --- a/extensions/amp-inputmask/validator-amp-inputmask.protoascii +++ b/extensions/amp-inputmask/validator-amp-inputmask.protoascii @@ -47,7 +47,7 @@ tags: { } attr_lists: "amp-inputmask-common-attr" attr_lists: "input-common-attr" - attr_lists: "input-name-attr" + attr_lists: "name-attr" attrs: { name: "[type]" } spec_url: "https://www.ampproject.org/docs/reference/components/amp-inputmask" } @@ -65,7 +65,7 @@ tags: { } attr_lists: "amp-inputmask-common-attr" attr_lists: "input-common-attr" - attr_lists: "input-name-attr" + attr_lists: "name-attr" spec_url: "https://www.ampproject.org/docs/reference/components/amp-inputmask" } @@ -82,7 +82,7 @@ tags: { } attr_lists: "amp-inputmask-common-attr" attr_lists: "input-common-attr" - attr_lists: "input-name-attr" + attr_lists: "name-attr" spec_url: "https://www.ampproject.org/docs/reference/components/amp-inputmask" } @@ -99,7 +99,7 @@ tags: { } attr_lists: "amp-inputmask-common-attr" attr_lists: "input-common-attr" - attr_lists: "input-name-attr" + attr_lists: "name-attr" spec_url: "https://www.ampproject.org/docs/reference/components/amp-inputmask" } @@ -116,7 +116,7 @@ tags: { } attr_lists: "amp-inputmask-common-attr" attr_lists: "input-common-attr" - attr_lists: "input-name-attr" + attr_lists: "name-attr" spec_url: "https://www.ampproject.org/docs/reference/components/amp-inputmask" } @@ -133,7 +133,7 @@ tags: { } attr_lists: "amp-inputmask-common-attr" attr_lists: "input-common-attr" - attr_lists: "input-name-attr" + attr_lists: "name-attr" spec_url: "https://www.ampproject.org/docs/reference/components/amp-inputmask" } diff --git a/extensions/amp-live-list/validator-amp-live-list.protoascii b/extensions/amp-live-list/validator-amp-live-list.protoascii index 7db714e1df005..30e4951cf4e55 100644 --- a/extensions/amp-live-list/validator-amp-live-list.protoascii +++ b/extensions/amp-live-list/validator-amp-live-list.protoascii @@ -45,14 +45,11 @@ tags: { # name: "disabled" value: "" } - attrs: { - name: "id" - mandatory: true - } attrs: { name: "sort" value: "ascending" } + attr_lists: "mandatory-id-attr" reference_points: { tag_spec_name: "AMP-LIVE-LIST [update]" mandatory: true @@ -119,9 +116,6 @@ tags: { } attrs: { name: "data-tombstone" } attrs: { name: "data-update-time" } - attrs: { - name: "id" - mandatory: true - } + attr_lists: "mandatory-id-attr" spec_url: "https://www.ampproject.org/docs/reference/components/amp-live-list#items" } diff --git a/extensions/amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.html b/extensions/amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.html index d935d696a6a64..483722bf831fe 100644 --- a/extensions/amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.html +++ b/extensions/amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.html @@ -79,6 +79,15 @@ } + + + + diff --git a/extensions/amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.out b/extensions/amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.out index eb915711b21f9..31ab9aba9bc26 100644 --- a/extensions/amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.out +++ b/extensions/amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.out @@ -80,9 +80,18 @@ FAIL | } | | +| +| +| +| | | >> ^~~~~~~~~ -amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.html:83:2 Tag 'amp-payment-google-button' must have a minimum of 1 child tags - saw 0 child tags. (see https://www.ampproject.org/docs/reference/components/amp-payment-google-button) [GENERIC] +amp-payment-google-button/0.1/test/validator-actions-amp-payment-google-button.html:92:2 Tag 'amp-payment-google-button' must have a minimum of 1 child tags - saw 0 child tags. (see https://www.ampproject.org/docs/reference/components/amp-payment-google-button) [GENERIC] | | diff --git a/extensions/amp-payment-google-button/validator-amp-payment-google-button.protoascii b/extensions/amp-payment-google-button/validator-amp-payment-google-button.protoascii index cb54efbfe49d3..f089d98d1d564 100644 --- a/extensions/amp-payment-google-button/validator-amp-payment-google-button.protoascii +++ b/extensions/amp-payment-google-button/validator-amp-payment-google-button.protoascii @@ -29,7 +29,6 @@ tags: { # (json) spec_name: "amp-payment-google-button extension .json script" requires_extension: "amp-payment-google-button" mandatory_parent: "AMP-PAYMENT-GOOGLE-BUTTON" - attrs: { name: "name" } attrs: { disabled_by: "transformed" name: "nonce" @@ -40,6 +39,7 @@ tags: { # (json) value_casei: "application/json" dispatch_key: NAME_VALUE_PARENT_DISPATCH } + attr_lists: "name-attr" cdata: { blacklisted_cdata_regex: { regex: "