diff --git a/extensions/amp-ad/0.1/validator-amp-ad.protoascii b/extensions/amp-ad/0.1/validator-amp-ad.protoascii index af69ce35c3aa..687a7efc6e62 100644 --- a/extensions/amp-ad/0.1/validator-amp-ad.protoascii +++ b/extensions/amp-ad/0.1/validator-amp-ad.protoascii @@ -73,6 +73,7 @@ tags: { # # many pages don't have it, so it ends up late loaded and we warn, instead # of making this a validation error. also_requires_tag_warning: "amp-ad extension .js script" + disallowed_ancestor: "AMP-APP-BANNER" disallowed_ancestor: "AMP-SIDEBAR" attrs: { name: "alt" } attrs: { name: "json" } diff --git a/extensions/amp-imgur/0.1/test/validator-amp-imgur.html b/extensions/amp-imgur/0.1/test/validator-amp-imgur.html new file mode 100644 index 000000000000..f8ea9cd87549 --- /dev/null +++ b/extensions/amp-imgur/0.1/test/validator-amp-imgur.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/extensions/amp-imgur/0.1/test/validator-amp-imgur.out b/extensions/amp-imgur/0.1/test/validator-amp-imgur.out new file mode 100644 index 000000000000..eef0c36c4f2b --- /dev/null +++ b/extensions/amp-imgur/0.1/test/validator-amp-imgur.out @@ -0,0 +1,2 @@ +FAIL +amp-imgur/0.1/test/validator-amp-imgur.html:34:2 The mandatory attribute 'data-imgur-id' is missing in tag 'amp-imgur'. (see https://www.ampproject.org/docs/reference/components/amp-imgur) [AMP_TAG_PROBLEM] diff --git a/validator/engine/validator.js b/validator/engine/validator.js index e840ef7030cf..7a1b05ba7b70 100644 --- a/validator/engine/validator.js +++ b/validator/engine/validator.js @@ -1712,8 +1712,8 @@ class Context { this.tagStack_ = new TagStack(); /** - * Maps from the tagspec id to the tagspec id. - * @type {!Array} + * Set of tagSpec ids that have been validated. + * @type {!Array} * @private */ this.tagspecsValidated_ = []; @@ -1838,13 +1838,16 @@ class Context { recordTagspecValidated(tagSpecId) { const duplicate = this.tagspecsValidated_.hasOwnProperty(tagSpecId); if (!duplicate) { - this.tagspecsValidated_[tagSpecId] = 0; + this.tagspecsValidated_[tagSpecId] = true; } return !duplicate; } /** - * @return {!Array} + * Returns the tag spec ids that have been validated. The return object + * should be treated as a set (the object keys), and the value should be + * ignored. + * @return {!Array} */ getTagspecsValidated() { return this.tagspecsValidated_; diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index ecaea292fda0..ce7544a1fda4 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -25,7 +25,7 @@ min_validator_revision_required: 232 # newer versions of the spec file. This is currently a Google internal # mechanism, validator.js does not use this facility. However, any # change to this file (validator-main.js) requires updating this revision id. -spec_file_revision: 425 +spec_file_revision: 427 styles_spec_url: "https://www.ampproject.org/docs/guides/author-develop/responsive/style_pages"