-
Notifications
You must be signed in to change notification settings - Fork 384
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 allowed tags/attributes from spec in amphtml 1908162134430 #3084
Changes from 1 commit
4323eaa
c93cb0b
32a12a3
09c3323
0aee763
10a68a3
5c577e4
0a26f81
47df43c
6451ab3
651c6f5
2648d15
106ac09
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
*/ | ||
class AMP_Allowed_Tags_Generated { | ||
|
||
private static $spec_file_revision = 920; | ||
private static $spec_file_revision = 935; | ||
private static $minimum_validator_revision_required = 375; | ||
|
||
private static $descendant_tag_lists = array( | ||
|
@@ -492,7 +492,7 @@ class AMP_Allowed_Tags_Generated { | |
), | ||
'referrerpolicy' => array(), | ||
'rel' => array( | ||
'blacklisted_value_regex' => '(^|\\s)(components|dns-prefetch|import|manifest|preconnect|prefetch|preload|prerender|serviceworker|stylesheet|subresource|)(\\s|$)', | ||
'blacklisted_value_regex' => '(^|\\s)(components|dns-prefetch|import|manifest|preconnect|prefetch|preload|prerender|serviceworker|stylesheet|subresource)(\\s|$)', | ||
), | ||
'role' => array(), | ||
'tabindex' => array(), | ||
|
@@ -1356,7 +1356,6 @@ class AMP_Allowed_Tags_Generated { | |
5, | ||
), | ||
), | ||
'mandatory_ancestor' => 'form', | ||
'requires_extension' => array( | ||
'amp-autocomplete', | ||
), | ||
|
@@ -1857,6 +1856,9 @@ class AMP_Allowed_Tags_Generated { | |
'', | ||
), | ||
), | ||
'slide' => array( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The generator should probably be adapted to use short array syntax as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
'value_regex' => '[0-9]+', | ||
), | ||
'type' => array( | ||
'value' => array( | ||
'slides', | ||
|
@@ -1913,7 +1915,11 @@ class AMP_Allowed_Tags_Generated { | |
'', | ||
), | ||
), | ||
'slide' => array( | ||
'value_regex' => '[0-9]+', | ||
), | ||
'type' => array( | ||
'dispatch_key' => 2, | ||
'mandatory' => true, | ||
'value' => array( | ||
'carousel', | ||
|
@@ -1969,6 +1975,9 @@ class AMP_Allowed_Tags_Generated { | |
'', | ||
), | ||
), | ||
'slide' => array( | ||
'value_regex' => '[0-9]+', | ||
), | ||
'type' => array( | ||
'value' => array( | ||
'slides', | ||
|
@@ -2039,7 +2048,11 @@ class AMP_Allowed_Tags_Generated { | |
'', | ||
), | ||
), | ||
'slide' => array( | ||
'value_regex' => '[0-9]+', | ||
), | ||
'type' => array( | ||
'dispatch_key' => 2, | ||
'mandatory' => true, | ||
'value' => array( | ||
'carousel', | ||
|
@@ -2323,6 +2336,7 @@ class AMP_Allowed_Tags_Generated { | |
'offset-seconds' => array( | ||
'value_regex' => '-?\\d+', | ||
), | ||
'template' => array(), | ||
'timestamp-ms' => array( | ||
'value_regex' => '\\d+', | ||
), | ||
|
@@ -2472,6 +2486,7 @@ class AMP_Allowed_Tags_Generated { | |
'media' => array(), | ||
'min' => array(), | ||
'mode' => array( | ||
'dispatch_key' => 2, | ||
'mandatory' => true, | ||
'value_casei' => array( | ||
'overlay', | ||
|
@@ -2669,6 +2684,7 @@ class AMP_Allowed_Tags_Generated { | |
'value_regex' => '[0-9]+', | ||
), | ||
'mode' => array( | ||
'dispatch_key' => 2, | ||
'mandatory' => true, | ||
'value_casei' => array( | ||
'overlay', | ||
|
@@ -4796,7 +4812,6 @@ class AMP_Allowed_Tags_Generated { | |
'disallowed_ancestor' => array( | ||
'amp-story', | ||
), | ||
'mandatory_parent' => 'body', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. No longer does
|
||
'requires_extension' => array( | ||
'amp-sidebar', | ||
), | ||
|
@@ -5723,6 +5738,118 @@ class AMP_Allowed_Tags_Generated { | |
'spec_url' => 'https://amp.dev/documentation/components/amp-video', | ||
), | ||
), | ||
array( | ||
'attr_spec_list' => array( | ||
'album' => array(), | ||
'alt' => array(), | ||
'artist' => array(), | ||
'artwork' => array(), | ||
'attribution' => array(), | ||
'autoplay' => array( | ||
'value' => array( | ||
'', | ||
), | ||
), | ||
'controls' => array( | ||
'value' => array( | ||
'', | ||
), | ||
), | ||
'controlslist' => array(), | ||
'crossorigin' => array(), | ||
'data-amp-bind-album' => array(), | ||
'data-amp-bind-alt' => array(), | ||
'data-amp-bind-artist' => array(), | ||
'data-amp-bind-artwork' => array(), | ||
'data-amp-bind-attribution' => array(), | ||
'data-amp-bind-controls' => array(), | ||
'data-amp-bind-controlslist' => array(), | ||
'data-amp-bind-loop' => array(), | ||
'data-amp-bind-poster' => array(), | ||
'data-amp-bind-preload' => array(), | ||
'data-amp-bind-src' => array(), | ||
'data-amp-bind-title' => array(), | ||
'disableremoteplayback' => array( | ||
'value' => array( | ||
'', | ||
), | ||
), | ||
'dock' => array( | ||
'requires_extension' => array( | ||
'amp-video-docking', | ||
), | ||
), | ||
'lightbox' => array(), | ||
'lightbox-thumbnail-id' => array( | ||
'value_regex_casei' => '^[a-z][a-z\\d_-]*', | ||
), | ||
'loop' => array( | ||
'value' => array( | ||
'', | ||
), | ||
), | ||
'media' => array(), | ||
'muted' => array( | ||
'value' => array( | ||
'', | ||
), | ||
), | ||
'noaudio' => array( | ||
'value' => array( | ||
'', | ||
), | ||
), | ||
'noloading' => array( | ||
'value' => array( | ||
'', | ||
), | ||
), | ||
'object-fit' => array(), | ||
'object-position' => array(), | ||
'placeholder' => array(), | ||
'poster' => array(), | ||
'preload' => array( | ||
'value' => array( | ||
'auto', | ||
'metadata', | ||
'none', | ||
'', | ||
), | ||
), | ||
'rotate-to-fullscreen' => array( | ||
'value' => array( | ||
'', | ||
), | ||
), | ||
'src' => array( | ||
'blacklisted_value_regex' => '__amp_source_origin', | ||
'value_url' => array( | ||
'allow_relative' => true, | ||
'protocol' => array( | ||
'https', | ||
), | ||
), | ||
), | ||
), | ||
'tag_spec' => array( | ||
'also_requires_tag_warning' => array( | ||
'amp-video extension .js script', | ||
), | ||
'amp_layout' => array( | ||
'supported_layouts' => array( | ||
6, | ||
2, | ||
3, | ||
7, | ||
1, | ||
4, | ||
), | ||
), | ||
'mandatory_ancestor' => 'amp-story-page-attachment', | ||
'spec_name' => 'amp-story >> amp-story-page-attachment >> amp-video', | ||
'spec_url' => 'https://amp.dev/documentation/components/amp-video', | ||
), | ||
), | ||
array( | ||
'attr_spec_list' => array( | ||
'album' => array(), | ||
|
@@ -6525,6 +6652,21 @@ class AMP_Allowed_Tags_Generated { | |
), | ||
), | ||
), | ||
'canvas' => array( | ||
array( | ||
'attr_spec_list' => array( | ||
'height' => array(), | ||
'width' => array(), | ||
), | ||
'tag_spec' => array( | ||
'mandatory_ancestor' => 'amp-script', | ||
'requires_extension' => array( | ||
'amp-script', | ||
), | ||
'spec_url' => 'https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#html-tags', | ||
), | ||
), | ||
), | ||
'caption' => array( | ||
array( | ||
'attr_spec_list' => array(), | ||
|
@@ -7038,6 +7180,18 @@ class AMP_Allowed_Tags_Generated { | |
'spec_url' => 'https://amp.dev/documentation/components/amp-image-slider', | ||
), | ||
), | ||
array( | ||
'attr_spec_list' => array( | ||
'align' => array(), | ||
'fetch-error' => array( | ||
'mandatory' => true, | ||
), | ||
), | ||
'tag_spec' => array( | ||
'mandatory_ancestor' => 'amp-list', | ||
'spec_name' => 'AMP-LIST DIV [fetch-error]', | ||
), | ||
), | ||
), | ||
'dl' => array( | ||
array( | ||
|
@@ -8495,7 +8649,10 @@ class AMP_Allowed_Tags_Generated { | |
), | ||
), | ||
'height' => array(), | ||
'importance' => array(), | ||
'intrinsicsize' => array(), | ||
'ismap' => array(), | ||
'loading' => array(), | ||
'longdesc' => array( | ||
'blacklisted_value_regex' => '__amp_source_origin', | ||
'value_url' => array( | ||
|
@@ -8623,6 +8780,7 @@ class AMP_Allowed_Tags_Generated { | |
'data-amp-bind-size' => array(), | ||
'data-amp-bind-spellcheck' => array(), | ||
'data-amp-bind-step' => array(), | ||
'data-amp-bind-type' => array(), | ||
'data-amp-bind-value' => array(), | ||
'data-amp-bind-width' => array(), | ||
'disabled' => array(), | ||
|
@@ -8694,6 +8852,7 @@ class AMP_Allowed_Tags_Generated { | |
'data-amp-bind-size' => array(), | ||
'data-amp-bind-spellcheck' => array(), | ||
'data-amp-bind-step' => array(), | ||
'data-amp-bind-type' => array(), | ||
'data-amp-bind-value' => array(), | ||
'data-amp-bind-width' => array(), | ||
'disabled' => array(), | ||
|
@@ -9472,7 +9631,7 @@ class AMP_Allowed_Tags_Generated { | |
'hreflang' => array(), | ||
'media' => array(), | ||
'rel' => array( | ||
'blacklisted_value_regex' => '(^|\\s)(canonical|components|import|manifest|preload|serviceworker|stylesheet|subresource|)(\\s|$)', | ||
'blacklisted_value_regex' => '(^|\\s)(canonical|components|import|manifest|preload|serviceworker|stylesheet|subresource)(\\s|$)', | ||
'mandatory' => true, | ||
), | ||
'sizes' => array(), | ||
|
@@ -10168,6 +10327,24 @@ class AMP_Allowed_Tags_Generated { | |
'spec_name' => 'meta name=amp-recaptcha-input', | ||
), | ||
), | ||
array( | ||
'attr_spec_list' => array( | ||
'content' => array( | ||
'mandatory' => true, | ||
), | ||
'name' => array( | ||
'dispatch_key' => 2, | ||
'mandatory' => true, | ||
'value_casei' => array( | ||
'amp-script-src', | ||
), | ||
), | ||
), | ||
'tag_spec' => array( | ||
'mandatory_parent' => 'head', | ||
'spec_name' => 'meta name=amp-script-src', | ||
), | ||
), | ||
array( | ||
'attr_spec_list' => array( | ||
'content' => array(), | ||
|
@@ -12197,6 +12374,7 @@ class AMP_Allowed_Tags_Generated { | |
'requires_usage' => 2, | ||
'version' => array( | ||
'0.1', | ||
'0.2', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is suppressed by c93cb0b. |
||
'latest', | ||
), | ||
), | ||
|
@@ -15470,6 +15648,7 @@ class AMP_Allowed_Tags_Generated { | |
'font-weight' => array(), | ||
'glyph-orientation-horizontal' => array(), | ||
'glyph-orientation-vertical' => array(), | ||
'height' => array(), | ||
'image-rendering' => array(), | ||
'kerning' => array(), | ||
'letter-spacing' => array(), | ||
|
@@ -15503,6 +15682,7 @@ class AMP_Allowed_Tags_Generated { | |
'vector-effect' => array(), | ||
'viewbox' => array(), | ||
'visibility' => array(), | ||
'width' => array(), | ||
'word-spacing' => array(), | ||
'writing-mode' => array(), | ||
'xml:lang' => array(), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this come from? It does not seem to be the spec version this PR refers to (
1908162134430
).This is probably part of the data that is being retrieved when generating this file, but a comment as to where this is mirrored might be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from the AMP validator spec: https://github.com/ampproject/amphtml/blob/dad372c5c339b07302effbea75c28eae99a7a54e/validator/validator-main.protoascii#L17-L29
As you can see, it's not actually even used anywhere. We could remove it and the
$minimum_validator_revision_required
variable, as they are private.