Skip to content

Commit

Permalink
Add descriptive names to all validator reference points. (#37453)
Browse files Browse the repository at this point in the history
Co-authored-by: Boxiao Cao <9083193+antiphoton@users.noreply.github.com>
  • Loading branch information
Greg Grothaus and antiphoton committed Jan 21, 2022
1 parent c04d488 commit e5b4316
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
Expand Up @@ -162,6 +162,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-BASE-CAROUSEL lightbox [lightbox-exclude]"
descriptive_name: "amp-base-carousel [lightbox-exclude] child"
attrs: {
name: "lightbox-exclude"
mandatory: true
Expand All @@ -171,6 +172,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-BASE-CAROUSEL lightbox [child]"
descriptive_name: "amp-base-carousel [lightbox-thumbnail-id] child"
attrs: {
name: "lightbox-thumbnail-id"
value_regex_casei: "^[a-z][a-z\\d_-]*"
Expand Down
2 changes: 2 additions & 0 deletions extensions/amp-carousel/validator-amp-carousel.protoascii
Expand Up @@ -119,6 +119,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-CAROUSEL lightbox [lightbox-exclude]"
descriptive_name: "amp-carousel lightbox [lightbox-exclude] child"
attrs: {
name: "lightbox-exclude"
mandatory: true
Expand All @@ -128,6 +129,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-CAROUSEL lightbox [child]"
descriptive_name: "amp-carousel lightbox [lightbox-thumbnail-id] child"
attrs: {
name: "lightbox-thumbnail-id"
value_regex_casei: "^[a-z][a-z\\d_-]*"
Expand Down
10 changes: 5 additions & 5 deletions extensions/amp-live-list/0.1/test/validator-amp-live-list.out
Expand Up @@ -94,22 +94,22 @@ amp-live-list/0.1/test/validator-amp-live-list.html:68:4 Custom JavaScript is no
| <ul items>
| <li id="1" data-update-time="42">1</li> <!-- data-sort-time missing -->
>> ^~~~~~~~~
amp-live-list/0.1/test/validator-amp-live-list.html:78:6 The mandatory attribute 'data-sort-time' is missing in tag 'amp-live-list [items] item'. (see https://amp.dev/documentation/components/amp-live-list/#items)
amp-live-list/0.1/test/validator-amp-live-list.html:78:6 The mandatory attribute 'data-sort-time' is missing in tag 'amp-live-list [data-sort-time] child'. (see https://amp.dev/documentation/components/amp-live-list/#items)
>> ^~~~~~~~~
amp-live-list/0.1/test/validator-amp-live-list.html:78: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://amp.dev/documentation/components/amp-live-list/#items)
| <li id="2" data-sort-time="43" data-update-time="44">2</li>
| <li data-update-time="44">3</li> <!-- id and data-sort-time missing -->
>> ^~~~~~~~~
amp-live-list/0.1/test/validator-amp-live-list.html:80:6 The mandatory attribute 'data-sort-time' is missing in tag 'amp-live-list [items] item'. (see https://amp.dev/documentation/components/amp-live-list/#items)
amp-live-list/0.1/test/validator-amp-live-list.html:80:6 The mandatory attribute 'data-sort-time' is missing in tag 'amp-live-list [data-sort-time] child'. (see https://amp.dev/documentation/components/amp-live-list/#items)
>> ^~~~~~~~~
amp-live-list/0.1/test/validator-amp-live-list.html:80:6 The mandatory attribute 'id' is missing in tag 'amp-live-list [items] item'. (see https://amp.dev/documentation/components/amp-live-list/#items)
amp-live-list/0.1/test/validator-amp-live-list.html:80:6 The mandatory attribute 'id' is missing in tag 'amp-live-list [data-sort-time] child'. (see https://amp.dev/documentation/components/amp-live-list/#items)
>> ^~~~~~~~~
amp-live-list/0.1/test/validator-amp-live-list.html:80: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://amp.dev/documentation/components/amp-live-list/#items)
| <p>junk</p> <!-- id, data-sort-time missing -->
>> ^~~~~~~~~
amp-live-list/0.1/test/validator-amp-live-list.html:81:6 The mandatory attribute 'data-sort-time' is missing in tag 'amp-live-list [items] item'. (see https://amp.dev/documentation/components/amp-live-list/#items)
amp-live-list/0.1/test/validator-amp-live-list.html:81:6 The mandatory attribute 'data-sort-time' is missing in tag 'amp-live-list [data-sort-time] child'. (see https://amp.dev/documentation/components/amp-live-list/#items)
>> ^~~~~~~~~
amp-live-list/0.1/test/validator-amp-live-list.html:81:6 The mandatory attribute 'id' is missing in tag 'amp-live-list [items] item'. (see https://amp.dev/documentation/components/amp-live-list/#items)
amp-live-list/0.1/test/validator-amp-live-list.html:81:6 The mandatory attribute 'id' is missing in tag 'amp-live-list [data-sort-time] child'. (see https://amp.dev/documentation/components/amp-live-list/#items)
>> ^~~~~~~~~
amp-live-list/0.1/test/validator-amp-live-list.html:81: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://amp.dev/documentation/components/amp-live-list/#items)
| </ul>
Expand Down
8 changes: 4 additions & 4 deletions extensions/amp-live-list/validator-amp-live-list.protoascii
Expand Up @@ -56,7 +56,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name : "AMP-LIVE-LIST [update]"
descriptive_name : "amp-live-list [update]"
descriptive_name : "amp-live-list [update] child"
attrs: {
name: "update"
mandatory: true
Expand All @@ -67,7 +67,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-LIVE-LIST [items]"
descriptive_name : "amp-live-list [items]"
descriptive_name : "amp-live-list [items] child"
attrs: {
name: "items"
mandatory: true
Expand All @@ -81,7 +81,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name : "AMP-LIVE-LIST [pagination]"
descriptive_name : "amp-live-list [pagination]"
descriptive_name : "amp-live-list [pagination] child"
attrs: {
name: "pagination"
mandatory: true
Expand All @@ -92,7 +92,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name : "AMP-LIVE-LIST [items] item"
descriptive_name : "amp-live-list [items] item"
descriptive_name : "amp-live-list [data-sort-time] child"
attrs: {
name: "data-sort-time"
mandatory: true
Expand Down
3 changes: 3 additions & 0 deletions extensions/amp-next-page/validator-amp-next-page.protoascii
Expand Up @@ -27,6 +27,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-NEXT-PAGE > [separator]"
descriptive_name : "amp-next-page [separator] child"
mandatory_parent: "AMP-NEXT-PAGE"
attrs: {
name: "separator"
Expand All @@ -37,6 +38,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-NEXT-PAGE > [recommendation-box]"
descriptive_name : "amp-next-page [recommendation-box] child"
mandatory_parent: "AMP-NEXT-PAGE"
attrs: {
name: "recommendation-box"
Expand All @@ -47,6 +49,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-NEXT-PAGE > [footer]"
descriptive_name : "amp-next-page [footer] child"
mandatory_parent: "AMP-NEXT-PAGE"
attrs: {
name: "footer"
Expand Down
4 changes: 4 additions & 0 deletions extensions/amp-selector/validator-amp-selector.protoascii
Expand Up @@ -99,6 +99,7 @@ tags: {
html_format: AMP4EMAIL
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-SELECTOR option"
descriptive_name : "amp-selector [option] descendant"
attrs: {
name: "disabled"
value: ""
Expand All @@ -119,6 +120,9 @@ tags: {
html_format: AMP4EMAIL
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-SELECTOR child"
descriptive_name : "amp-selector child"
# This is used recursively so that the "AMP-SELECTOR option" can be any
# depth below the main <amp-sepector>:
reference_points: {
tag_spec_name: "AMP-SELECTOR option"
}
Expand Down
3 changes: 3 additions & 0 deletions extensions/amp-story/validator-amp-story.protoascii
Expand Up @@ -182,6 +182,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-STORY-GRID-LAYER default"
descriptive_name: "amp-story-grid-layer child"
attrs: {
name: "align-content"
value: "center"
Expand Down Expand Up @@ -299,6 +300,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-STORY-GRID-LAYER animate-in"
descriptive_name: "amp-story-grid-layer [animate-in] child"
# Attribute grid-area is not allowed in this tag. That's what makes this
# reference point different than the grid-area reference point.
attrs: {
Expand Down Expand Up @@ -520,6 +522,7 @@ tags: {
html_format: AMP
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-STORY-CTA-LAYER animate-in"
descriptive_name: "amp-story-cta-layer [animate-in] child"
attrs: {
name: "animate-in"
value: "drop"
Expand Down

0 comments on commit e5b4316

Please sign in to comment.