diff --git a/.travis.yml b/.travis.yml index 647451c1326..9675ab1ab36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,31 +4,10 @@ language: php # Opt to use Travis container-based environment. sudo: false -# PHP version used in first build configuration. -php: - - "7.1" - -# WordPress version used in first build configuration. -env: - - WP_VERSION=latest - # Newer versions like trusty don't have PHP 5.2 or 5.3 # https://blog.travis-ci.com/2017-07-11-trusty-as-default-linux-is-coming dist: precise -# Next we define our matrix of additional build configurations to test against. -# The versions listed above will automatically create our first configuration, -# so it doesn't need to be re-defined below. - -# WP_VERSION specifies the tag to use. The way these tests are configured to run -# requires at least WordPress 3.8. Specify "latest" to test against SVN trunk. - -# Note that Travis CI supports listing these above to automatically build a -# matrix of configurations, but we're being nice here by manually building a -# total of four configurations even though we're testing 4 versions of PHP -# along with 2 versions of WordPress (which would build 8 configs otherwise). -# This takes half as long to run while still providing adequate coverage. - notifications: email: on_success: never @@ -44,19 +23,20 @@ matrix: include: - php: "5.3" env: WP_VERSION=latest DEV_LIB_SKIP=composer,phpcs - - php: "5.3" - env: WP_VERSION=4.7 DEV_LIB_SKIP=composer,phpcs - php: "5.4" - env: WP_VERSION=latest - - php: "5.4" - env: WP_VERSION=4.7 - - php: "7.0" - env: WP_VERSION=latest + env: WP_VERSION=4.7 DEV_LIB_SKIP=composer,phpcs + - php: "5.5" + env: WP_VERSION=latest DEV_LIB_SKIP=phpcs + - php: "5.6" + env: WP_VERSION=4.8 DEV_LIB_SKIP=phpcs + - php: "5.6" + env: WP_VERSION=latest DEV_LIB_SKIP=phpcs - php: "7.0" - env: WP_VERSION=4.7 - # 7.1 / latest already included above as first build. + env: WP_VERSION=latest DEV_LIB_SKIP=phpcs - php: "7.1" - env: WP_VERSION=4.7 + env: WP_VERSION=latest DEV_LIB_SKIP=phpcs + - php: "7.2" + env: WP_VERSION=trunk install: - if [[ $DEV_LIB_SKIP =~ composer ]]; then composer install --no-dev; fi diff --git a/includes/amp-frontend-actions.php b/includes/amp-frontend-actions.php index f62b93f6b70..f5d7ebca13d 100644 --- a/includes/amp-frontend-actions.php +++ b/includes/amp-frontend-actions.php @@ -10,23 +10,31 @@ /** * Add amphtml link to frontend. * + * @todo This function's name is incorrect. It's not about adding a canonical link but adding the amphtml link. + * * @since 0.2 */ function amp_frontend_add_canonical() { - // Prevent showing amphtml link if theme supports AMP but paired mode is not available. - if ( current_theme_supports( 'amp' ) && ! AMP_Theme_Support::is_paired_available() ) { - return; - } - /** * Filters whether to show the amphtml link on the frontend. * + * @todo This filter's name is incorrect. It's not about adding a canonical link but adding the amphtml link. * @since 0.2 */ if ( false === apply_filters( 'amp_frontend_show_canonical', true ) ) { return; } - printf( '', esc_url( amp_get_permalink( get_queried_object_id() ) ) ); + $amp_url = null; + if ( is_singular() ) { + $amp_url = amp_get_permalink( get_queried_object_id() ); + } elseif ( isset( $_SERVER['REQUEST_URI'] ) ) { + $host_url = preg_replace( '#(^https?://[^/]+)/.*#', '$1', home_url( '/' ) ); + $self_url = esc_url_raw( $host_url . wp_unslash( $_SERVER['REQUEST_URI'] ) ); + $amp_url = add_query_arg( amp_get_slug(), '', $self_url ); + } + if ( $amp_url ) { + printf( '', esc_url( $amp_url ) ); + } } diff --git a/includes/class-amp-theme-support.php b/includes/class-amp-theme-support.php index 59d08e5a6d4..01207b645ca 100644 --- a/includes/class-amp-theme-support.php +++ b/includes/class-amp-theme-support.php @@ -89,7 +89,6 @@ public static function init() { self::purge_amp_query_vars(); self::handle_xhr_request(); - self::add_temporary_discussion_restrictions(); require_once AMP__DIR__ . '/includes/amp-post-template-actions.php'; @@ -121,7 +120,13 @@ public static function init() { */ public static function finish_init() { if ( ! is_amp_endpoint() ) { - amp_add_frontend_actions(); + // Add amphtml link when paired mode is available. + if ( self::is_paired_available() ) { + amp_add_frontend_actions(); // @todo This function is poor in how it requires a file that then does add_action(). + if ( ! has_action( 'wp_head', 'amp_frontend_add_canonical' ) ) { + add_action( 'wp_head', 'amp_frontend_add_canonical' ); + } + } return; } @@ -228,9 +233,7 @@ public static function add_hooks() { add_action( 'wp_head', 'amp_add_generator_metadata', 20 ); add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) ); - if ( is_customize_preview() ) { - add_action( 'wp_enqueue_scripts', array( __CLASS__, 'dequeue_customize_preview_scripts' ), 1000 ); - } + add_action( 'wp_enqueue_scripts', array( __CLASS__, 'dequeue_customize_preview_scripts' ), 1000 ); add_filter( 'customize_partial_render', array( __CLASS__, 'filter_customize_partial_render' ) ); add_action( 'wp_footer', 'amp_print_analytics' ); @@ -248,12 +251,13 @@ public static function add_hooks() { add_action( 'template_redirect', array( __CLASS__, 'start_output_buffering' ), 0 ); // Commenting hooks. - add_filter( 'wp_list_comments_args', array( __CLASS__, 'amp_set_comments_walker' ), PHP_INT_MAX ); + add_filter( 'wp_list_comments_args', array( __CLASS__, 'set_comments_walker' ), PHP_INT_MAX ); add_filter( 'comment_form_defaults', array( __CLASS__, 'filter_comment_form_defaults' ) ); add_filter( 'comment_reply_link', array( __CLASS__, 'filter_comment_reply_link' ), 10, 4 ); add_filter( 'cancel_comment_reply_link', array( __CLASS__, 'filter_cancel_comment_reply_link' ), 10, 3 ); add_action( 'comment_form', array( __CLASS__, 'amend_comment_form' ), 100 ); remove_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); + add_filter( 'wp_kses_allowed_html', array( __CLASS__, 'whitelist_layout_in_wp_kses_allowed_html' ), 10 ); if ( AMP_Validation_Utils::should_validate_response() ) { AMP_Validation_Utils::add_validation_hooks(); @@ -496,35 +500,6 @@ public static function intercept_post_request_redirect( $location ) { wp_send_json_success(); } - /** - * Set up some restrictions for commenting based on amp-live-list limitations. - * - * Temporarily force comments to be listed in descending order. - * The following hooks are temporary while waiting for amphtml#5396 to be resolved. - * - * @link https://github.com/ampproject/amphtml/issues/5396 - */ - protected static function add_temporary_discussion_restrictions() { - add_filter( 'option_comment_order', function() { - return 'desc'; - }, PHP_INT_MAX ); - - add_action( 'admin_print_footer_scripts-options-discussion.php', function() { - ?> -

support ascending comments with newer entries appearing at the bottom.', 'amp' ) ); ?>

- - attributes for wp_kses(). + * + * @since 0.7 + * + * @param array $context Allowed tags and their allowed attributes. + * @return array $context Filtered allowed tags and attributes. + */ + public static function whitelist_layout_in_wp_kses_allowed_html( $context ) { + if ( ! empty( $context['img']['width'] ) && ! empty( $context['img']['height'] ) ) { + $context['img']['data-amp-layout'] = true; + } + + return $context; + } + /** * Enqueue AMP assets if this is an AMP endpoint. * diff --git a/includes/sanitizers/class-amp-allowed-tags-generated.php b/includes/sanitizers/class-amp-allowed-tags-generated.php index c7d8f0c357a..f666c891ae0 100644 --- a/includes/sanitizers/class-amp-allowed-tags-generated.php +++ b/includes/sanitizers/class-amp-allowed-tags-generated.php @@ -13,8 +13,8 @@ */ class AMP_Allowed_Tags_Generated { - private static $spec_file_revision = 566; - private static $minimum_validator_revision_required = 314; + private static $spec_file_revision = 595; + private static $minimum_validator_revision_required = 322; private static $allowed_tags = array( 'a' => array( @@ -34,6 +34,7 @@ class AMP_Allowed_Tags_Generated { 'http', 'https', 'mailto', + 'maps', 'bbmi', 'fb-messenger', 'intent', @@ -53,6 +54,7 @@ class AMP_Allowed_Tags_Generated { 'hreflang' => array(), 'media' => array(), 'name' => array(), + 'referrerpolicy' => array(), 'rel' => array( 'blacklisted_value_regex' => '(^|\\s)(components|dns-prefetch|import|manifest|preconnect|prefetch|preload|prerender|serviceworker|stylesheet|subresource|)(\\s|$)', ), @@ -115,6 +117,9 @@ class AMP_Allowed_Tags_Generated { 'disable-session-states' => array( 'value' => '', ), + 'expand-single-section' => array( + 'value' => '', + ), ), 'tag_spec' => array( 'requires_extension' => array( @@ -143,6 +148,7 @@ class AMP_Allowed_Tags_Generated { ), ), ), + 'template' => array(), 'type' => array( 'mandatory' => true, ), @@ -471,6 +477,32 @@ class AMP_Allowed_Tags_Generated { ), ), ), + 'amp-beopinion' => array( + array( + 'attr_spec_list' => array( + 'data-account' => array( + 'mandatory' => true, + 'value_regex_casei' => '[0-9a-f]{24}', + ), + 'data-content' => array( + 'value_regex_casei' => '[0-9a-f]{24}', + ), + 'data-my-content' => array( + 'value_regex' => '0|1', + ), + 'data-name' => array(), + 'media' => array(), + 'noloading' => array( + 'value' => '', + ), + ), + 'tag_spec' => array( + 'requires_extension' => array( + 'amp-beopinion', + ), + ), + ), + ), 'amp-bind-macro' => array( array( 'attr_spec_list' => array( @@ -490,6 +522,33 @@ class AMP_Allowed_Tags_Generated { ), ), ), + 'amp-bodymovin-animation' => array( + array( + 'attr_spec_list' => array( + 'loop' => array( + 'value_regex_casei' => '(false|number|true)', + ), + 'noautoplay' => array( + 'value' => '', + ), + 'src' => array( + 'mandatory' => true, + 'value_url' => array( + 'allow_relative' => false, + 'allowed_protocol' => array( + 'https', + ), + ), + ), + ), + 'tag_spec' => array( + 'requires_extension' => array( + 'amp-bodymovin-animation', + ), + 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-bodymovin-animation', + ), + ), + ), 'amp-brid-player' => array( array( 'attr_spec_list' => array( @@ -613,6 +672,13 @@ class AMP_Allowed_Tags_Generated { 'dots' => array( 'value' => '', ), + 'lightbox' => array(), + 'lightbox-exclude' => array( + 'value' => '', + ), + 'lightbox-thumbnail-id' => array( + 'value_regex_casei' => '^[a-z][a-z\\d_-]*', + ), 'loop' => array( 'value' => '', ), @@ -632,6 +698,22 @@ class AMP_Allowed_Tags_Generated { ), ), ), + 'amp-consent' => array( + array( + 'attr_spec_list' => array( + 'media' => array(), + 'noloading' => array( + 'value' => '', + ), + ), + 'tag_spec' => array( + 'requires_extension' => array( + 'amp-consent', + ), + 'unique' => true, + ), + ), + ), 'amp-dailymotion' => array( array( 'attr_spec_list' => array( @@ -674,6 +756,256 @@ class AMP_Allowed_Tags_Generated { ), ), ), + 'amp-date-picker' => array( + array( + 'attr_spec_list' => array( + 'allow-blocked-ranges' => array( + 'value' => '', + ), + 'blocked' => array(), + 'day-size' => array( + 'value_regex' => '[0-9]+', + ), + 'first-day-of-week' => array( + 'value_regex' => '[0-6]', + ), + 'format' => array(), + 'fullscreen' => array( + 'value' => '', + ), + 'highlighted' => array(), + 'input-selector' => array(), + 'locale' => array(), + 'max' => array(), + 'media' => array(), + 'min' => array(), + 'mode' => array( + 'value_casei' => 'static', + ), + 'month-format' => array(), + 'noloading' => array( + 'value' => '', + ), + 'number-of-months' => array( + 'value_regex' => '[0-9]+', + ), + 'open-after-clear' => array( + 'value' => '', + ), + 'open-after-select' => array( + 'value' => '', + ), + 'src' => array( + 'blacklisted_value_regex' => '__amp_source_origin', + 'value_url' => array( + 'allow_relative' => true, + 'allowed_protocol' => array( + 'https', + ), + ), + ), + 'type' => array( + 'value_casei' => 'single', + ), + 'week-day-format' => array(), + ), + 'tag_spec' => array( + 'requires_extension' => array( + 'amp-date-picker', + ), + 'spec_name' => 'amp-date-picker[type=single][mode=static]', + ), + ), + array( + 'attr_spec_list' => array( + 'allow-blocked-ranges' => array( + 'value' => '', + ), + 'blocked' => array(), + 'day-size' => array( + 'value_regex' => '[0-9]+', + ), + 'first-day-of-week' => array( + 'value_regex' => '[0-6]', + ), + 'format' => array(), + 'highlighted' => array(), + 'input-selector' => array(), + 'locale' => array(), + 'max' => array(), + 'media' => array(), + 'min' => array(), + 'mode' => array( + 'mandatory' => true, + 'value_casei' => 'overlay', + ), + 'month-format' => array(), + 'noloading' => array( + 'value' => '', + ), + 'number-of-months' => array( + 'value_regex' => '[0-9]+', + ), + 'open-after-clear' => array( + 'value' => '', + ), + 'open-after-select' => array( + 'value' => '', + ), + 'src' => array( + 'blacklisted_value_regex' => '__amp_source_origin', + 'value_url' => array( + 'allow_relative' => true, + 'allowed_protocol' => array( + 'https', + ), + ), + ), + 'type' => array( + 'value_casei' => 'single', + ), + 'week-day-format' => array(), + ), + 'tag_spec' => array( + 'requires_extension' => array( + 'amp-date-picker', + ), + 'spec_name' => 'amp-date-picker[type=single][mode=overlay]', + ), + ), + array( + 'attr_spec_list' => array( + 'allow-blocked-ranges' => array( + 'value' => '', + ), + 'blocked' => array(), + 'day-size' => array( + 'value_regex' => '[0-9]+', + ), + 'end-input-selector' => array(), + 'first-day-of-week' => array( + 'value_regex' => '[0-6]', + ), + 'format' => array(), + 'fullscreen' => array( + 'value' => '', + ), + 'highlighted' => array(), + 'locale' => array(), + 'max' => array(), + 'media' => array(), + 'min' => array(), + 'mode' => array( + 'value_casei' => 'static', + ), + 'month-format' => array(), + 'noloading' => array( + 'value' => '', + ), + 'number-of-months' => array( + 'value_regex' => '[0-9]+', + ), + 'open-after-clear' => array( + 'value' => '', + ), + 'open-after-select' => array( + 'value' => '', + ), + 'src' => array( + 'blacklisted_value_regex' => '__amp_source_origin', + 'value_url' => array( + 'allow_relative' => true, + 'allowed_protocol' => array( + 'https', + ), + ), + ), + 'start-input-selector' => array(), + 'type' => array( + 'mandatory' => true, + 'value_casei' => 'range', + ), + 'week-day-format' => array(), + ), + 'tag_spec' => array( + 'requires_extension' => array( + 'amp-date-picker', + ), + 'spec_name' => 'amp-date-picker[type=range][mode=static]', + ), + ), + array( + 'attr_spec_list' => array( + 'allow-blocked-ranges' => array( + 'value' => '', + ), + 'blocked' => array(), + 'day-size' => array( + 'value_regex' => '[0-9]+', + ), + 'end-input-selector' => array(), + 'first-day-of-week' => array( + 'value_regex' => '[0-6]', + ), + 'format' => array(), + 'highlighted' => array(), + 'locale' => array(), + 'max' => array(), + 'media' => array(), + 'min' => array(), + 'mode' => array( + 'mandatory' => true, + 'value_casei' => 'overlay', + ), + 'month-format' => array(), + 'noloading' => array( + 'value' => '', + ), + 'number-of-months' => array( + 'value_regex' => '[0-9]+', + ), + 'open-after-clear' => array( + 'value' => '', + ), + 'open-after-select' => array( + 'value' => '', + ), + 'src' => array( + 'blacklisted_value_regex' => '__amp_source_origin', + 'value_url' => array( + 'allow_relative' => true, + 'allowed_protocol' => array( + 'https', + ), + ), + ), + 'start-input-selector' => array(), + 'type' => array( + 'mandatory' => true, + 'value_casei' => 'range', + ), + 'week-day-format' => array(), + ), + 'tag_spec' => array( + 'requires_extension' => array( + 'amp-date-picker', + ), + 'spec_name' => 'amp-date-picker[type=range][mode=overlay]', + ), + ), + ), + 'amp-document-recommendations' => array( + array( + 'attr_spec_list' => array(), + 'tag_spec' => array( + 'mandatory_parent' => 'body', + 'requires_extension' => array( + 'amp-document-recommendations', + ), + 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-document-recommendations', + ), + ), + ), 'amp-embed' => array( array( 'attr_spec_list' => array( @@ -693,6 +1025,7 @@ class AMP_Allowed_Tags_Generated { ), ), ), + 'template' => array(), 'type' => array( 'mandatory' => true, ), @@ -1028,6 +1361,9 @@ class AMP_Allowed_Tags_Generated { 'amp-ima-video' => array( array( 'attr_spec_list' => array( + 'autoplay' => array( + 'value' => '', + ), 'data-src' => array( 'blacklisted_value_regex' => '__amp_source_origin', 'value_url' => array( @@ -1084,6 +1420,13 @@ class AMP_Allowed_Tags_Generated { '[srcset]' => array(), 'alt' => array(), 'attribution' => array(), + 'lightbox' => array(), + 'lightbox-exclude' => array( + 'value' => '', + ), + 'lightbox-thumbnail-id' => array( + 'value_regex_casei' => '^[a-z][a-z\\d_-]*', + ), 'media' => array(), 'noloading' => array( 'value' => '', @@ -1278,6 +1621,9 @@ class AMP_Allowed_Tags_Generated { 'noloading' => array( 'value' => '', ), + 'reset-on-refresh' => array( + 'value' => '', + ), 'single-item' => array(), 'src' => array( 'blacklisted_value_regex' => '__amp_source_origin', @@ -1297,6 +1643,37 @@ class AMP_Allowed_Tags_Generated { ), ), ), + array( + 'attr_spec_list' => array( + '[src]' => array( + 'mandatory' => true, + ), + 'credentials' => array(), + 'items' => array(), + 'max-items' => array(), + 'media' => array(), + 'noloading' => array( + 'value' => '', + ), + 'single-item' => array(), + 'src' => array( + 'blacklisted_value_regex' => '__amp_source_origin', + 'value_url' => array( + 'allow_relative' => true, + 'allowed_protocol' => array( + 'https', + ), + ), + ), + 'template' => array(), + ), + 'tag_spec' => array( + 'requires_extension' => array( + 'amp-list', + ), + 'spec_name' => 'AMP-LIST [SRC]', + ), + ), ), 'amp-live-list' => array( array( @@ -1314,6 +1691,9 @@ class AMP_Allowed_Tags_Generated { 'id' => array( 'mandatory' => true, ), + 'sort' => array( + 'value_regex' => 'ascending', + ), ), 'tag_spec' => array( 'requires_extension' => array( @@ -1825,6 +2205,27 @@ class AMP_Allowed_Tags_Generated { ), ), ), + 'amp-story-auto-ads' => array( + array( + 'attr_spec_list' => array(), + 'tag_spec' => array( + 'mandatory_parent' => 'amp-story', + 'requires_extension' => array( + 'amp-story-auto-ads', + ), + 'spec_url' => 'https://github.com/ampproject/amphtml/blob/master/extensions/amp-story/amp-story-auto-ads.md', + 'unique' => true, + ), + ), + ), + 'amp-story-cta-layer' => array( + array( + 'attr_spec_list' => array(), + 'tag_spec' => array( + 'mandatory_ancestor' => 'amp-story-page', + ), + ), + ), 'amp-story-grid-layer' => array( array( 'attr_spec_list' => array( @@ -1971,6 +2372,13 @@ class AMP_Allowed_Tags_Generated { 'disableremoteplayback' => array( 'value' => '', ), + 'lightbox' => array(), + 'lightbox-exclude' => array( + 'value' => '', + ), + 'lightbox-thumbnail-id' => array( + 'value_regex_casei' => '^[a-z][a-z\\d_-]*', + ), 'loop' => array( 'value' => '', ), @@ -2228,6 +2636,13 @@ class AMP_Allowed_Tags_Generated { 'data-videoid' => array( 'value_regex' => '[^=/?:]+', ), + 'lightbox' => array(), + 'lightbox-exclude' => array( + 'value' => '', + ), + 'lightbox-thumbnail-id' => array( + 'value_regex_casei' => '^[a-z][a-z\\d_-]*', + ), 'media' => array(), 'noloading' => array( 'value' => '', @@ -4684,7 +5099,7 @@ class AMP_Allowed_Tags_Generated { 'hreflang' => array(), 'media' => array(), 'rel' => array( - 'blacklisted_value_regex' => '(^|\\s)(canonical|components|import|manifest|serviceworker|stylesheet|subresource|)(\\s|$)', + 'blacklisted_value_regex' => '(^|\\s)(canonical|components|import|manifest|preload|serviceworker|stylesheet|subresource|)(\\s|$)', 'mandatory' => true, ), 'sizes' => array(), @@ -4770,13 +5185,41 @@ class AMP_Allowed_Tags_Generated { 'spec_url' => 'https://www.ampproject.org/docs/reference/spec#html-tags', ), ), + array( + 'attr_spec_list' => array( + 'as' => array(), + 'charset' => array( + 'value_casei' => 'utf-8', + ), + 'color' => array(), + 'crossorigin' => array(), + 'href' => array(), + 'hreflang' => array(), + 'media' => array(), + 'rel' => array( + 'dispatch_key' => 2, + 'mandatory' => true, + 'value_casei' => 'preload', + ), + 'sizes' => array(), + 'target' => array(), + 'type' => array(), + ), + 'tag_spec' => array( + 'disallowed_ancestor' => array( + 'template', + ), + 'spec_name' => 'link rel=preload', + 'spec_url' => 'https://www.ampproject.org/docs/reference/spec#html-tags', + ), + ), array( 'attr_spec_list' => array( 'async' => array(), 'crossorigin' => array(), 'href' => array( 'mandatory' => true, - 'value_regex' => 'https://cdn\\.materialdesignicons\\.com/([0-9]+\\.?)+/css/materialdesignicons\\.min\\.css|https://cloud\\.typography\\.com/[0-9]*/[0-9]*/css/fonts\\.css|https://fast\\.fonts\\.net/.*|https://fonts\\.googleapis\\.com/css\\?.*|https://fonts\\.googleapis\\.com/icon\\?.*|https://fonts\\.googleapis\\.com/earlyaccess/.*\\.css|https://maxcdn\\.bootstrapcdn\\.com/font-awesome/([0-9]+\\.?)+/css/font-awesome\\.min\\.css(\\?.*)?|https://use\\.typekit\\.net/[\\w\\p{L}\\p{N}_]+\\.css', + 'value_regex' => 'https://cdn\\.materialdesignicons\\.com/([0-9]+\\.?)+/css/materialdesignicons\\.min\\.css|https://cloud\\.typography\\.com/[0-9]*/[0-9]*/css/fonts\\.css|https://fast\\.fonts\\.net/.*|https://fonts\\.googleapis\\.com/css\\?.*|https://fonts\\.googleapis\\.com/icon\\?.*|https://fonts\\.googleapis\\.com/earlyaccess/.*\\.css|https://maxcdn\\.bootstrapcdn\\.com/font-awesome/([0-9]+\\.?)+/css/font-awesome\\.min\\.css(\\?.*)?|https://use\\.fontawesome\\.com/releases/v([0-9]+\\.?)+/css/(all|brands|solids|fontawesome)\\.css|https://use\\.typekit\\.net/[\\w\\p{L}\\p{N}_]+\\.css', ), 'integrity' => array(), 'media' => array(), @@ -5264,6 +5707,7 @@ class AMP_Allowed_Tags_Generated { 'blacklisted_value_regex' => '(^|\\s)(amp-.*|amp4ads-.*|apple-itunes-app|content-disposition|revisit-after|viewport)(\\s|$)', ), 'property' => array(), + 'scheme' => array(), ), 'tag_spec' => array( 'spec_name' => 'meta name= and content=', @@ -5408,6 +5852,24 @@ class AMP_Allowed_Tags_Generated { 'spec_url' => 'https://www.ampproject.org/docs/reference/spec#html-tags', ), ), + array( + 'attr_spec_list' => array( + 'content' => array( + 'mandatory' => true, + 'value_regex_casei' => '(off|on)', + ), + 'http-equiv' => array( + 'dispatch_key' => 2, + 'mandatory' => true, + 'value_casei' => 'x-dns-prefetch-control', + ), + ), + 'tag_spec' => array( + 'mandatory_ancestor' => 'head', + 'spec_name' => 'meta http-equiv=x-dns-prefetch-control', + 'spec_url' => 'https://www.ampproject.org/docs/reference/spec#html-tags', + ), + ), array( 'attr_spec_list' => array( 'content' => array( @@ -5424,6 +5886,23 @@ class AMP_Allowed_Tags_Generated { 'spec_name' => 'meta name=amp-ad-enable-refresh', ), ), + array( + 'attr_spec_list' => array( + 'content' => array( + 'mandatory' => true, + ), + 'name' => array( + 'dispatch_key' => 2, + 'mandatory' => true, + 'value_casei' => 'amp-to-amp-navigation', + ), + ), + 'tag_spec' => array( + 'mandatory_parent' => 'head', + 'spec_name' => 'meta name=amp-to-amp-navigation', + 'unique' => true, + ), + ), ), 'metadata' => array( array( @@ -6571,7 +7050,162 @@ class AMP_Allowed_Tags_Generated { '0.1', 'latest', ), - 'name' => 'amp-animation', + 'name' => 'amp-animation', + ), + ), + ), + array( + 'attr_spec_list' => array( + 'nonce' => array(), + 'type' => array( + 'dispatch_key' => 3, + 'mandatory' => true, + 'value_casei' => 'application/json', + ), + ), + 'cdata' => array( + 'blacklisted_cdata_regex' => array( + 'error_message' => 'html comments', + 'regex' => '