Skip to content

Commit

Permalink
Validator rollup (ampproject#11410)
Browse files Browse the repository at this point in the history
* Provide a more descriptive error message for our most common AMP error.

* Revision bump, amp-list attributes

* Revision bump, amp-sidebar

* new validator rule where a tag can specify that it must be the last child

* AMP Story Validator Rules

* AMP Story Validator Rules

* Revision bump for ampproject#11299

* AMP Story Validator Rules

* Revision bump for ampproject#11333

* AMP Story Validator Rules

* Move STAMP test files to amp-story extension.

* AMP Story Validator Rules Fix
  • Loading branch information
Gregable authored and dmvjs committed Jan 31, 2018
1 parent 13372ec commit 1940d91
Show file tree
Hide file tree
Showing 20 changed files with 640 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FAIL
amp-experiment/0.1/test/validator-amp-experiment.html:47:0 The tag 'amp-experiment' appears more than once in the document. (see https://www.ampproject.org/docs/reference/components/amp-experiment) [MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
amp-experiment/0.1/test/validator-amp-experiment.html:48:4 The tag 'script' is disallowed except in specific forms. [CUSTOM_JAVASCRIPT_DISALLOWED]
amp-experiment/0.1/test/validator-amp-experiment.html:48:4 Only AMP runtime 'script' tags are allowed, and only in the document head. (see https://www.ampproject.org/docs/reference/spec#html-tags) [CUSTOM_JAVASCRIPT_DISALLOWED]
12 changes: 6 additions & 6 deletions extensions/amp-live-list/0.1/test/validator-amp-live-list.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ amp-live-list/0.1/test/validator-amp-live-list.html:64:2 The mandatory reference
amp-live-list/0.1/test/validator-amp-live-list.html:70:2 The reference point 'AMP-LIVE-LIST [update]' for 'amp-live-list' must be unique but a duplicate was encountered. (see https://www.ampproject.org/docs/reference/components/amp-live-list) [AMP_TAG_PROBLEM]
amp-live-list/0.1/test/validator-amp-live-list.html:70:2 The reference point 'AMP-LIVE-LIST [pagination]' for 'amp-live-list' must be unique but a duplicate was encountered. (see https://www.ampproject.org/docs/reference/components/amp-live-list) [AMP_TAG_PROBLEM]
amp-live-list/0.1/test/validator-amp-live-list.html:82:4 The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? (see https://www.ampproject.org/docs/reference/components/amp-img) [DISALLOWED_HTML_WITH_AMP_EQUIVALENT]
amp-live-list/0.1/test/validator-amp-live-list.html:83:4 The tag 'script' is disallowed except in specific forms. [CUSTOM_JAVASCRIPT_DISALLOWED]
amp-live-list/0.1/test/validator-amp-live-list.html:93:6 The tag 'LI', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [GENERIC]
amp-live-list/0.1/test/validator-amp-live-list.html:83:4 Only AMP runtime 'script' tags are allowed, and only in the document head. (see https://www.ampproject.org/docs/reference/spec#html-tags) [CUSTOM_JAVASCRIPT_DISALLOWED]
amp-live-list/0.1/test/validator-amp-live-list.html:93:6 The tag 'li', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [AMP_TAG_PROBLEM]
amp-live-list/0.1/test/validator-amp-live-list.html:93:6 The mandatory attribute 'data-sort-time' is missing in tag 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:95:6 The tag 'LI', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [GENERIC]
amp-live-list/0.1/test/validator-amp-live-list.html:95:6 The tag 'li', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [AMP_TAG_PROBLEM]
amp-live-list/0.1/test/validator-amp-live-list.html:95:6 The mandatory attribute 'id' is missing in tag 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:95:6 The mandatory attribute 'data-sort-time' is missing in tag 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:96:6 The tag 'P', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [GENERIC]
amp-live-list/0.1/test/validator-amp-live-list.html:96:6 The tag 'p', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [AMP_TAG_PROBLEM]
amp-live-list/0.1/test/validator-amp-live-list.html:96:6 The mandatory attribute 'id' is missing in tag 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:96:6 The mandatory attribute 'data-sort-time' is missing in tag 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:105:4 The tag 'amp-live-list' conflicts with reference point 'AMP-LIVE-LIST [items]' because both define reference points. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [AMP_TAG_PROBLEM]
amp-live-list/0.1/test/validator-amp-live-list.html:106:6 The tag 'BUTTON', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [GENERIC]
amp-live-list/0.1/test/validator-amp-live-list.html:106:6 The tag 'button', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [AMP_TAG_PROBLEM]
amp-live-list/0.1/test/validator-amp-live-list.html:106:6 The mandatory attribute 'id' is missing in tag 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:106:6 The mandatory attribute 'data-sort-time' is missing in tag 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:106:6 The attribute 'update' may not appear in tag 'button'. [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:107:6 The tag 'DIV', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [GENERIC]
amp-live-list/0.1/test/validator-amp-live-list.html:107:6 The tag 'div', a child tag of 'AMP-LIVE-LIST [items]', does not satisfy the reference point 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [AMP_TAG_PROBLEM]
amp-live-list/0.1/test/validator-amp-live-list.html:107:6 The mandatory attribute 'id' is missing in tag 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:107:6 The mandatory attribute 'data-sort-time' is missing in tag 'AMP-LIVE-LIST [items] item'. (see https://www.ampproject.org/docs/reference/components/amp-live-list#items) [DISALLOWED_HTML]
amp-live-list/0.1/test/validator-amp-live-list.html:107:6 The attribute 'items' may not appear in tag 'div'. [DISALLOWED_HTML]
43 changes: 43 additions & 0 deletions extensions/amp-story/0.1/test/validator-amp-story-error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!--
Copyright 2017 The AMP HTML Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the license.
-->
<!--
Test Description:
Tests for the amp-story tag.
-->
<!doctype html>
<html >
<head>
<meta charset="utf-8">
<title>STAMP examples</title>
<link rel="canonical" href="http://nonblocking.io/" >
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<amp-story> <!-- error because the 'standalone' attribute isn't set -->
<amp-story-page> <!-- error because the 'id' attribute isn't set -->
<amp-story-grid-layer> <!-- error because one of 'fill', 'horizontal', 'vertical', 'thirds' should be set. -->
<h5>
<h1></h1>
<h2></h2>
</h5>
</amp-story-grid-layer>
</amp-story-page>
</amp-story>
<div></div> <!-- this should create an error for the 'no siblings allowed' rule on <amp-story> -->
</body>
</html>
5 changes: 5 additions & 0 deletions extensions/amp-story/0.1/test/validator-amp-story-error.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FAIL
amp-story/0.1/test/validator-amp-story-error.html:31:2 The mandatory attribute 'standalone' is missing in tag 'amp-story'. (see https://www.ampproject.org/docs/reference/components/amp-story) [AMP_TAG_PROBLEM]
amp-story/0.1/test/validator-amp-story-error.html:32:4 The mandatory attribute 'id' is missing in tag 'amp-story-page'. (see https://www.ampproject.org/docs/reference/components/amp-story) [AMP_TAG_PROBLEM]
amp-story/0.1/test/validator-amp-story-error.html:33:6 The mandatory attribute 'template' is missing in tag 'amp-story-grid-layer'. [AMP_TAG_PROBLEM]
amp-story/0.1/test/validator-amp-story-error.html:31:2 Tag 'amp-story' is not allowed to have any sibling tags ('body' should only have 1 child). [AMP_TAG_PROBLEM]
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
Copyright 2017 The AMP HTML Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the license.
-->
<!--
Test Description:
Tests for the amp-story tag.
-->
<!doctype html>
<html >
<head>
<meta charset="utf-8">
<title>STAMP examples</title>
<link rel="canonical" href="http://nonblocking.io/" >
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-0.1.js"></script>
</head>
<body>
<amp-story standalone related-articles="./related.json" background-audio="path/to/my.mp3">
<amp-story-page id="1" background-audio="path/to/my.mp3" auto-advance-after="any-value">
<amp-story-grid-layer template="horizontal">
<img class="footer-logo" src="img/foot-logo.svg" width="40" height="40" /> <!-- The real error here is that <img/> tag is not allowed. But this is a weird use case where the validator error will comment about reference points. This needs to be fixed in the near future. -->
</amp-story-grid-layer>
</amp-story-page>
</amp-story>
</body>
</html>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FAIL
amp-story/0.1/test/validator-amp-story-reference-point.html:35:8 The tag 'img', a child tag of 'amp-story-grid-layer', does not satisfy the reference point 'AMP-STORY-GRID-LAYER grid-area'. [AMP_TAG_PROBLEM]
amp-story/0.1/test/validator-amp-story-reference-point.html:35:8 The tag 'img' may not appear as a descendant of tag 'amp-story-grid-layer'. (see https://www.ampproject.org/docs/reference/components/amp-story) [AMP_TAG_PROBLEM]
amp-story/0.1/test/validator-amp-story-reference-point.html:35:8 The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? (see https://www.ampproject.org/docs/reference/components/amp-img) [DISALLOWED_HTML_WITH_AMP_EQUIVALENT]
amp-story/0.1/test/validator-amp-story-reference-point.html:35:8 The tag 'img' may not appear as a descendant of tag 'amp-story-grid-layer'. (see https://www.ampproject.org/docs/reference/components/amp-img) [AMP_TAG_PROBLEM]
47 changes: 47 additions & 0 deletions extensions/amp-story/0.1/test/validator-amp-story.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--
Copyright 2017 The AMP HTML Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the license.
-->
<!--
Test Description:
Tests for the amp-story tag.
-->
<!doctype html>
<html >
<head>
<meta charset="utf-8">
<title>STAMP examples</title>
<link rel="canonical" href="http://nonblocking.io/" >
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-0.1.js"></script>
</head>
<body>
<amp-story standalone related-articles="./related.json" background-audio="path/to/my.mp3">
<amp-story-page id="1" background-audio="path/to/my.mp3" auto-advance-after="any-value">
<amp-story-grid-layer template="horizontal">
<h5>
<h1></h1>
<h2></h2>
</h5>
<h3 grid-area="any value"></h3>
</amp-story-grid-layer>
<amp-story-grid-layer template="horizontal">
<h1></h1>
</amp-story-grid-layer>
</amp-story-page>
</amp-story>
</body>
</html>
1 change: 1 addition & 0 deletions extensions/amp-story/0.1/test/validator-amp-story.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PASS

0 comments on commit 1940d91

Please sign in to comment.