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 amphtml spec to 2204221712000 #7078

Merged
merged 3 commits into from
Apr 26, 2022

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Apr 26, 2022

Previously: #6956

  • Run ./bin/amphtml-update.sh (lando ssh -c 'bash ./bin/amphtml-update.sh vendor/amphtml').
  • Examine diff for changelog.
  • Examine upstream diff to ensure nothing was missed.
  • Update spec generator as needed based on spec format changes.
  • Modify validating sanitizer based on changes to spec, if needed.
  • Add tests for key changes, if needed.

Changelog

  • Update generator script to Python 3, now that the python-protobuf package has apparently been removed in favor of python3-protobuf.
  • Allow amp-story-shopping-tag on amp-story-grid-layer.
  • Allow layout 5 for amp-audio.
  • Add style-preset attribute to amp-story-captions.
  • Allow amp-story-shopping-attachment on amp-story-page.
  • Add cta-text, src, and theme attributes to amp-story-shopping-attachment.
  • Allow amp-story-shopping-attachment to have a script config child.
  • Eliminate amp-story-shopping-config.
  • Add data-product-id attribute to amp-story-shopping-tag.
  • Update regex for volume attribute of amp-video.
  • Add audio[controls] child to amp-audio for SSR. (Dependency for Implement SSR for amp-audio amp-toolbox-php#518.)
  • Add Bento version of amp-audio.
  • Add pan-scaling-factor attribute to amp-story-cta-layer and amp-story-grid-layer.

Details

(
    PREV_VERSION=2202230359001;
    THIS_VERSION=2204221712000;
    git checkout $THIS_VERSION;
    git diff $PREV_VERSION...$THIS_VERSION -w -- build-system/compile/bundles.config.extensions.json build-system/compile/bundles.config.bento.json $( git ls-files | grep '.protoascii' );
    git checkout - > /dev/null
)
Diff 2202230359001...2204221712000
diff --git a/build-system/compile/bundles.config.bento.json b/build-system/compile/bundles.config.bento.json
index 994e47e508..356d518461 100644
--- a/build-system/compile/bundles.config.bento.json
+++ b/build-system/compile/bundles.config.bento.json
@@ -7,27 +7,137 @@
       "npm": true
     }
   },
+  {
+    "name": "bento-base-carousel",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
   {
     "name": "bento-brightcove",
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true
+      "hasCss": true,
+      "npm": true
     }
   },
   {
     "name": "bento-dailymotion",
     "version": "1.0",
     "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
+  {
+    "name": "bento-facebook",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
+  {
+    "name": "bento-imgur",
+    "version": "1.0",
+    "latestVersion": "0.1",
     "options": {
       "hasCss": true
     }
   },
+  {
+    "name": "bento-inline-gallery",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
+  {
+    "name": "bento-instagram",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
   {
     "name": "bento-jwplayer",
     "version": "1.0",
     "options": {
-      "hasCss": true
+      "hasCss": true,
+      "npm": true
+    }
+  },
+  {
+    "name": "bento-lightbox",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
+  {
+    "name": "bento-lightbox-gallery",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
+  {
+    "name": "bento-mustache",
+    "version": "1.0",
+    "options": {
+      "// 1": "This is a dependency for CDN builds, not to be published on NPM.",
+      "// 2": "(NPM builds depend on the third-party `mustache` directly.)",
+      "npm": false
+    }
+  },
+  {
+    "name": "bento-reddit",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
+  {
+    "name": "bento-social-share",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
+  {
+    "name": "bento-soundcloud",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
+    }
+  },
+  {
+    "name": "bento-twitter",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true
     }
   },
   {
@@ -35,7 +145,8 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true
+      "hasCss": true,
+      "npm": true
     }
   },
   {
@@ -43,7 +154,8 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true
+      "hasCss": true,
+      "npm": true
     }
   },
   {
@@ -51,7 +163,8 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true
+      "hasCss": true,
+      "npm": true
     }
   },
   {
@@ -59,7 +172,8 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true
+      "hasCss": true,
+      "npm": true
     }
   }
 ]
diff --git a/build-system/compile/bundles.config.extensions.json b/build-system/compile/bundles.config.extensions.json
index 27b7aea878..d46fcdae8f 100644
--- a/build-system/compile/bundles.config.extensions.json
+++ b/build-system/compile/bundles.config.extensions.json
@@ -186,6 +186,14 @@
     "version": "0.1",
     "latestVersion": "0.1"
   },
+  {
+    "name": "amp-audio",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "bento": true
+    }
+  },
   {
     "name": "amp-auto-ads",
     "version": "0.1",
@@ -217,9 +225,7 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true,
-      "npm": true,
-      "bento": true
+      "hasCss": true
     }
   },
   {
@@ -353,6 +359,16 @@
       "hasCss": true
     }
   },
+  {
+    "name": "amp-date-picker",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "npm": true,
+      "hasCss": true,
+      "bento": true
+    }
+  },
   {
     "name": "amp-delight-player",
     "version": "0.1",
@@ -399,9 +415,7 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true,
-      "npm": true,
-      "bento": true
+      "hasCss": true
     }
   },
   {
@@ -550,6 +564,16 @@
       "hasCss": true
     }
   },
+  {
+    "name": "amp-image-slider",
+    "version": "1.0",
+    "latestVersion": "0.1",
+    "options": {
+      "hasCss": true,
+      "npm": true,
+      "bento": true
+    }
+  },
   {
     "name": "amp-image-viewer",
     "version": "0.1",
@@ -576,9 +600,7 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true,
-      "npm": true,
-      "bento": true
+      "hasCss": true
     }
   },
   {
@@ -599,9 +621,7 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true,
-      "npm": true,
-      "bento": true
+      "hasCss": true
     }
   },
   {
@@ -650,9 +670,7 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true,
-      "npm": true,
-      "bento": true
+      "hasCss": true
     }
   },
   {
@@ -668,9 +686,7 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true,
-      "npm": true,
-      "bento": true
+      "hasCss": true
     }
   },
   {
@@ -686,6 +702,15 @@
       "hasCss": true
     }
   },
+  {
+    "name": "amp-list",
+    "version": "1.0",
+    "options": {
+      "hasCss": false,
+      "npm": true,
+      "bento": true
+    }
+  },
   {
     "name": "amp-live-list",
     "version": "0.1",
@@ -811,6 +836,14 @@
       "hasCss": true
     }
   },
+  {
+    "name": "amp-pan-zoom",
+    "version": "1.0",
+    "options": {
+      "hasCss": true,
+      "bento": true
+    }
+  },
   {
     "name": "amp-pinterest",
     "version": "0.1",
@@ -960,9 +993,7 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true,
-      "npm": true,
-      "bento": true
+      "hasCss": true
     }
   },
   {
@@ -975,9 +1006,7 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true,
-      "npm": true,
-      "bento": true
+      "hasCss": true
     }
   },
   {
@@ -1180,9 +1209,7 @@
     "version": "1.0",
     "latestVersion": "0.1",
     "options": {
-      "hasCss": true,
-      "npm": true,
-      "bento": true
+      "hasCss": true
     }
   },
   {
diff --git a/extensions/amp-audio/validator-amp-audio.protoascii b/extensions/amp-audio/validator-amp-audio.protoascii
index 5c43088f78..c6a9e4d06d 100644
--- a/extensions/amp-audio/validator-amp-audio.protoascii
+++ b/extensions/amp-audio/validator-amp-audio.protoascii
@@ -1,9 +1,25 @@
-tags: {  # amp-audio
+tags: {  # amp-audio 1.0
+  html_format: AMP
+  tag_name: "SCRIPT"
+  satisfies: "amp-audio 1.0"
+  excludes: "amp-audio 0.1"
+  extension_spec: {
+    name: "amp-audio"
+    version_name: "v1.0"
+    version: "1.0"
+    bento_supported_version: "1.0"
+  }
+  attr_lists: "common-extension-attrs"
+}
+tags: {  # amp-audio 0.1
   html_format: AMP
   html_format: AMP4ADS
   tag_name: "SCRIPT"
+  satisfies: "amp-audio 0.1"
+  excludes: "amp-audio 1.0"
   extension_spec: {
     name: "amp-audio"
+    version_name: "v0.1"
     version: "0.1"
     version: "latest"
     deprecated_allow_duplicates: true
@@ -64,6 +80,7 @@ tags: {  # <amp-audio> for AMP (autoplay attribute allowed)
     defines_default_width: true
     supported_layouts: FIXED
     supported_layouts: FIXED_HEIGHT
+    supported_layouts: CONTAINER
     supported_layouts: NODISPLAY
   }
 }
diff --git a/extensions/amp-story-captions/validator-amp-story-captions.protoascii b/extensions/amp-story-captions/validator-amp-story-captions.protoascii
index 30e54b2ad2..579a2a35c7 100644
--- a/extensions/amp-story-captions/validator-amp-story-captions.protoascii
+++ b/extensions/amp-story-captions/validator-amp-story-captions.protoascii
@@ -44,4 +44,9 @@ tags: {  # <amp-story-captions>
   child_tags: {
     mandatory_num_child_tags: 0
   }
+  attrs: {
+    name: "style-preset"
+    value: "default"
+    value: "appear"
+  }
 }
diff --git a/extensions/amp-story-shopping/validator-amp-story-shopping.protoascii b/extensions/amp-story-shopping/validator-amp-story-shopping.protoascii
index ca7752c24d..b971f0426a 100644
--- a/extensions/amp-story-shopping/validator-amp-story-shopping.protoascii
+++ b/extensions/amp-story-shopping/validator-amp-story-shopping.protoascii
@@ -14,29 +14,62 @@ html_format: AMP
   tag_name: "AMP-STORY-SHOPPING-TAG"
   requires_extension: "amp-story-shopping"
   mandatory_ancestor: "AMP-STORY-GRID-LAYER"
-  attr_lists: "extended-amp-global"
   spec_url: "https://amp.dev/documentation/components/amp-story-shopping/"
   amp_layout: {
     supported_layouts: CONTAINER
   }
+  attrs: {
+    name: "data-product-id"
+    mandatory: true
   }
-tags: {  # <amp-story-shopping-config>
+}
+tags: {  # <amp-story-shopping-attachment>
   html_format: AMP
-  tag_name: "AMP-STORY-SHOPPING-CONFIG"
+  tag_name: "AMP-STORY-SHOPPING-ATTACHMENT"
   requires_extension: "amp-story-shopping"
-  attr_lists: "extended-amp-global"
+  mandatory_last_child: true
   spec_url: "https://amp.dev/documentation/components/amp-story-shopping/"
+  attrs: {
+    name: "src"
+    value_url: {
+      protocol: "https"
+      allow_relative: true
+    }
+  }
+  attrs: {
+    name: "theme"
+    value: "dark"
+    value: "light"
+  }
+  attrs: {
+    name: "cta-text"
+  }
+  child_tags: {
+    child_tag_name_oneof: "SCRIPT"
+    mandatory_min_num_child_tags: 1
+  }
   amp_layout: {
-    supported_layouts: NODISPLAY
+    supported_layouts: CONTAINER
   }
 }
-tags: {  # <amp-story-shopping-attachment>
+tags: { # amp-story-shopping-attachment
   html_format: AMP
-  tag_name: "AMP-STORY-SHOPPING-ATTACHMENT"
+  tag_name: "SCRIPT"
+  spec_name: "amp-story-shopping-attachment config script"
+  mandatory_parent: "AMP-STORY-SHOPPING-ATTACHMENT"
   requires_extension: "amp-story-shopping"
-  attr_lists: "extended-amp-global"
-  spec_url: "https://amp.dev/documentation/components/amp-story-shopping/"
-  amp_layout: {
-    supported_layouts: NODISPLAY
+  attrs: {
+    name: "type"
+    mandatory: true
+    value_casei: "application/json"
+    dispatch_key: NAME_VALUE_PARENT_DISPATCH
+  }
+  attr_lists: "nonce-attr"
+  cdata: {
+    disallowed_cdata_regex: {
+      regex: "<!--"
+      error_message: "html comments"
     }
   }
+  spec_url: "https://amp.dev/documentation/components/amp-story-shopping/"
+}
diff --git a/extensions/amp-story/validator-amp-story.protoascii b/extensions/amp-story/validator-amp-story.protoascii
index 2de8d71ae0..fe284b6506 100644
--- a/extensions/amp-story/validator-amp-story.protoascii
+++ b/extensions/amp-story/validator-amp-story.protoascii
@@ -137,6 +137,7 @@ tags: {  # <amp-story-page>
     child_tag_name_oneof: "AMP-STORY-GRID-LAYER"
     child_tag_name_oneof: "AMP-STORY-PAGE-ATTACHMENT"
     child_tag_name_oneof: "AMP-STORY-PAGE-OUTLINK"
+    child_tag_name_oneof: "AMP-STORY-SHOPPING-ATTACHMENT"
     mandatory_min_num_child_tags: 1
   }
 }
@@ -267,6 +268,12 @@ tags: {
     name: "translate-y"
     value_regex_casei: "[0-9]+px"
   }
+  attrs: {
+    name: "pan-scaling-factor"
+    # Allow float number such as "12.3", ".1", or "5."
+    # Note that string with only decimal point such as "." is not allowed.
+    value_regex_casei: "^([0-9]*[.]?[0-9]+)|([0-9]+[.]?[0-9]*)$"
+  }
   attrs: {
     name: "justify-content"
     value: "center"
@@ -362,6 +369,12 @@ tags: {
     name: "translate-y"
     value_regex_casei: "[0-9]+px"
   }
+  attrs: {
+    name: "pan-scaling-factor"
+    # Allow float number such as "12.3", ".1", or "5."
+    # Note that string with only decimal point such as "." is not allowed.
+    value_regex_casei: "^([0-9]*[.]?[0-9]+)|([0-9]+[.]?[0-9]*)$"
+  }
   reference_points: {
     tag_spec_name: "AMP-STORY-GRID-LAYER animate-in"
   }
@@ -566,6 +579,12 @@ tags: {
     name: "translate-y"
     value_regex_casei: "[0-9]+px"
   }
+  attrs: {
+    name: "pan-scaling-factor"
+    # Allow float number such as "12.3", ".1", or "5."
+    # Note that string with only decimal point such as "." is not allowed.
+    value_regex_casei: "^([0-9]*[.]?[0-9]+)|([0-9]+[.]?[0-9]*)$"
+  }
   reference_points: {
     tag_spec_name: "AMP-STORY-CTA-LAYER animate-in"
   }
@@ -715,6 +734,7 @@ descendant_tag_list: {
   tag: "AMP-STORY-INTERACTIVE-QUIZ"
   tag: "AMP-STORY-INTERACTIVE-RESULTS"
   tag: "AMP-STORY-PANNING-MEDIA"
+  tag: "AMP-STORY-SHOPPING-TAG"
   tag: "AMP-TIMEAGO"
   tag: "AMP-TWITTER"
   tag: "AMP-VIDEO"
diff --git a/extensions/amp-video/validator-amp-video.protoascii b/extensions/amp-video/validator-amp-video.protoascii
index 5a66a7dd18..321ca52d57 100644
--- a/extensions/amp-video/validator-amp-video.protoascii
+++ b/extensions/amp-video/validator-amp-video.protoascii
@@ -185,9 +185,8 @@ tags: {  # <amp-video> in amp-story
   }
   attrs: {
     name: "volume"
-    # Disallow 0 to prevent shipping unnecessary audio track when the video is muted.
-    # Volume must be in the range [0.1, 1].
-    value_regex: "^((0?\\.[1-9]+)?|1(\\.0*)?)$"
+    # Volume must be in the range [0, 1].
+    value_regex: "^(0(\\.0*)?|(0?\\.[0-9]+)?|1(\\.0*)?)$"
   }
   attr_lists: "extended-amp-global"
   attr_lists: "amp-video-common"
diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii
index c3b93c9496..3fa17525a3 100644
--- a/validator/validator-main.protoascii
+++ b/validator/validator-main.protoascii
@@ -2026,7 +2026,7 @@ tags: {
   spec_url: "https://amp.dev/documentation/components/amp-video/"
 }
 # 4.7.7 The audio element
-# Only allowed in noscript tags. Otherwise use amp-audio.
+# Allowed in noscript tags and inside amp-audio for server side rendering.
 tags: {
   html_format: AMP  # Disallowed in AMP4ADS because <noscript> is disallowed.
   tag_name: "AUDIO"
@@ -2048,6 +2048,14 @@ tags: {
   }
   spec_url: "https://amp.dev/documentation/components/amp-audio/"
 }
+tags: {
+  html_format: AMP  # Disallowed in AMP4ADS because <noscript> is disallowed.
+  tag_name: "AUDIO"
+  mandatory_ancestor: "AMP-AUDIO"
+  spec_name: "amp-audio > audio"
+  attrs: { name: "controls" }
+  spec_url: "https://amp.dev/documentation/components/amp-audio/"
+}
 # 4.7.7 The picture element
 # Only allowed in noscript tags which support img tags.
 tags: {

@westonruter westonruter added this to the v2.3 milestone Apr 26, 2022
@westonruter westonruter changed the title Update amphtml spec to 2203281422000 Update amphtml spec to 2204221712000 Apr 26, 2022
@westonruter westonruter force-pushed the update/amphtml-spec-2203281422000 branch from 0ebba05 to 024eaf0 Compare April 26, 2022 00:22
@westonruter westonruter marked this pull request as ready for review April 26, 2022 00:28
@github-actions
Copy link
Contributor

Plugin builds for 024eaf0 are ready 🛎️!

@westonruter westonruter merged commit f751041 into develop Apr 26, 2022
@westonruter westonruter deleted the update/amphtml-spec-2203281422000 branch April 26, 2022 07:52
@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelogged Whether the issue/PR has been added to release notes. Validation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants