From 51d81abf7ffa3897dbc7fd4c991eb407d14eb942 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 20 Feb 2019 12:29:31 -0800 Subject: [PATCH] Exclude transformed AMP from spec until SSR implemented --- bin/amphtml-update.py | 4 + .../class-amp-allowed-tags-generated.php | 133 ------------------ 2 files changed, 4 insertions(+), 133 deletions(-) diff --git a/bin/amphtml-update.py b/bin/amphtml-update.py index 6ca21dd3c84..3c93972eab7 100644 --- a/bin/amphtml-update.py +++ b/bin/amphtml-update.py @@ -356,6 +356,10 @@ def ParseRules(out_dir): if tag_spec.HasField('deprecation'): continue + # Ignore transformed AMP for now. + if '(transformed)' in tag_spec.spec_name: + continue + # Handle the special $REFERENCE_POINT tag if '$REFERENCE_POINT' == tag_spec.tag_name: reference_points[ tag_spec.spec_name ] = GetTagSpec(tag_spec, attr_lists) diff --git a/includes/sanitizers/class-amp-allowed-tags-generated.php b/includes/sanitizers/class-amp-allowed-tags-generated.php index b78ea27aaab..be4d33c8029 100644 --- a/includes/sanitizers/class-amp-allowed-tags-generated.php +++ b/includes/sanitizers/class-amp-allowed-tags-generated.php @@ -9649,15 +9649,6 @@ class AMP_Allowed_Tags_Generated { 'unique' => true, ), ), - array( - 'attr_spec_list' => array(), - 'tag_spec' => array( - 'mandatory_parent' => 'head', - 'spec_name' => 'noscript enclosure for boilerplate (transformed)', - 'spec_url' => 'https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md', - 'unique' => true, - ), - ), array( 'attr_spec_list' => array(), 'tag_spec' => array( @@ -13979,65 +13970,6 @@ class AMP_Allowed_Tags_Generated { 'unique' => true, ), ), - array( - 'attr_spec_list' => array( - 'amp-custom' => array( - 'mandatory' => true, - 'value' => array( - '', - ), - ), - 'nonce' => array(), - 'type' => array( - 'value_casei' => array( - 'text/css', - ), - ), - ), - 'cdata' => array( - 'blacklisted_cdata_regex' => array( - 'error_message' => 'CSS !important', - 'regex' => '!important', - ), - 'css_spec' => array( - 'allowed_at_rules' => array( - 'font-face', - 'keyframes', - 'media', - 'page', - 'supports', - ), - 'declaration' => array(), - 'font_url_spec' => array( - 'allow_empty' => true, - 'protocol' => array( - 'https', - 'http', - 'data', - ), - ), - 'image_url_spec' => array( - 'allow_empty' => true, - 'protocol' => array( - 'https', - 'http', - 'data', - 'absolute', - ), - ), - 'validate_keyframes' => false, - ), - 'max_bytes' => 50000, - 'max_bytes_spec_url' => 'https://www.ampproject.org/docs/reference/spec#maximum-size', - 'url_bytes_included' => false, - ), - 'tag_spec' => array( - 'mandatory_parent' => 'head', - 'spec_name' => 'style amp-custom (transformed)', - 'spec_url' => 'https://www.ampproject.org/docs/reference/spec#stylesheets', - 'unique' => true, - ), - ), array( 'attr_spec_list' => array( 'amp-boilerplate' => array( @@ -14060,27 +13992,6 @@ class AMP_Allowed_Tags_Generated { 'unique' => true, ), ), - array( - 'attr_spec_list' => array( - 'amp-boilerplate' => array( - 'dispatch_key' => 3, - 'mandatory' => true, - 'value' => array( - '', - ), - ), - 'nonce' => array(), - ), - 'cdata' => array( - 'cdata_regex' => '\\s*body\\s*{\\s*-webkit-animation:\\s*-amp-start\\s+8s\\s+steps\\(1,\\s*end\\)\\s+0s\\s+1\\s+normal\\s+both;\\s*-moz-animation:\\s*-amp-start\\s+8s\\s+steps\\s*\\(1\\s*,\\s*end\\s*\\)\\s+0s\\s+1\\s+normal\\s+both;\\s*-ms-animation:\\s*-amp-start\\s+8s\\s+steps\\s*\\(1\\s*,\\s*end\\s*\\)\\s+0s\\s+1\\s+normal\\s+both;\\s*animation:\\s*-amp-start\\s+8s\\s+steps\\(1,\\s*end\\)\\s+0s\\s+1\\s+normal\\s+both;?\\s*}\\s*@-webkit-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@-moz-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@-ms-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@-o-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*', - ), - 'tag_spec' => array( - 'mandatory_parent' => 'head', - 'spec_name' => 'head > style[amp-boilerplate] (transformed)', - 'spec_url' => 'https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md', - 'unique' => true, - ), - ), array( 'attr_spec_list' => array( 'amp-boilerplate' => array( @@ -14104,28 +14015,6 @@ class AMP_Allowed_Tags_Generated { 'unique' => true, ), ), - array( - 'attr_spec_list' => array( - 'amp-boilerplate' => array( - 'dispatch_key' => 3, - 'mandatory' => true, - 'value' => array( - '', - ), - ), - 'nonce' => array(), - ), - 'cdata' => array( - 'cdata_regex' => '\\s*body\\s*{\\s*-webkit-animation:\\s*none;\\s*-moz-animation:\\s*none;\\s*-ms-animation:\\s*none;\\s*animation:\\s*none;?\\s*}\\s*', - ), - 'tag_spec' => array( - 'mandatory_ancestor' => 'head', - 'mandatory_parent' => 'noscript', - 'spec_name' => 'noscript > style[amp-boilerplate] (transformed)', - 'spec_url' => 'https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md', - 'unique' => true, - ), - ), array( 'attr_spec_list' => array( 'amp-keyframes' => array( @@ -14163,28 +14052,6 @@ class AMP_Allowed_Tags_Generated { 'unique' => true, ), ), - array( - 'attr_spec_list' => array( - 'amp-runtime' => array( - 'dispatch_key' => 3, - 'mandatory' => true, - 'value' => array( - '', - ), - ), - 'i-amphtml-version' => array( - 'mandatory' => true, - 'value_regex' => '^\\d{15}|latest$', - ), - ), - 'tag_spec' => array( - 'mandatory' => true, - 'mandatory_parent' => 'head', - 'spec_name' => 'style[amp-runtime] (transformed)', - 'spec_url' => 'https://www.ampproject.org/docs/reference/spec#stylesheets', - 'unique' => true, - ), - ), ), 'sub' => array( array(