Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AMP spec to 1d3757a07f #6303

Merged
merged 22 commits into from
Jun 10, 2021
Merged

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented May 21, 2021

Previously #5998.

Changelog

  • Escape regular expressions for / delimiters.
  • Add recognition of Bento components:
    • amp-accordion
    • amp-base-carousel, with orientation attribute replacing horizontal.
    • amp-date-countdown, with count-up attribute replacing data-count-up.
    • amp-date-display
    • amp-fit-text
    • amp-facebook-like
    • amp-inline-gallery, with aspect-ratio attribute replacing aspect-ratio-width.
    • amp-instagram
    • amp-lightbox, with animation attribute replacing animate-in, and scrollable being removed.
    • amp-selector
    • amp-social-share
    • amp-stream-gallery
    • amp-timeago
    • amp-twitter
    • amp-video-iframe
    • amp-video
    • amp-vimeo
    • amp-youtube
  • Add component:
    • Add amp-iframely
    • Add amp-render
    • Add amp-stream-gallery
    • Add amp-cache-url (extension script)
  • Allow SVG elements in amp-nested-menu.
  • Update attributes:
    • amp-nexxtv-player: Remove data-origin while adding values for data-streamtype and a new data-exit-mode attribute.
    • amp-brid-player: Add data-carousel attribute.
    • amp-script: Add sandboxed attribute
    • Add form attribute to all form input elements.
  • Stories:
    • Allow amp-date-display.
    • Add amp-story-page-outlink.
    • Add amp-story-page-attachment/amp-story-page-outlink attributes: cta-accent-color, cta-accent-element, cta-image, and cta-text.
    • Add amp-story-page-attachment attributes: title, custom value for theme.
    • amp-video: Allow cache=google attribute.

Details

(
    PREV_VERSION=1bbd5505;
    THIS_VERSION=1d3757a07f;
    git checkout $THIS_VERSION;
    git diff $PREV_VERSION...$THIS_VERSION -w -- $( git ls-files | grep '.protoascii' );
    git checkout - > /dev/null
)
1bbd5505...1d3757a07f
diff --git a/extensions/amp-instagram/validator-amp-instagram.protoascii b/build-system/tasks/make-extension/template/shared/extensions/amp-__component_name_hyphenated__/__validator__-amp-__component_name_hyphenated__.protoascii
similarity index 64%
copy from extensions/amp-instagram/validator-amp-instagram.protoascii
copy to build-system/tasks/make-extension/template/shared/extensions/amp-__component_name_hyphenated__/__validator__-amp-__component_name_hyphenated__.protoascii
index 4a462662c..e52970efc 100644
--- a/extensions/amp-instagram/validator-amp-instagram.protoascii
+++ b/build-system/tasks/make-extension/template/shared/extensions/amp-__component_name_hyphenated__/__validator__-amp-__component_name_hyphenated__.protoascii
@@ -1,5 +1,5 @@
 #
-# Copyright 2016 The AMP HTML Authors. All Rights Reserved.
+# Copyright __current_year__ 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.
@@ -14,33 +14,29 @@
 # limitations under the license.
 #
 
-tags: {  # amp-instagram
+tags: {  # amp-__component_name_hyphenated__
   html_format: AMP
   tag_name: "SCRIPT"
   extension_spec: {
-    name: "amp-instagram"
-    version: "0.1"
+    name: "amp-__component_name_hyphenated__"
+    version: "__component_version__"
     version: "latest"
-    requires_usage: EXEMPTED
-    deprecated_allow_duplicates: true
   }
   attr_lists: "common-extension-attrs"
 }
-tags: {  # <amp-instagram>
+tags: {  # <amp-__component_name_hyphenated__>
   html_format: AMP
-  tag_name: "AMP-INSTAGRAM"
-  requires_extension: "amp-instagram"
-  attrs: { name: "alt" }
-  attrs: {
-    name: "data-shortcode"
-    mandatory: true
-  }
+  tag_name: "__component_name_hyphenated_capitalized__"
+  requires_extension: "amp-__component_name_hyphenated__"
   attr_lists: "extended-amp-global"
+  spec_url: "https://amp.dev/documentation/components/amp-__component_name_hyphenated__/"
   amp_layout: {
+    supported_layouts: CONTAINER
     supported_layouts: FILL
     supported_layouts: FIXED
     supported_layouts: FIXED_HEIGHT
     supported_layouts: FLEX_ITEM
+    supported_layouts: INTRINSIC
     supported_layouts: NODISPLAY
     supported_layouts: RESPONSIVE
   }
diff --git a/extensions/amp-accordion/validator-amp-accordion.protoascii b/extensions/amp-accordion/validator-amp-accordion.protoascii
index 6cc558009..98b5b3e62 100644
--- a/extensions/amp-accordion/validator-amp-accordion.protoascii
+++ b/extensions/amp-accordion/validator-amp-accordion.protoascii
@@ -13,12 +13,28 @@
 # See the License for the specific language governing permissions and
 # limitations under the license.
 #
-tags: {  # amp-accordion
+
+tags: {  # amp-accordion for websites
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-accordion 1.0"
+  excludes: "amp-accordion 0.1"
+  extension_spec: {
+    name: "amp-accordion"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+tags: {  # amp-accordion for ads
   html_format: AMP
   html_format: AMP4ADS
   tag_name: "SCRIPT"
+  satisfies: "amp-accordion 0.1"
+  excludes: "amp-accordion 1.0"
   extension_spec: {
     name: "amp-accordion"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
     requires_usage: EXEMPTED
@@ -78,9 +94,16 @@ tags: {  # <amp-accordion> > <section>
   }
   attrs: { name: "expanded" value: "" }
   # amp-bind
-  attrs: {
+  attrs: { # binding to this attribute in 1.0 performs no action (see #33493)
     name: "[data-expand]"
   }
+  # amp-bind
+  attrs: {
+    # this attribute is used in 1.0 only
+    # this is disabled in AMP4EMAIL which only uses 0.1
+    disabled_by: "amp4email"
+    name: "[expanded]"
+  }
   child_tags: {
     mandatory_num_child_tags: 2
     first_child_tag_name_oneof: "H1"
diff --git a/extensions/amp-ad/validator-amp-ad.protoascii b/extensions/amp-ad/validator-amp-ad.protoascii
index 3bf4989c4..3c6f41fd0 100644
--- a/extensions/amp-ad/validator-amp-ad.protoascii
+++ b/extensions/amp-ad/validator-amp-ad.protoascii
@@ -104,7 +104,7 @@ tags: {  # <amp-ad type="custom">
     dispatch_key: NAME_VALUE_DISPATCH
   }
   attr_lists: "extended-amp-global"
-  spec_url: "https://github.com/ampproject/amphtml/blob/master/ads/custom.md"
+  spec_url: "https://github.com/ampproject/amphtml/blob/main/ads/custom.md"
   amp_layout: {
     supported_layouts: FILL
     supported_layouts: FIXED
diff --git a/extensions/amp-base-carousel/validator-amp-base-carousel.protoascii b/extensions/amp-base-carousel/validator-amp-base-carousel.protoascii
index cd6980929..6c80f07f7 100644
--- a/extensions/amp-base-carousel/validator-amp-base-carousel.protoascii
+++ b/extensions/amp-base-carousel/validator-amp-base-carousel.protoascii
@@ -20,6 +20,7 @@ tags: {  # amp-base-carousel
   extension_spec: {
     name: "amp-base-carousel"
     version: "0.1"
+    version: "1.0"
     version: "latest"
   }
   attr_lists: "common-extension-attrs"
@@ -62,7 +63,7 @@ attr_lists: {
     value_regex: "([^,]+\\s+(always|auto|never),\\s*)*(always|auto|never)"
   }
   attrs: {
-    name: "horizontal"
+    name: "horizontal" # 0.1 only
     # Media query / boolean pairs
     value_regex: "([^,]+\\s+(true|false),\\s*)*(true|false)"
   }
@@ -76,6 +77,11 @@ attr_lists: {
     # Media query / boolean pairs
     value_regex: "([^,]+\\s+(true|false),\\s*)*(true|false)"
   }
+  attrs: {
+    name: "orientation" # 1.0 only
+    # Media query / boolean pairs
+    value_regex: "([^,]+\\s+(horizontal|vertical),\\s*)*(horizontal|vertical)"
+  }
   attrs: {
     name: "slide"
     # Media query / positive integer pairs
@@ -108,9 +114,10 @@ attr_lists: {
   attrs: { name: "[auto-advance-count]" }
   attrs: { name: "[auto-advance-interval]" }
   attrs: { name: "[auto-advance-loops]" }
-  attrs: { name: "[horizontal]" }
+  attrs: { name: "[horizontal]" } # 0.1 only
   attrs: { name: "[loop]" }
   attrs: { name: "[mixed-length]" }
+  attrs: { name: "[orientation]" } # 1.0 only
   attrs: { name: "[slide]" }
   attrs: { name: "[snap]" }
   attrs: { name: "[snap-align]" }
diff --git a/extensions/amp-brid-player/validator-amp-brid-player.protoascii b/extensions/amp-brid-player/validator-amp-brid-player.protoascii
index 58a1b1c26..a569c3ca7 100644
--- a/extensions/amp-brid-player/validator-amp-brid-player.protoascii
+++ b/extensions/amp-brid-player/validator-amp-brid-player.protoascii
@@ -37,7 +37,7 @@ tags: {  # <amp-brid-player>
   }
   attrs: {
     name: "data-outstream"
-    mandatory_oneof: "['data-outstream', 'data-playlist', 'data-video']"
+    mandatory_oneof: "['data-carousel', 'data-outstream', 'data-playlist', 'data-video']"
     value_regex: "[0-9]+"
   }
   attrs: {
@@ -52,12 +52,17 @@ tags: {  # <amp-brid-player>
   }
   attrs: {
     name: "data-playlist"
-    mandatory_oneof: "['data-outstream', 'data-playlist', 'data-video']"
+    mandatory_oneof: "['data-carousel', 'data-outstream', 'data-playlist', 'data-video']"
     value_regex: ".+"
   }
   attrs: {
     name: "data-video"
-    mandatory_oneof: "['data-outstream', 'data-playlist', 'data-video']"
+    mandatory_oneof: "['data-carousel', 'data-outstream', 'data-playlist', 'data-video']"
+    value_regex: "[0-9]+"
+  }
+  attrs: {
+    name: "data-carousel"
+    mandatory_oneof: "['data-carousel', 'data-outstream', 'data-playlist', 'data-video']"
     value_regex: "[0-9]+"
   }
   attrs: {
diff --git a/extensions/amp-recaptcha-input/validator-amp-recaptcha-input.protoascii b/extensions/amp-cache-url/validator-amp-cache-url.protoascii
similarity index 54%
copy from extensions/amp-recaptcha-input/validator-amp-recaptcha-input.protoascii
copy to extensions/amp-cache-url/validator-amp-cache-url.protoascii
index 20de8b4c3..2ac897267 100644
--- a/extensions/amp-recaptcha-input/validator-amp-recaptcha-input.protoascii
+++ b/extensions/amp-cache-url/validator-amp-cache-url.protoascii
@@ -1,5 +1,5 @@
 #
-# Copyright 2018 The AMP HTML Authors. All Rights Reserved.
+# Copyright 2021 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.
@@ -13,33 +13,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the license.
 #
-tags: {  # amp-recaptcha-input
+
+tags: {  # amp-cache-url
   html_format: AMP
   tag_name: "SCRIPT"
   extension_spec: {
-    name: "amp-recaptcha-input"
+    name: "amp-cache-url"
     version: "0.1"
-    version: "latest"
   }
   attr_lists: "common-extension-attrs"
 }
-tags: {  # <amp-form> <amp-recaptcha-input>
-  html_format: AMP
-  tag_name: "AMP-RECAPTCHA-INPUT"
-  mandatory_ancestor: "FORM"
-  requires_extension: "amp-form"
-  requires_extension: "amp-recaptcha-input"
-  attrs: {
-    name: "data-sitekey"
-    mandatory: true
-  }
-  attrs: {
-    name: "data-action"
-    mandatory: true
-  }
-  attr_lists: "mandatory-name-attr"
-  amp_layout: {
-    supported_layouts: NODISPLAY
-  }
-}
-
diff --git a/extensions/amp-date-countdown/validator-amp-date-countdown.protoascii b/extensions/amp-date-countdown/validator-amp-date-countdown.protoascii
index fd0486f27..c0ab10a19 100644
--- a/extensions/amp-date-countdown/validator-amp-date-countdown.protoascii
+++ b/extensions/amp-date-countdown/validator-amp-date-countdown.protoascii
@@ -20,11 +20,11 @@ tags: {  # amp-date-countdown
   extension_spec: {
     name: "amp-date-countdown"
     version: "0.1"
+    version: "1.0"
     version: "latest"
   }
   attr_lists: "common-extension-attrs"
 }
-
 tags: {  # <amp-date-countdown>
   html_format: AMP
   tag_name: "AMP-DATE-COUNTDOWN"
@@ -36,7 +36,11 @@ tags: {  # <amp-date-countdown>
     value_casei: "minutes"
     value_casei: "seconds"
   }
-  attrs {
+  attrs: {  # attribute is not used in version 0.1 of the component (see #33480)
+    name: "count-up"
+    value: ""
+  }
+  attrs: {  # attribute is not used in version 1.0 of the component (see #33480)
     name: "data-count-up"
     value: ""
   }
diff --git a/extensions/amp-date-display/validator-amp-date-display.protoascii b/extensions/amp-date-display/validator-amp-date-display.protoascii
index 94db81ff2..c4f62ee96 100644
--- a/extensions/amp-date-display/validator-amp-date-display.protoascii
+++ b/extensions/amp-date-display/validator-amp-date-display.protoascii
@@ -20,6 +20,7 @@ tags: {  # amp-date-display
   extension_spec: {
     name: "amp-date-display"
     version: "0.1"
+    version: "1.0"
     version: "latest"
   }
   attr_lists: "common-extension-attrs"
diff --git a/extensions/amp-fit-text/validator-amp-fit-text.protoascii b/extensions/amp-fit-text/validator-amp-fit-text.protoascii
index f4b0f1219..afc0ff490 100644
--- a/extensions/amp-fit-text/validator-amp-fit-text.protoascii
+++ b/extensions/amp-fit-text/validator-amp-fit-text.protoascii
@@ -14,12 +14,27 @@
 # limitations under the license.
 #
 
-tags: {  # amp-fit-text
+tags: {  # amp-fit-text 1.0
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-fit-text 1.0"
+  excludes: "amp-fit-text 0.1"
+  extension_spec: {
+    name: "amp-fit-text"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+tags: {  # amp-fit-text 0.1 and latest
   html_format: AMP
   html_format: AMP4ADS
   tag_name: "SCRIPT"
+  satisfies: "amp-fit-text 0.1"
+  excludes: "amp-fit-text 1.0"
   extension_spec: {
     name: "amp-fit-text"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
     requires_usage: EXEMPTED
@@ -34,6 +49,7 @@ tags: {  # amp-fit-text (AMP4EMAIL)
   extension_spec: {
     name: "amp-fit-text"
     # AMP4EMAIL doesn't allow version: "latest".
+    version_name: "v0.1"
     version: "0.1"
     requires_usage: EXEMPTED
     deprecated_allow_duplicates: true
diff --git a/extensions/amp-google-assistant-assistjs/validator-amp-google-assistant-assistjs.protoascii b/extensions/amp-google-assistant-assistjs/validator-amp-google-assistant-assistjs.protoascii
index f4ff4ce04..e87a6f52a 100644
--- a/extensions/amp-google-assistant-assistjs/validator-amp-google-assistant-assistjs.protoascii
+++ b/extensions/amp-google-assistant-assistjs/validator-amp-google-assistant-assistjs.protoascii
@@ -59,4 +59,3 @@ tags: {  # <amp-google-assistant-inline-suggestion-bar>
     supported_layouts: RESPONSIVE
   }
 }
-
diff --git a/extensions/amp-iframely/validator-amp-iframely.protoascii b/extensions/amp-iframely/validator-amp-iframely.protoascii
new file mode 100644
index 000000000..1917a18a9
--- /dev/null
+++ b/extensions/amp-iframely/validator-amp-iframely.protoascii
@@ -0,0 +1,68 @@
+#
+# Copyright 2021 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.
+#
+
+tags: {  # amp-iframely
+  html_format: AMP
+  tag_name: "SCRIPT"
+  extension_spec: {
+    name: "amp-iframely"
+    version: "0.1"
+    version: "latest"
+  }
+  attr_lists: "common-extension-attrs"
+}
+tags: {  # <amp-iframely>
+  html_format: AMP
+  tag_name: "AMP-IFRAMELY"
+  requires_extension: "amp-iframely"
+  # either data-id
+  attrs: {  # iframely generated ID of a widget
+    name: "data-id"
+    mandatory_oneof: "['data-id', 'data-url']"
+  }
+  attrs: { # iframe url to build widget from
+    name: "data-url"
+    mandatory_oneof: "['data-id', 'data-url']"
+    trigger: {
+      also_requires_attr: "data-key"
+    }
+  }
+  attrs: { name: "data-key" } # iframely key hash
+
+  # optional attributes
+  attrs: { name: "data-img" value: "" }
+  attrs: {
+    name: "data-border"
+    value_regex: "(\\d+)"
+  }
+  attrs: {
+    name: "data-domain"
+    value_regex: "^((?:[^\\.\\/]+\\.)?iframe\\.ly|if\\-cdn\\.com|iframely\\.net|oembed\\.vice\\.com|iframe\\.nbcnews\\.com)$"
+  }
+  attrs: { name: "resizable" value: "" }
+  # data-* attributes are converted into options
+  # for building iframely widget from url
+  attr_lists: "extended-amp-global"
+  spec_url: "https://amp.dev/documentation/components/amp-iframely"
+  amp_layout: {
+    supported_layouts: FILL
+    supported_layouts: FIXED
+    supported_layouts: FIXED_HEIGHT
+    supported_layouts: FLEX_ITEM
+    supported_layouts: RESPONSIVE
+    supported_layouts: INTRINSIC
+  }
+}
diff --git a/extensions/amp-image-lightbox/validator-amp-image-lightbox.protoascii b/extensions/amp-image-lightbox/validator-amp-image-lightbox.protoascii
index 3befadb76..62c0e8a89 100644
--- a/extensions/amp-image-lightbox/validator-amp-image-lightbox.protoascii
+++ b/extensions/amp-image-lightbox/validator-amp-image-lightbox.protoascii
@@ -50,4 +50,3 @@ tags: {  # <amp-image-lightbox>
     supported_layouts: NODISPLAY
   }
 }
-
diff --git a/extensions/amp-inline-gallery/validator-amp-inline-gallery.protoascii b/extensions/amp-inline-gallery/validator-amp-inline-gallery.protoascii
index 5839d81a8..088a3f8fe 100644
--- a/extensions/amp-inline-gallery/validator-amp-inline-gallery.protoascii
+++ b/extensions/amp-inline-gallery/validator-amp-inline-gallery.protoascii
@@ -20,6 +20,7 @@ tags: {  # amp-inline-gallery
   extension_spec: {
     name: "amp-inline-gallery"
     version: "0.1"
+    version: "1.0"
     version: "latest"
   }
   attr_lists: "common-extension-attrs"
@@ -82,7 +83,7 @@ tags: {  # <amp-inline-gallery-thumbnails>
     }
   }
   attrs: {
-    name: "aspect-ratio-width"
+    name: "aspect-ratio-width" # 0.1 only
     # Non-zero number
     value_regex: "\\d+(\\.\\d+)?"
     disallowed_value_regex: "^0+(\\.0+)?$"
@@ -90,6 +91,12 @@ tags: {  # <amp-inline-gallery-thumbnails>
       also_requires_attr: "aspect-ratio-height"
     }
   }
+  attrs: {
+    name: "aspect-ratio" # 1.0 only
+    # Non-zero number
+    value_regex: "\\d+(\\.\\d+)?"
+    disallowed_value_regex: "^0+(\\.0+)?$"
+  }
   attrs: {
     name: "loop"
     value: "true"
diff --git a/extensions/amp-instagram/validator-amp-instagram.protoascii b/extensions/amp-instagram/validator-amp-instagram.protoascii
index 4a462662c..13096a3aa 100644
--- a/extensions/amp-instagram/validator-amp-instagram.protoascii
+++ b/extensions/amp-instagram/validator-amp-instagram.protoascii
@@ -14,11 +14,26 @@
 # limitations under the license.
 #
 
-tags: {  # amp-instagram
+tags: {  # amp-instagram 1.0
   html_format: AMP
   tag_name: "SCRIPT"
+  satisfies: "amp-instagram 1.0"
+  excludes: "amp-instagram 0.1"
   extension_spec: {
     name: "amp-instagram"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+tags: {  # amp-instagram 0.1 and latest
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-instagram 0.1"
+  excludes: "amp-instagram 1.0"
+  extension_spec: {
+    name: "amp-instagram"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
     requires_usage: EXEMPTED
diff --git a/extensions/amp-lightbox/validator-amp-lightbox.protoascii b/extensions/amp-lightbox/validator-amp-lightbox.protoascii
index e99a3941e..d5bea86b4 100644
--- a/extensions/amp-lightbox/validator-amp-lightbox.protoascii
+++ b/extensions/amp-lightbox/validator-amp-lightbox.protoascii
@@ -14,11 +14,26 @@
 # limitations under the license.
 #
 
-tags: {  # amp-lightbox
+tags: {  # amp-lightbox 1.0
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-lightbox 1.0"
+  excludes: "amp-lightbox 0.1"
+  extension_spec: {
+    name: "amp-lightbox"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+tags: {  # amp-lightbox 0.1 and latest
   html_format: AMP
   tag_name: "SCRIPT"
+  satisfies: "amp-lightbox 0.1"
+  excludes: "amp-lightbox 1.0"
   extension_spec: {
     name: "amp-lightbox"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
     requires_usage: EXEMPTED
@@ -32,6 +47,7 @@ tags: {  # amp-lightbox
   spec_name: "SCRIPT[custom-element=amp-lightbox] (AMP4ADS)"
   extension_spec: {
     name: "amp-lightbox"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
   }
@@ -43,6 +59,7 @@ tags: {  # amp-lightbox
   spec_name: "SCRIPT[custom-element=amp-lightbox] (AMP4EMAIL)"
   extension_spec: {
     name: "amp-lightbox"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
   }
@@ -56,7 +73,14 @@ tags: {  # <amp-lightbox>
   tag_name: "AMP-LIGHTBOX"
   requires_extension: "amp-lightbox"
   attrs: {
-    name: "animate-in"
+    name: "animate-in" # 0.1 only
+    value_casei: "fade-in"
+    value_casei: "fly-in-bottom"
+    value_casei: "fly-in-top"
+  }
+  attrs: {
+    disabled_by: "amp4email"
+    name: "animation" # 1.0 only
     value_casei: "fade-in"
     value_casei: "fly-in-bottom"
     value_casei: "fly-in-top"
@@ -64,7 +88,7 @@ tags: {  # <amp-lightbox>
   attrs: { name: "controls" }
   attrs: { name: "from" }
   attrs: {
-    name: "scrollable"
+    name: "scrollable" # 0.1 only
     disabled_by: "amp4email"
   }
   # <amp-bind>
diff --git a/extensions/amp-nested-menu/validator-amp-nested-menu.protoascii b/extensions/amp-nested-menu/validator-amp-nested-menu.protoascii
index 3be476db2..ae8b0a1ed 100644
--- a/extensions/amp-nested-menu/validator-amp-nested-menu.protoascii
+++ b/extensions/amp-nested-menu/validator-amp-nested-menu.protoascii
@@ -137,9 +137,11 @@ descendant_tag_list {
   tag: "B"
   tag: "BR"
   tag: "BUTTON"
+  tag: "CIRCLE"
   tag: "COL"
   tag: "COLGROUP"
   tag: "DIV"
+  tag: "ELLIPSE"
   tag: "EM"
   tag: "FIELDSET"
   tag: "FORM"
@@ -153,12 +155,16 @@ descendant_tag_list {
   tag: "INPUT"
   tag: "LABEL"
   tag: "LI"
+  tag: "LINE"
   tag: "MARK"
   tag: "NAV"
   tag: "OL"
   tag: "OPTION"
   tag: "P"
   tag: "PATH"
+  tag: "POLYGON"
+  tag: "POLYLINE"
+  tag: "RECT"
   tag: "SECTION"
   tag: "SELECT"
   tag: "SPAN"
diff --git a/extensions/amp-nexxtv-player/validator-amp-nexxtv-player.protoascii b/extensions/amp-nexxtv-player/validator-amp-nexxtv-player.protoascii
index df2eab823..163580962 100644
--- a/extensions/amp-nexxtv-player/validator-amp-nexxtv-player.protoascii
+++ b/extensions/amp-nexxtv-player/validator-amp-nexxtv-player.protoascii
@@ -42,23 +42,25 @@ tags: {  # <amp-nexxtv-player>
     value: "api"
     value: "static"
   }
-  attrs: {
-    name: "data-origin"
-    value_url: {
-      protocol: "https"
-      protocol: "http"
-      allow_empty: true
-    }
-  }
   attrs: {
     name: "data-streamtype"
     value: "album"
     value: "audio"
+    value: "audioalbum"
+    value: "collection"
     value: "live"
     value: "playlist"
     value: "playlist-marked"
+    value: "radio"
+    value: "set"
     value: "video"
   }
+  attrs: {
+    name: "data-exit-mode"
+    value: "load"
+    value: "loop"
+    value: "replay"
+  }
   attr_lists: "extended-amp-global"
   amp_layout: {
     supported_layouts: FILL
diff --git a/extensions/amp-pan-zoom/validator-amp-pan-zoom.protoascii b/extensions/amp-pan-zoom/validator-amp-pan-zoom.protoascii
index 085c09ba7..cc1a5f4d7 100644
--- a/extensions/amp-pan-zoom/validator-amp-pan-zoom.protoascii
+++ b/extensions/amp-pan-zoom/validator-amp-pan-zoom.protoascii
@@ -59,4 +59,3 @@ tags: {  # <amp-pan-zoom>
     supported_layouts: RESPONSIVE
   }
 }
-
diff --git a/extensions/amp-recaptcha-input/validator-amp-recaptcha-input.protoascii b/extensions/amp-recaptcha-input/validator-amp-recaptcha-input.protoascii
index 20de8b4c3..6c85e083a 100644
--- a/extensions/amp-recaptcha-input/validator-amp-recaptcha-input.protoascii
+++ b/extensions/amp-recaptcha-input/validator-amp-recaptcha-input.protoascii
@@ -42,4 +42,3 @@ tags: {  # <amp-form> <amp-recaptcha-input>
     supported_layouts: NODISPLAY
   }
 }
-
diff --git a/extensions/amp-nexxtv-player/validator-amp-nexxtv-player.protoascii b/extensions/amp-render/validator-amp-render.protoascii
similarity index 56%
copy from extensions/amp-nexxtv-player/validator-amp-nexxtv-player.protoascii
copy to extensions/amp-render/validator-amp-render.protoascii
index df2eab823..696e8d93b 100644
--- a/extensions/amp-nexxtv-player/validator-amp-nexxtv-player.protoascii
+++ b/extensions/amp-render/validator-amp-render.protoascii
@@ -1,5 +1,5 @@
 #
-# Copyright 2017 The AMP HTML Authors. All Rights Reserved.
+# Copyright 2021 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.
@@ -14,52 +14,50 @@
 # limitations under the license.
 #
 
-tags: {  # amp-nexxtv-player
+tags: {  # amp-render
   html_format: AMP
   tag_name: "SCRIPT"
   extension_spec: {
-    name: "amp-nexxtv-player"
-    version: "0.1"
+    name: "amp-render"
+    version: "1.0"
     version: "latest"
   }
   attr_lists: "common-extension-attrs"
 }
-tags: {  # <amp-nexxtv-player>
+tags: {  # <amp-render>
   html_format: AMP
-  tag_name: "AMP-NEXXTV-PLAYER"
-  requires_extension: "amp-nexxtv-player"
+  tag_name: "AMP-RENDER"
+  requires_extension: "amp-render"
   attrs: {
-    name: "data-client"
-    mandatory: true
+    name: "binding"
+    value: "always"
+    value: "never"
+    value: "no"
+    value: "refresh"
   }
+  attrs: { name: "credentials" }
   attrs: {
-    name: "data-mediaid"
-    mandatory: true
-    value_regex: "[^=/?:]+"
+    name: "data-amp-bind-src"
+    mandatory_anyof: "['src','[src]','data-amp-bind-src']"
   }
+  attrs: { name: "key" }
   attrs: {
-    name: "data-mode"
-    value: "api"
-    value: "static"
-  }
-  attrs: {
-    name: "data-origin"
+    name: "src"
+    mandatory_anyof: "['src','[src]','data-amp-bind-src']"
     value_url: {
+      protocol: "amp-script"
+      protocol: "amp-state"
       protocol: "https"
-      protocol: "http"
-      allow_empty: true
     }
+    disallowed_value_regex: "__amp_source_origin"
   }
+  attrs: { name: "xssi-prefix" }
   attrs: {
-    name: "data-streamtype"
-    value: "album"
-    value: "audio"
-    value: "live"
-    value: "playlist"
-    value: "playlist-marked"
-    value: "video"
+    name: "[src]"
+    mandatory_anyof: "['src','[src]','data-amp-bind-src']"
   }
   attr_lists: "extended-amp-global"
+  spec_url: "https://amp.dev/documentation/components/amp-render/"
   amp_layout: {
     supported_layouts: FILL
     supported_layouts: FIXED
diff --git a/extensions/amp-script/validator-amp-script.protoascii b/extensions/amp-script/validator-amp-script.protoascii
index d5294f3fc..86e857262 100644
--- a/extensions/amp-script/validator-amp-script.protoascii
+++ b/extensions/amp-script/validator-amp-script.protoascii
@@ -202,6 +202,10 @@ tags: {  # <amp-script>
     name: "nodom"
     value: ""
   }
+  attrs: {
+    name: "sandboxed"
+    value: ""
+  }
   attrs: { name: "sandbox" }
   attrs: {
     name: "script"
diff --git a/extensions/amp-selector/validator-amp-selector.protoascii b/extensions/amp-selector/validator-amp-selector.protoascii
index fbb79c094..0b4700719 100644
--- a/extensions/amp-selector/validator-amp-selector.protoascii
+++ b/extensions/amp-selector/validator-amp-selector.protoascii
@@ -13,12 +13,27 @@
 # See the License for the specific language governing permissions and
 # limitations under the license.
 #
-tags: {
+tags: {  # amp-selector 1.0
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-selector 1.0"
+  excludes: "amp-selector 0.1"
+  extension_spec: {
+    name: "amp-selector"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+tags: {  # amp-selector 0.1 and latest
   html_format: AMP
   html_format: AMP4ADS
   tag_name: "SCRIPT"
+  satisfies: "amp-selector 0.1"
+  excludes: "amp-selector 1.0"
   extension_spec: {
     name: "amp-selector"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
     requires_usage: EXEMPTED
@@ -33,6 +48,7 @@ tags: {
   extension_spec: {
     name: "amp-selector"
     # AMP4EMAIL doesn't allow version: "latest".
+    version_name: "v0.1"
     version: "0.1"
     requires_usage: EXEMPTED
   }
diff --git a/extensions/amp-sidebar/validator-amp-sidebar.protoascii b/extensions/amp-sidebar/validator-amp-sidebar.protoascii
index fe5416ce1..e8ee12f04 100644
--- a/extensions/amp-sidebar/validator-amp-sidebar.protoascii
+++ b/extensions/amp-sidebar/validator-amp-sidebar.protoascii
@@ -84,6 +84,8 @@ tags: { # <amp-sidebar> in amp-story
     marker: AUTOSCROLL
   }
   spec_url: "https://amp.dev/documentation/components/amp-sidebar/"
+  deprecation: "anchor tags or amp-story-player controls"
+  deprecation_url: "https://github.com/ampproject/amphtml/issues/33293"
 }
 tags: {  # amp-sidebar > nav
   html_format: AMP
diff --git a/extensions/amp-skimlinks/validator-amp-skimlinks.protoascii b/extensions/amp-skimlinks/validator-amp-skimlinks.protoascii
index 16e7fab7f..0cebbc158 100644
--- a/extensions/amp-skimlinks/validator-amp-skimlinks.protoascii
+++ b/extensions/amp-skimlinks/validator-amp-skimlinks.protoascii
@@ -60,4 +60,3 @@ tags: {  # <amp-skimlinks>
     supported_layouts: NODISPLAY
   }
 }
-
diff --git a/extensions/amp-social-share/validator-amp-social-share.protoascii b/extensions/amp-social-share/validator-amp-social-share.protoascii
index 5b644b39d..38e5d39e2 100644
--- a/extensions/amp-social-share/validator-amp-social-share.protoascii
+++ b/extensions/amp-social-share/validator-amp-social-share.protoascii
@@ -14,12 +14,27 @@
 # limitations under the license.
 #
 
-tags: {  # amp-social-share
+tags: {  # amp-social-share 1.0
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-social-share 1.0"
+  excludes: "amp-social-share 0.1"
+  extension_spec: {
+    name: "amp-social-share"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+tags: {  # amp-social-share 0.1 and latest
   html_format: AMP
   html_format: AMP4ADS
   tag_name: "SCRIPT"
+  satisfies: "amp-social-share 0.1"
+  excludes: "amp-social-share 1.0"
   extension_spec: {
     name: "amp-social-share"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
     requires_usage: EXEMPTED
diff --git a/extensions/amp-story/validator-amp-story.protoascii b/extensions/amp-story/validator-amp-story.protoascii
index d0425ca04..9a3b676cc 100644
--- a/extensions/amp-story/validator-amp-story.protoascii
+++ b/extensions/amp-story/validator-amp-story.protoascii
@@ -152,6 +152,7 @@ tags: {  # <amp-story-page>
     child_tag_name_oneof: "AMP-STORY-CTA-LAYER"
     child_tag_name_oneof: "AMP-STORY-GRID-LAYER"
     child_tag_name_oneof: "AMP-STORY-PAGE-ATTACHMENT"
+    child_tag_name_oneof: "AMP-STORY-PAGE-OUTLINK"
     mandatory_min_num_child_tags: 1
   }
 }
@@ -590,6 +591,7 @@ descendant_tag_list: {
   tag: "ADDRESS"
   tag: "AMP-CALL-TRACKING"
   tag: "AMP-DATE-COUNTDOWN"
+  tag: "AMP-DATE-DISPLAY"
   tag: "AMP-FIT-TEXT"
   tag: "AMP-FONT"
   tag: "AMP-IMG"
@@ -703,6 +705,7 @@ descendant_tag_list: {
   tag: "AMP-ANALYTICS"
   tag: "AMP-AUDIO"
   tag: "AMP-DATE-COUNTDOWN"
+  tag: "AMP-DATE-DISPLAY"
   tag: "AMP-EXPERIMENT"
   tag: "AMP-FIT-TEXT"
   tag: "AMP-FONT"
@@ -840,12 +843,25 @@ descendant_tag_list: {
   tag: "VKERN"
   tag: "WBR"
 }
-tags: {  # <amp-story-page-attachment> with href
+# <amp-story-page-attachment> with href.
+# Legacy version of <amp-story-page-outlink>.
+tags: {
   html_format: AMP
   tag_name: "AMP-STORY-PAGE-ATTACHMENT"
   spec_name: "amp-story-page-attachment[href]"
   mandatory_ancestor: "AMP-STORY-PAGE"
   mandatory_last_child: true
+  attrs: {
+    name: "cta-text"
+  }
+  attrs: {
+    name: "href"
+    mandatory: true
+    value_url: {
+      protocol: "http"
+      protocol: "https"
+    }
+  }
   attrs: {
     name: "layout"
     mandatory: true
@@ -857,12 +873,7 @@ tags: {  # <amp-story-page-attachment> with href
     value: "light"
   }
   attrs: {
-    name: "href"
-    mandatory: true
-    value_url: {
-      protocol: "http"
-      protocol: "https"
-    }
+    name: "title"
   }
   child_tags: {
     mandatory_num_child_tags: 0
@@ -875,20 +886,56 @@ tags: {  # <amp-story-page-attachment> with no href
   mandatory_ancestor: "AMP-STORY-PAGE"
   descendant_tag_list: "amp-story-page-attachment-allowed-descendants"
   mandatory_last_child: true
+  attrs: {
+    name: "cta-text"
+  }
+  attrs: {
+    name: "title"
+  }
   attrs: {
     name: "cta-image"
     value_url: {
-      # protocol: "http"  # TODO(honeybaderdontcare): readd once transformers in prod
+      protocol: "http"
       protocol: "https"
-      allow_relative: false  # TODO(honeybaderdontcare): remove once transformers in prod
     }
   }
   attrs: {
     name: "cta-image-2"
     value_url: {
-      # protocol: "http"  # TODO(honeybaderdontcare): readd once transformers in prod
+      protocol: "http"
+      protocol: "https"
+    }
+  }
+  attrs: {
+    name: "layout"
+    mandatory: true
+    value: "nodisplay"
+  }
+  attrs: {
+    name: "theme"
+    value: "dark"
+    value: "light"
+  }
+}
+tags: {
+  html_format: AMP
+  tag_name: "AMP-STORY-PAGE-OUTLINK"
+  spec_name: "amp-story-page-outlink"
+  mandatory_ancestor: "AMP-STORY-PAGE"
+  mandatory_last_child: true
+  attrs: {
+    name: "cta-accent-color"
+  }
+  attrs: {
+    name: "cta-accent-element"
+    value: "background"
+    value: "text"
+  }
+  attrs: {
+    name: "cta-image"
+    value_url: {
+      protocol: "http"
       protocol: "https"
-      allow_relative: false  # TODO(honeybaderdontcare): remove once transformers in prod
     }
   }
   attrs: {
@@ -898,9 +945,14 @@ tags: {  # <amp-story-page-attachment> with no href
   }
   attrs: {
     name: "theme"
+    value: "custom"
     value: "dark"
     value: "light"
   }
+  child_tags: {
+    mandatory_num_child_tags: 1
+    child_tag_name_oneof: "A"
+  }
 }
 tags: {  # <amp-story-animation> <script>
   html_format: AMP
@@ -999,6 +1051,7 @@ descendant_tag_list {
   tag: "AMP-CAROUSEL"
   tag: "AMP-DAILYMOTION"
   tag: "AMP-DATE-COUNTDOWN"
+  tag: "AMP-DATE-DISPLAY"
   tag: "AMP-EMBEDLY-CARD"
   tag: "AMP-FACEBOOK"
   tag: "AMP-FACEBOOK-COMMENTS"
diff --git a/extensions/amp-stream-gallery/validator-amp-stream-gallery.protoascii b/extensions/amp-stream-gallery/validator-amp-stream-gallery.protoascii
new file mode 100644
index 000000000..543f541a6
--- /dev/null
+++ b/extensions/amp-stream-gallery/validator-amp-stream-gallery.protoascii
@@ -0,0 +1,118 @@
+#
+# Copyright 2020 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.
+#
+
+tags: {  # amp-stream-gallery
+  html_format: AMP
+  tag_name: "SCRIPT"
+  extension_spec: {
+    name: "amp-stream-gallery"
+    version: "1.0"
+    version: "latest"
+  }
+  attr_lists: "common-extension-attrs"
+}
+tags: {  # <amp-stream-gallery>
+  html_format: AMP
+  tag_name: "AMP-STREAM-GALLERY"
+  requires_extension: "amp-stream-gallery"
+  attr_lists: "amp-stream-gallery-common"
+  attr_lists: "extended-amp-global"
+  spec_url: "https://github.com/ampproject/amphtml/blob/master/extensions/amp-stream-gallery/amp-stream-gallery.md"
+  amp_layout: {
+    supported_layouts: FILL
+    supported_layouts: FIXED
+    supported_layouts: FIXED_HEIGHT
+    supported_layouts: FLEX_ITEM
+    supported_layouts: INTRINSIC
+    supported_layouts: NODISPLAY
+    supported_layouts: RESPONSIVE
+  }
+}
+
+# Examples for media query / value pairs:
+# (min-width: 600px) and (min-height: 800px)  false, true
+# (min-width: 600px) false,(min-width: 600px) true,false
+# true
+attr_lists: {
+  name: "amp-stream-gallery-common"
+  attrs: {
+    name: "controls"
+    # Media query / (always|auto|never)
+    value_regex: "([^,]+\\s+(always|auto|never),\\s*)*(always|auto|never)"
+  }
+  attrs: {
+    name: "extra-space"
+    value: "between"
+  }
+  attrs: {
+    name: "loop"
+    # Media query / boolean pairs
+    value_regex: "([^,]+\\s+(true|false),\\s*)*(true|false)"
+  }
+  attrs: {
+    name: "min-visible-count"
+    # Media query / positive float pairs
+    value_regex: "([^,]+\\s+(\\d+(\\.\\d+)?),\\s*)*(\\d+(\\.\\d+)?)"
+  }
+  attrs: {
+    name: "max-visible-count"
+    # Media query / positive float pairs
+    value_regex: "([^,]+\\s+(\\d+(\\.\\d+)?),\\s*)*(\\d+(\\.\\d+)?)"
+  }
+  attrs: {
+    name: "min-item-width"
+    # Media query / positive integer pairs
+    value_regex: "([^,]+\\s+(\\d+),\\s*)*(\\d+)"
+  }
+  attrs: {
+    name: "max-item-width"
+    # Media query / positive integer pairs
+    value_regex: "([^,]+\\s+(\\d+),\\s*)*(\\d+)"
+  }
+  attrs: {
+    name: "outset-arrows"
+    # Media query / boolean pairs
+    value_regex: "([^,]+\\s+(true|false),\\s*)*(true|false)"
+  }
+  attrs: {
+    name: "peek"
+    # Media query / positive float pairs
+    value_regex: "([^,]+\\s+(\\d+(\\.\\d+)?),\\s*)*(\\d+(\\.\\d+)?)"
+  }
+  attrs: {
+    name: "slide-align"
+    # Media query / (start|center) pairs
+    value_regex: "([^,]+\\s+(start|center),\\s*)*(start|center)"
+  }
+  attrs: {
+    name: "snap"
+    # Media query / boolean pairs
+    value_regex: "([^,]+\\s+(true|false),\\s*)*(true|false)"
+  }
+
+  # amp-bind
+  attrs: { name: "[controls]" }
+  attrs: { name: "[extra-space]" }
+  attrs: { name: "[loop]" }
+  attrs: { name: "[min-visible-count]" }
+  attrs: { name: "[max-visible-count]" } # 0.1 only
+  attrs: { name: "[min-item-width]" }
+  attrs: { name: "[max-item-width]" }
+  attrs: { name: "[outset-arrows]" }
+  attrs: { name: "[peek]" }
+  attrs: { name: "[slide-align]" }
+  attrs: { name: "[snap]" }
+}
diff --git a/extensions/amp-timeago/validator-amp-timeago.protoascii b/extensions/amp-timeago/validator-amp-timeago.protoascii
index fad65eda8..72138157c 100644
--- a/extensions/amp-timeago/validator-amp-timeago.protoascii
+++ b/extensions/amp-timeago/validator-amp-timeago.protoascii
@@ -20,6 +20,7 @@ tags: {  # amp-timeago
   extension_spec: {
     name: "amp-timeago"
     version: "0.1"
+    version: "1.0"
     version: "latest"
   }
   attr_lists: "common-extension-attrs"
diff --git a/extensions/amp-video-iframe/validator-amp-video-iframe.protoascii b/extensions/amp-video-iframe/validator-amp-video-iframe.protoascii
index 406224b97..e3e71a3a0 100644
--- a/extensions/amp-video-iframe/validator-amp-video-iframe.protoascii
+++ b/extensions/amp-video-iframe/validator-amp-video-iframe.protoascii
@@ -17,8 +17,24 @@
 tags: {  # amp-video-iframe
   html_format: AMP  # Iframes not allowed in ads.
   tag_name: "SCRIPT"
+  satisfies: "amp-video-iframe 1.0"
+  excludes: "amp-video-iframe 0.1"
   extension_spec: {
     name: "amp-video-iframe"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+
+tags: {  # amp-video-iframe
+  html_format: AMP  # Iframes not allowed in ads.
+  tag_name: "SCRIPT"
+  satisfies: "amp-video-iframe 0.1"
+  excludes: "amp-video-iframe 1.0"
+  extension_spec: {
+    name: "amp-video-iframe"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
   }
diff --git a/extensions/amp-video/validator-amp-video.protoascii b/extensions/amp-video/validator-amp-video.protoascii
index 7c4ab5167..56aca09f0 100644
--- a/extensions/amp-video/validator-amp-video.protoascii
+++ b/extensions/amp-video/validator-amp-video.protoascii
@@ -14,18 +14,30 @@
 # limitations under the license.
 #
 
-tags: {  # amp-video
+tags: {  # amp-video 1.0
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-video 1.0"
+  excludes: "amp-video 0.1"
+  extension_spec: {
+    name: "amp-video"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+
+tags: {  # amp-video 0.1
   html_format: AMP
   html_format: AMP4ADS
   tag_name: "SCRIPT"
-  # Typically the extension_spec takes care of this, but we have
-  # a unique situation where we need to refer to this earlier in
-  # the rules processing for the also_requires_tag_warning below.
-  spec_name: "amp-video extension script"
+  satisfies: "amp-video 0.1"
+  excludes: "amp-video 1.0"
   extension_spec: {
     name: "amp-video"
     version: "0.1"
     version: "latest"
+    version_name: "v0.1"
     requires_usage: NONE
   }
   attr_lists: "common-extension-attrs"
@@ -111,10 +123,7 @@ tags: {  # <amp-video> not in amp-story.
   tag_name: "AMP-VIDEO"
   # There is an alternate spec for amp-video in amp-story.
   disallowed_ancestor: "AMP-STORY"
-  # Typically we'd require the extension j/s, but for historical reasons
-  # 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-video extension script"
+  requires_extension: "amp-video"
   attrs: { name: "poster" }
   attr_lists: "extended-amp-global"
   attr_lists: "amp-video-common"
@@ -137,7 +146,7 @@ tags: {  # <amp-video> in amp-story-page-attachment (same rules as regular AMPHT
   tag_name: "AMP-VIDEO"
   spec_name: "amp-story >> amp-story-page-attachment >> amp-video"
   mandatory_ancestor: "AMP-STORY-PAGE-ATTACHMENT"
-  also_requires_tag_warning: "amp-video extension script"
+  requires_extension: "amp-video"
   attrs: { name: "poster" }
   attr_lists: "extended-amp-global"
   attr_lists: "amp-video-common"
@@ -181,6 +190,10 @@ tags: {  # <amp-video> in amp-story
     name: "poster"
     mandatory: true
   }
+  attrs: {
+    name: "cache"
+    value: "google"
+  }
   attr_lists: "extended-amp-global"
   attr_lists: "amp-video-common"
   spec_url: "https://amp.dev/documentation/components/amp-video/"
diff --git a/extensions/amp-vimeo/validator-amp-vimeo.protoascii b/extensions/amp-vimeo/validator-amp-vimeo.protoascii
index 50eeeadac..af6b7880c 100644
--- a/extensions/amp-vimeo/validator-amp-vimeo.protoascii
+++ b/extensions/amp-vimeo/validator-amp-vimeo.protoascii
@@ -17,8 +17,11 @@
 tags: {  # amp-vimeo
   html_format: AMP
   tag_name: "SCRIPT"
+  satisfies: "amp-vimeo 0.1"
+  excludes: "amp-vimeo 1.0"
   extension_spec: {
     name: "amp-vimeo"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
     requires_usage: EXEMPTED
@@ -26,6 +29,18 @@ tags: {  # amp-vimeo
   }
   attr_lists: "common-extension-attrs"
 }
+tags: {  # amp-vimeo 1.0
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-vimeo 1.0"
+  excludes: "amp-vimeo 0.1"
+  extension_spec: {
+    name: "amp-vimeo"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
 tags: {  # <amp-vimeo>
   html_format: AMP
   tag_name: "AMP-VIMEO"
diff --git a/extensions/amp-youtube/validator-amp-youtube.protoascii b/extensions/amp-youtube/validator-amp-youtube.protoascii
index 31ea7b469..672000210 100644
--- a/extensions/amp-youtube/validator-amp-youtube.protoascii
+++ b/extensions/amp-youtube/validator-amp-youtube.protoascii
@@ -14,11 +14,27 @@
 # limitations under the license.
 #
 
-tags: {  # amp-youtube
+tags: {  # amp-youtube 1.0
   html_format: AMP
   tag_name: "SCRIPT"
+  satisfies: "amp-youtube 1.0"
+  excludes: "amp-youtube 0.1"
   extension_spec: {
     name: "amp-youtube"
+    version_name: "v1.0"
+    version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+
+tags: {  # amp-youtube 0.1 and latest
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-youtube 0.1"
+  excludes: "amp-youtube 1.0"
+  extension_spec: {
+    name: "amp-youtube"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
     requires_usage: EXEMPTED
@@ -26,6 +42,7 @@ tags: {  # amp-youtube
   }
   attr_lists: "common-extension-attrs"
 }
+
 tags: {  # <amp-youtube>
   html_format: AMP
   tag_name: "AMP-YOUTUBE"
diff --git a/validator/validator-css.protoascii b/validator/validator-css.protoascii
index 23a6b3add..93d3ef468 100644
--- a/validator/validator-css.protoascii
+++ b/validator/validator-css.protoascii
@@ -838,6 +838,8 @@ tags: {  # <style amp-custom>, [AMP]
            feature: 'min-device-pixel-ratio'
            feature: 'max-device-pixel-ratio2'
            feature: 'min-device-pixel-ratio2'
+           feature: 'min--moz-device-pixel-ratio'
+           feature: 'max--moz-device-pixel-ratio'
          }
       }
       at_rule_spec: { name: 'page' }
diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii
index 7f7da3161..07d0a9362 100644
--- a/validator/validator-main.protoascii
+++ b/validator/validator-main.protoascii
@@ -22,11 +22,8 @@
 # (validator-main.protoascii, etc) are always released together.
 min_validator_revision_required: 475
 
-# The spec file revision allows the validator engine to distinguish
-# 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: 1162
+# DEPRECATED: This value is no longer updated.
+spec_file_revision: 1188
 
 styles_spec_url: "https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/style_pages/"
 script_spec_url: "https://amp.dev/documentation/guides-and-tutorials/learn/validation-workflow/validation_errors/#custom-javascript-is-not-allowed"
@@ -544,7 +541,7 @@ tags: {
   spec_url: "https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#html-tags"
 }
 # AMP & AMP4ADS metadata, name=amp-experiments-opt-in
-# https://github.com/lannka/amphtml/blob/master/tools/experiments/README.md
+# https://github.com/ampproject/amphtml/blob/main/tools/experiments/README.md
 tags: {
   html_format: AMP
   html_format: AMP4ADS
@@ -2626,10 +2623,6 @@ attr_lists: {
     disabled_by: "amp4email"
     name: "enterkeyhint"
   }
-  attrs: {
-    disabled_by: "amp4email"
-    name: "enterkeyhint"
-  }
   attrs: { name: "max" }
   attrs: { name: "maxlength" }
   attrs: { name: "min" }
@@ -3370,11 +3363,35 @@ tags: {
     }
   }
 }
+# Enables early styling on fast failure to load v0.js or v0.mjs. See GitHub #22543.
+tags: {
+  html_format: AMP
+  enabled_by: "transformed"
+  tag_name: "SCRIPT"
+  spec_name: "script amp-onerror (v0.js or v0.mjs)"
+  descriptive_name: "script amp-onerror"
+  unique: true
+  mandatory_parent: "HEAD"
+  attrs: {
+    name: "amp-onerror"
+    value: ""
+    mandatory: true
+    dispatch_key: NAME_VALUE_DISPATCH
+  }
+  cdata: {
+    # Only valid if contents are exactly either of these:
+    # [].slice.call(document.querySelectorAll("script[src*='/v0.js'],script[src*='/v0.mjs']")).forEach(function(s){s.onerror=function(){document.querySelector('style[amp-boilerplate]').textContent=''}})
+    # document.querySelector("script[src*='/v0.js']").onerror=function(){document.querySelector('style[amp-boilerplate]').textContent=''}
+    cdata_regex: "\\[]\\.slice\\.call\\(document\\.querySelectorAll\\(\"script\\[src\\*='\\/v0\\.js'],script\\[src\\*='\\/v0\\.mjs']\"\\)\\)\\.forEach\\(function\\(s\\){s\\.onerror=function\\(\\){document\\.querySelector\\('style\\[amp-boilerplate]'\\)\\.textContent=''}}\\)|"
+                 "document\\.querySelector\\(\"script\\[src\\*='\\/v0\\.js']\"\\)\\.onerror=function\\(\\){document\\.querySelector\\('style\\[amp-boilerplate]'\\)\\.textContent=''}"
+  }
+}
+
 # Enables early styling on fast failure to load v0.js. See GitHub #22543.
 tags: {
   html_format: AMP
   tag_name: "SCRIPT"
-  spec_name: "script amp-onerror"
+  spec_name: "script amp-onerror (v0.js)"
   descriptive_name: "script amp-onerror"
   unique: true
   mandatory_parent: "HEAD"
@@ -3813,11 +3830,13 @@ tags: {
   mandatory_parent: "amp-img (transformed)"
   attrs: { name: "alt" }
   attrs: { name: "attribution" }
+  attrs: { name: "height" }
   attrs: { name: "object-fit" }
   attrs: { name: "object-position" }
   attrs: { name: "referrerpolicy" }
   attrs: { name: "sizes" }
   attrs: { name: "title" }
+  attrs: { name: "width" }
   attr_lists: "mandatory-src-or-srcset"
   # SSR requires these explicit attributes
   attrs: {

@westonruter westonruter added this to the v2.1.3 milestone May 21, 2021
@westonruter westonruter self-assigned this May 21, 2021
* Version 1.0 of amp-experiment is still experimental and requires the user to enable it.
* @todo Revisit once amp-experiment is no longer experimental.
*/
$wp_scripts->registered['amp-experiment']->src = 'https://cdn.ampproject.org/v0/amp-experiment-0.1.js';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: need to update that in Web Stories as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out that 0.1 is still the latestVersion, so you don't have to change it. While 1.0 is valid now, the plugin will continue to serve 0.1 by default.

@@ -1254,6 +1254,161 @@ static function ( $script ) {
$this->assertStringContains( '<script type=\'text/javascript\' src=\'https://cdn.ampproject.org/v0/amp-foo-0.1.js\' async custom-element="amp-foo"></script>', $output ); // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
}

/** @covers ::amp_register_default_scripts() */
public function test_amp_register_default_scripts() {
Copy link
Member Author

@westonruter westonruter May 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that all of the versions being checked in this test are the same as in develop, with the exception of the three new component scripts added:

  • amp-cache-url
  • amp-iframely
  • amp-stream-gallery
  • amp-render

So there will be no unexpected component version changes if this is part of a 2.1.3 patch release.

@westonruter westonruter changed the title Update AMP spec to 2105072136000 Update AMP spec to 04425915c May 28, 2021
@westonruter
Copy link
Member Author

For fd72710, there seems to be something missing in the validator spec for the cache attribute on amp-video.

Namely, it currently has:

  attrs: {
    name: "cache"
    value: "google"
  }

What appears to be missing is requires_extension: "amp-cache-url" like can be seen for the dock attribute:

  attrs: {
    name: "dock"
    requires_extension: "amp-video-docking"
  }

The generated spec should include:

--- a/includes/sanitizers/class-amp-allowed-tags-generated.php
+++ b/includes/sanitizers/class-amp-allowed-tags-generated.php
@@ -7271,6 +7271,9 @@ class AMP_Allowed_Tags_Generated {
 						'value' => array(
 							'google',
 						),
+						'requires_extension' => array(
+							'amp-cache-url',
+						),
 					),
 					'controls' => array(
 						'value' => array(

Since there is no requires_usage, the extension is not being automatically detected. Nevertheless, when using cache=google in a Web Story on playground.amp.dev, it does flag the lack of the amp-cache-url component script when the cache attribute is used in an amp-video. So I'm confused where that dependency is being codified.

@westonruter
Copy link
Member Author

Correction: It turns out that amp-cache-url is loaded lazily, so it is not a required extension. See ampproject/amphtml#34588. This just landed yesterday, which is why the validator complained about there not being an amp-cache-url component script but when using the latest validator spec (which removed the constraint) the auto-detection was not providing the amp-cache-url component.

@westonruter westonruter force-pushed the update/amphtml-2105072136000 branch from 85765bd to ac99ccf Compare June 2, 2021 19:30
@westonruter
Copy link
Member Author

I'm going to rebase to remove the Bento-specific functionality into another PR which will go into 2.2. The commits left in this this PR will then be just related to the spec update.

@westonruter westonruter force-pushed the update/amphtml-2105072136000 branch from f36363d to bf9480d Compare June 4, 2021 03:41
@westonruter westonruter changed the title Update AMP spec to 04425915c Update AMP spec to 1d3757a07f Jun 4, 2021
@westonruter westonruter marked this pull request as ready for review June 4, 2021 04:23
@westonruter westonruter requested a review from pierlon June 4, 2021 04:23
@codecov
Copy link

codecov bot commented Jun 4, 2021

Codecov Report

Merging #6303 (f164cf4) into develop (8fa2fab) will decrease coverage by 4.44%.
The diff coverage is 100.00%.

❗ Current head f164cf4 differs from pull request most recent head cac1371. Consider uploading reports for the commit cac1371 to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #6303      +/-   ##
=============================================
- Coverage      79.84%   75.39%   -4.45%     
- Complexity         0     5881    +5881     
=============================================
  Files             48      235     +187     
  Lines            759    17786   +17027     
=============================================
+ Hits             606    13410   +12804     
- Misses           153     4376    +4223     
Flag Coverage Δ
javascript 79.84% <ø> (ø)
php 75.19% <100.00%> (?)
unit 75.19% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...es/sanitizers/class-amp-allowed-tags-generated.php 46.42% <ø> (ø)
includes/amp-helper-functions.php 81.73% <100.00%> (ø)
includes/sanitizers/class-amp-style-sanitizer.php 86.56% <100.00%> (ø)
...nitizers/class-amp-tag-and-attribute-sanitizer.php 97.69% <100.00%> (ø)
src/Instrumentation/Event.php 100.00% <0.00%> (ø)
src/Infrastructure/Injector/SimpleInjector.php 88.70% <0.00%> (ø)
...des/embeds/class-amp-dailymotion-embed-handler.php 82.85% <0.00%> (ø)
includes/embeds/class-amp-scribd-embed-handler.php 86.36% <0.00%> (ø)
.../Transformer/AmpSchemaOrgMetadataConfiguration.php 0.00% <0.00%> (ø)
src/Admin/AnalyticsOptionsSubmenu.php 86.66% <0.00%> (ø)
... and 181 more

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2021

Plugin builds for cac1371 are ready 🛎️!

@westonruter
Copy link
Member Author

@pierlon This is a bit hard to review. The biggest change in the diff is caused by sorting the scripts in bd31a77. So it's easier to see the actual changes in this diff: https://github.com/ampproject/amp-wp/pull/6303/files/bd31a77598c5de78b55b7ae24d48bc87a756a125..f164cf4f0256603adeaec8d3c30ac5a5cba1cbc0

@pierlon
Copy link
Contributor

pierlon commented Jun 9, 2021

AMP bento components not in changelog:

  • amp-stream-gallery
  • amp-twitter

Also, I see amp-video under bento components in the changelog, but the extension spec in class-amp-allowed-tags-generated.php does not reflect that.

'amp-byside-content' => 'v0/amp-byside-content-0.1.js',
'amp-cache-url' => 'v0/amp-cache-url-0.1.js',
'amp-call-tracking' => 'v0/amp-call-tracking-0.1.js',
'amp-carousel' => 'v0/amp-carousel-0.2.js',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amp-carousel using v0.2 👍

@@ -920,7 +929,7 @@ class AMP_Allowed_Tags_Generated {
'amp-ad',
),
'spec_name' => 'amp-ad with type=custom',
'spec_url' => 'https://github.com/ampproject/amphtml/blob/master/ads/custom.md',
'spec_url' => 'https://github.com/ampproject/amphtml/blob/main/ads/custom.md',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened a PR to fix that: ampproject/amphtml#34791

@westonruter
Copy link
Member Author

Also, I see amp-video under bento components in the changelog, but the extension spec in class-amp-allowed-tags-generated.php does not reflect that.

Yes, I see that too. It seems due to the lack of npm:true in https://github.com/ampproject/amphtml/blob/64eec863e9a24de5f9358828711484d39162187b/build-system/compile/bundles.config.extensions.json#L1090-L1097

I'm checking on that.

@westonruter westonruter requested a review from pierlon June 9, 2021 22:50
@westonruter
Copy link
Member Author

I'm checking on that.

I've opened ampproject/amphtml#34798 and regenerated the spec off of that.

@westonruter westonruter merged commit 8a42c7b into develop Jun 10, 2021
@westonruter westonruter deleted the update/amphtml-2105072136000 branch June 10, 2021 16:32
westonruter added a commit that referenced this pull request Jun 10, 2021
@westonruter westonruter removed their assignment Jun 10, 2021
@westonruter westonruter self-assigned this Jun 30, 2021
@westonruter
Copy link
Member Author

QA Passed

I added post content as follows:

<!-- wp:html -->
<amp-render src="https://blog.amp.dev/wp-json/wp/v2/posts?per_page=1&amp;_fields=title,link" layout="fixed-height" height="100">
<template type="amp-mustache">
  Latest pot on AMP blog:
  <a href="{{0.link}}">{{0.title.rendered}}</a>
</template>
</amp-render>
<!-- /wp:html -->

<!-- wp:html -->
<amp-iframely width="400" height="225"
    data-id="I8NNa1s"
    layout="responsive"
    data-img>
</amp-iframely>
<!-- /wp:html -->

<!-- wp:html -->
<amp-script id="calendar" script="calendarScript" sandboxed nodom layout="container"></amp-script>
<script id="calendarScript" type="text/plain" target="amp-script">
exportFunction('getData', () => {
    return { date: new Date().toLocaleString() };
})
</script>
<amp-render src="amp-script:calendar.getData" layout="fixed-height" height="100">
<template type="amp-mustache">
  The current date is: {{date}}
</template>
</amp-render>
<!-- /wp:html -->

The result was as expected, with amp-render, amp-iframely, and amp-script[sandboxed] all working as expected:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants