From 54ec894ee6e4d66984d231fe06d8e6c44f15a280 Mon Sep 17 00:00:00 2001 From: jimwills Date: Wed, 14 Nov 2018 16:39:34 +0000 Subject: [PATCH 1/8] DD-753 added updated validator-generated.php --- src/Spec/validator-generated.php | 15781 +++++++++++++++++++++-------- 1 file changed, 11505 insertions(+), 4276 deletions(-) diff --git a/src/Spec/validator-generated.php b/src/Spec/validator-generated.php index 082bb58a..2667840d 100644 --- a/src/Spec/validator-generated.php +++ b/src/Spec/validator-generated.php @@ -38,11 +38,14 @@ class AmpLayoutLayout { const CONTAINER = 'CONTAINER'; const FILL = 'FILL'; const FLEX_ITEM = 'FLEX_ITEM'; + const FLUID = 'FLUID'; + const INTRINSIC = 'INTRINSIC'; } class AtRuleSpec { public $name = null; public $type = null; + public $media_query_spec = null; } class AtRuleSpecBlockType { @@ -62,7 +65,9 @@ class AttrSpec { public $alternative_names = []; public $mandatory = null; public $mandatory_oneof = null; - public $value = null; + public $mandatory_anyof = null; + public $value = []; + public $value_casei = []; public $value_regex = null; public $value_regex_casei = null; public $value_url = null; @@ -71,10 +76,19 @@ class AttrSpec { public $blacklisted_value_regex = null; public $deprecation = null; public $deprecation_url = null; + public $css_declaration = []; public $dispatch_key = null; public $implicit = null; + public $requires_extension = []; } +class AttrSpecDispatchKeyType { + const NONE_DISPATCH = 'NONE_DISPATCH'; + const NAME_DISPATCH = 'NAME_DISPATCH'; + const NAME_VALUE_DISPATCH = 'NAME_VALUE_DISPATCH'; + const NAME_VALUE_PARENT_DISPATCH = 'NAME_VALUE_PARENT_DISPATCH'; + +} class AttrTriggerSpec { public $if_value_regex = null; public $also_requires_attr = []; @@ -91,6 +105,7 @@ class CdataSpec { public $mandatory_cdata = null; public $cdata_regex = null; public $css_spec = null; + public $whitespace_only = null; public $blacklisted_cdata_regex = []; } @@ -98,16 +113,33 @@ class ChildTagSpec { public $mandatory_num_child_tags = null; public $first_child_tag_name_oneof = []; public $child_tag_name_oneof = []; + public $mandatory_min_num_child_tags = null; +} + +class CssDeclaration { + public $name = null; + public $value_casei = []; } -class CssRuleSpec { +class CssLengthSpec { + public $html_format = null; + public $max_bytes = null; + public $max_bytes_per_inline_style = null; + public $spec_url = null; } class CssSpec { public $at_rule_spec = []; - public $css_rule = []; public $image_url_spec = null; public $font_url_spec = null; + public $validate_amp4ads = null; + public $validate_keyframes = null; + public $declaration = []; +} + +class DescendantTagList { + public $name = null; + public $tag = []; } class ErrorCategory { @@ -132,6 +164,43 @@ class ErrorFormat { public $format = null; } +class ErrorSpecificity { + public $code = null; + public $specificity = null; +} + +class ExtensionSpec { + public $name = null; + public $version = []; + public $deprecated_version = []; + public $is_custom_template = null; + public $deprecated_allow_duplicates = null; + public $requires_usage = null; +} + +class ExtensionSpecExtensionUsageRequirement { + const ERROR = 'ERROR'; + const GRANDFATHERED = 'GRANDFATHERED'; + const NONE = 'NONE'; + +} +class HtmlFormat { +} + +class HtmlFormatCode { + const UNKNOWN_CODE = 'UNKNOWN_CODE'; + const AMP = 'AMP'; + const AMP4ADS = 'AMP4ADS'; + const AMP4EMAIL = 'AMP4EMAIL'; + const EXPERIMENTAL = 'EXPERIMENTAL'; + +} +class MediaQuerySpec { + public $issues_as_error = null; + public $type = []; + public $feature = []; +} + class PropertySpec { public $name = null; public $mandatory = null; @@ -143,29 +212,46 @@ class PropertySpecList { public $properties = []; } +class ReferencePoint { + public $tag_spec_name = null; + public $mandatory = null; + public $unique = null; +} + class TagSpec { + public $html_format = []; public $tag_name = null; public $spec_name = null; + public $extension_spec = null; + public $requires_extension = []; public $mandatory = null; public $mandatory_alternatives = null; public $unique = null; + public $unique_warning = null; public $mandatory_parent = null; public $mandatory_ancestor = null; public $mandatory_ancestor_suggested_alternative = null; public $disallowed_ancestor = []; - public $also_requires_tag = []; + public $descendant_tag_list = null; + public $also_requires_tag_warning = []; + public $satisfies = []; + public $requires = []; + public $excludes = []; public $deprecation = null; public $deprecation_url = null; public $attrs = []; public $attr_lists = []; public $cdata = null; public $child_tags = null; + public $siblings_disallowed = null; + public $mandatory_last_child = null; + public $reference_points = []; public $spec_url = null; public $amp_layout = null; } class UrlSpec { - public $allowed_protocol = []; + public $protocol = []; public $allow_relative = null; public $allow_empty = null; } @@ -175,7 +261,6 @@ class ValidationError { public $code = null; public $line = null; public $col = null; - public $detail = null; public $spec_url = null; public $params = []; public $category = null; @@ -186,24 +271,37 @@ class ValidationErrorCode { const UNKNOWN_CODE = 'UNKNOWN_CODE'; const MANDATORY_TAG_MISSING = 'MANDATORY_TAG_MISSING'; const TAG_REQUIRED_BY_MISSING = 'TAG_REQUIRED_BY_MISSING'; + const WARNING_TAG_REQUIRED_BY_MISSING = 'WARNING_TAG_REQUIRED_BY_MISSING'; + const TAG_EXCLUDED_BY_TAG = 'TAG_EXCLUDED_BY_TAG'; + const WARNING_EXTENSION_UNUSED = 'WARNING_EXTENSION_UNUSED'; + const EXTENSION_UNUSED = 'EXTENSION_UNUSED'; + const WARNING_EXTENSION_DEPRECATED_VERSION = 'WARNING_EXTENSION_DEPRECATED_VERSION'; const ATTR_REQUIRED_BUT_MISSING = 'ATTR_REQUIRED_BUT_MISSING'; const DISALLOWED_TAG = 'DISALLOWED_TAG'; const GENERAL_DISALLOWED_TAG = 'GENERAL_DISALLOWED_TAG'; + const DISALLOWED_SCRIPT_TAG = 'DISALLOWED_SCRIPT_TAG'; const DISALLOWED_ATTR = 'DISALLOWED_ATTR'; + const DISALLOWED_STYLE_ATTR = 'DISALLOWED_STYLE_ATTR'; const INVALID_ATTR_VALUE = 'INVALID_ATTR_VALUE'; + const DUPLICATE_ATTRIBUTE = 'DUPLICATE_ATTRIBUTE'; const ATTR_VALUE_REQUIRED_BY_LAYOUT = 'ATTR_VALUE_REQUIRED_BY_LAYOUT'; + const MISSING_LAYOUT_ATTRIBUTES = 'MISSING_LAYOUT_ATTRIBUTES'; const IMPLIED_LAYOUT_INVALID = 'IMPLIED_LAYOUT_INVALID'; const SPECIFIED_LAYOUT_INVALID = 'SPECIFIED_LAYOUT_INVALID'; const MANDATORY_ATTR_MISSING = 'MANDATORY_ATTR_MISSING'; const MANDATORY_ONEOF_ATTR_MISSING = 'MANDATORY_ONEOF_ATTR_MISSING'; + const MANDATORY_ANYOF_ATTR_MISSING = 'MANDATORY_ANYOF_ATTR_MISSING'; const DUPLICATE_DIMENSION = 'DUPLICATE_DIMENSION'; const DUPLICATE_UNIQUE_TAG = 'DUPLICATE_UNIQUE_TAG'; + const DUPLICATE_UNIQUE_TAG_WARNING = 'DUPLICATE_UNIQUE_TAG_WARNING'; const WRONG_PARENT_TAG = 'WRONG_PARENT_TAG'; - const STYLESHEET_TOO_LONG_OLD_VARIANT = 'STYLESHEET_TOO_LONG_OLD_VARIANT'; const STYLESHEET_TOO_LONG = 'STYLESHEET_TOO_LONG'; + const STYLESHEET_AND_INLINE_STYLE_TOO_LONG = 'STYLESHEET_AND_INLINE_STYLE_TOO_LONG'; + const INLINE_STYLE_TOO_LONG = 'INLINE_STYLE_TOO_LONG'; const MANDATORY_CDATA_MISSING_OR_INCORRECT = 'MANDATORY_CDATA_MISSING_OR_INCORRECT'; const CDATA_VIOLATES_BLACKLIST = 'CDATA_VIOLATES_BLACKLIST'; - const DEV_MODE_ENABLED = 'DEV_MODE_ENABLED'; + const NON_WHITESPACE_CDATA_ENCOUNTERED = 'NON_WHITESPACE_CDATA_ENCOUNTERED'; + const INVALID_JSON_CDATA = 'INVALID_JSON_CDATA'; const DEPRECATED_ATTR = 'DEPRECATED_ATTR'; const DEPRECATED_TAG = 'DEPRECATED_TAG'; const MANDATORY_PROPERTY_MISSING_FROM_ATTR_VALUE = 'MANDATORY_PROPERTY_MISSING_FROM_ATTR_VALUE'; @@ -211,6 +309,7 @@ class ValidationErrorCode { const MISSING_URL = 'MISSING_URL'; const INVALID_URL = 'INVALID_URL'; const INVALID_URL_PROTOCOL = 'INVALID_URL_PROTOCOL'; + const DISALLOWED_DOMAIN = 'DISALLOWED_DOMAIN'; const DISALLOWED_RELATIVE_URL = 'DISALLOWED_RELATIVE_URL'; const DISALLOWED_PROPERTY_IN_ATTR_VALUE = 'DISALLOWED_PROPERTY_IN_ATTR_VALUE'; const MUTUALLY_EXCLUSIVE_ATTRS = 'MUTUALLY_EXCLUSIVE_ATTRS'; @@ -219,14 +318,27 @@ class ValidationErrorCode { const TEMPLATE_IN_ATTR_NAME = 'TEMPLATE_IN_ATTR_NAME'; const INCONSISTENT_UNITS_FOR_WIDTH_AND_HEIGHT = 'INCONSISTENT_UNITS_FOR_WIDTH_AND_HEIGHT'; const DISALLOWED_TAG_ANCESTOR = 'DISALLOWED_TAG_ANCESTOR'; + const MANDATORY_LAST_CHILD_TAG = 'MANDATORY_LAST_CHILD_TAG'; const MANDATORY_TAG_ANCESTOR = 'MANDATORY_TAG_ANCESTOR'; const MANDATORY_TAG_ANCESTOR_WITH_HINT = 'MANDATORY_TAG_ANCESTOR_WITH_HINT'; const ATTR_DISALLOWED_BY_IMPLIED_LAYOUT = 'ATTR_DISALLOWED_BY_IMPLIED_LAYOUT'; const ATTR_DISALLOWED_BY_SPECIFIED_LAYOUT = 'ATTR_DISALLOWED_BY_SPECIFIED_LAYOUT'; const INCORRECT_NUM_CHILD_TAGS = 'INCORRECT_NUM_CHILD_TAGS'; + const INCORRECT_MIN_NUM_CHILD_TAGS = 'INCORRECT_MIN_NUM_CHILD_TAGS'; const DISALLOWED_CHILD_TAG_NAME = 'DISALLOWED_CHILD_TAG_NAME'; const DISALLOWED_FIRST_CHILD_TAG_NAME = 'DISALLOWED_FIRST_CHILD_TAG_NAME'; - const CSS_SYNTAX = 'CSS_SYNTAX'; + const DISALLOWED_MANUFACTURED_BODY = 'DISALLOWED_MANUFACTURED_BODY'; + const CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT = 'CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT'; + const MANDATORY_REFERENCE_POINT_MISSING = 'MANDATORY_REFERENCE_POINT_MISSING'; + const DUPLICATE_REFERENCE_POINT = 'DUPLICATE_REFERENCE_POINT'; + const TAG_NOT_ALLOWED_TO_HAVE_SIBLINGS = 'TAG_NOT_ALLOWED_TO_HAVE_SIBLINGS'; + const TAG_REFERENCE_POINT_CONFLICT = 'TAG_REFERENCE_POINT_CONFLICT'; + const CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT_SINGULAR = 'CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT_SINGULAR'; + const BASE_TAG_MUST_PRECEED_ALL_URLS = 'BASE_TAG_MUST_PRECEED_ALL_URLS'; + const MISSING_REQUIRED_EXTENSION = 'MISSING_REQUIRED_EXTENSION'; + const ATTR_MISSING_REQUIRED_EXTENSION = 'ATTR_MISSING_REQUIRED_EXTENSION'; + const DOCUMENT_TOO_COMPLEX = 'DOCUMENT_TOO_COMPLEX'; + const INVALID_UTF8 = 'INVALID_UTF8'; const CSS_SYNTAX_INVALID_AT_RULE = 'CSS_SYNTAX_INVALID_AT_RULE'; const CSS_SYNTAX_STRAY_TRAILING_BACKSLASH = 'CSS_SYNTAX_STRAY_TRAILING_BACKSLASH'; const CSS_SYNTAX_UNTERMINATED_COMMENT = 'CSS_SYNTAX_UNTERMINATED_COMMENT'; @@ -242,16 +354,28 @@ class ValidationErrorCode { const CSS_SYNTAX_MISSING_URL = 'CSS_SYNTAX_MISSING_URL'; const CSS_SYNTAX_INVALID_URL = 'CSS_SYNTAX_INVALID_URL'; const CSS_SYNTAX_INVALID_URL_PROTOCOL = 'CSS_SYNTAX_INVALID_URL_PROTOCOL'; + const CSS_SYNTAX_DISALLOWED_DOMAIN = 'CSS_SYNTAX_DISALLOWED_DOMAIN'; const CSS_SYNTAX_DISALLOWED_RELATIVE_URL = 'CSS_SYNTAX_DISALLOWED_RELATIVE_URL'; const CSS_SYNTAX_INVALID_ATTR_SELECTOR = 'CSS_SYNTAX_INVALID_ATTR_SELECTOR'; - + const CSS_SYNTAX_INVALID_PROPERTY = 'CSS_SYNTAX_INVALID_PROPERTY'; + const CSS_SYNTAX_INVALID_PROPERTY_NOLIST = 'CSS_SYNTAX_INVALID_PROPERTY_NOLIST'; + const CSS_SYNTAX_QUALIFIED_RULE_HAS_NO_DECLARATIONS = 'CSS_SYNTAX_QUALIFIED_RULE_HAS_NO_DECLARATIONS'; + const CSS_SYNTAX_DISALLOWED_QUALIFIED_RULE_MUST_BE_INSIDE_KEYFRAME = 'CSS_SYNTAX_DISALLOWED_QUALIFIED_RULE_MUST_BE_INSIDE_KEYFRAME'; + const CSS_SYNTAX_DISALLOWED_KEYFRAME_INSIDE_KEYFRAME = 'CSS_SYNTAX_DISALLOWED_KEYFRAME_INSIDE_KEYFRAME'; + const CSS_SYNTAX_MALFORMED_MEDIA_QUERY = 'CSS_SYNTAX_MALFORMED_MEDIA_QUERY'; + const CSS_SYNTAX_DISALLOWED_MEDIA_TYPE = 'CSS_SYNTAX_DISALLOWED_MEDIA_TYPE'; + const CSS_SYNTAX_DISALLOWED_MEDIA_FEATURE = 'CSS_SYNTAX_DISALLOWED_MEDIA_FEATURE'; + const CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE = 'CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE'; + const CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE_WITH_HINT = 'CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE_WITH_HINT'; + const CSS_SYNTAX_PROPERTY_DISALLOWED_WITHIN_AT_RULE = 'CSS_SYNTAX_PROPERTY_DISALLOWED_WITHIN_AT_RULE'; + const CSS_SYNTAX_PROPERTY_DISALLOWED_TOGETHER_WITH = 'CSS_SYNTAX_PROPERTY_DISALLOWED_TOGETHER_WITH'; + const CSS_SYNTAX_PROPERTY_REQUIRES_QUALIFICATION = 'CSS_SYNTAX_PROPERTY_REQUIRES_QUALIFICATION'; + const CSS_SYNTAX = 'CSS_SYNTAX'; } class ValidationErrorSeverity { const UNKNOWN_SEVERITY = 'UNKNOWN_SEVERITY'; const ERROR = 'ERROR'; const WARNING = 'WARNING'; - const PROD_WARNING = 'PROD_WARNING'; - const DEV_WARNING = 'DEV_WARNING'; } class ValidationResult { @@ -259,6 +383,7 @@ class ValidationResult { public $errors = []; public $validator_revision = null; public $spec_file_revision = null; + public $type_identifier = []; } class ValidationResultStatus { @@ -279,14 +404,19 @@ class ValidatorRules { public $min_validator_revision_required = null; public $spec_file_revision = null; public $template_spec_url = null; + public $styles_spec_url = null; + public $script_spec_url = null; public $error_formats = []; + public $error_specificity = []; + public $descendant_tag_list = []; + public $css_length_spec = []; } class ValidationRulesFactory { public static function createValidationRules() { $o_0 = new ValidatorRules(); $o_1 = new TagSpec(); - $o_1->tag_name = '!doctype'; + $o_1->tag_name = '!DOCTYPE'; $o_1->spec_name = 'html doctype'; $o_1->mandatory = true; $o_1->unique = true; @@ -294,4982 +424,12081 @@ public static function createValidationRules() { $o_2 = new AttrSpec(); $o_2->name = 'html'; $o_2->mandatory = true; - $o_2->value = ''; + $o_2->value = ['']; $o_1->attrs[] = $o_2; + $o_1->spec_url = 'https://www.ampproject.org/docs/reference/spec#required-markup'; + $o_1->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::AMP4EMAIL, HtmlFormatCode::EXPERIMENTAL]; $o_0->tags[] = $o_1; $o_3 = new TagSpec(); - $o_3->tag_name = 'html'; - $o_3->spec_name = 'html \u26a1 for top-level html'; + $o_3->tag_name = 'HTML'; $o_3->mandatory = true; $o_3->unique = true; - $o_3->mandatory_parent = '!doctype'; - $o_4 = new AttrSpec(); - $o_4->name = '\u26a1'; - $o_4->alternative_names = ['amp']; - $o_4->mandatory = true; - $o_4->value = ''; - $o_3->attrs[] = $o_4; - $o_3->spec_url = 'https://www.ampproject.org/docs/reference/spec.html#required-markup'; + $o_3->mandatory_parent = '!DOCTYPE'; + $o_3->spec_url = 'https://www.ampproject.org/docs/reference/spec#required-markup'; + $o_3->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::AMP4EMAIL, HtmlFormatCode::EXPERIMENTAL]; $o_0->tags[] = $o_3; + $o_4 = new TagSpec(); + $o_4->tag_name = 'HEAD'; + $o_4->mandatory = true; + $o_4->unique = true; + $o_4->mandatory_parent = 'HTML'; + $o_4->spec_url = 'https://www.ampproject.org/docs/reference/spec#required-markup'; + $o_4->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::AMP4EMAIL, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_4; $o_5 = new TagSpec(); - $o_5->tag_name = 'head'; - $o_5->mandatory = true; - $o_5->unique = true; - $o_5->mandatory_parent = 'html'; - $o_5->spec_url = 'https://www.ampproject.org/docs/reference/spec.html#required-markup'; + $o_5->tag_name = 'TITLE'; + $o_5->spec_name = 'title'; + $o_6 = new AttrSpec(); + $o_6->name = '[text]'; + $o_5->attrs[] = $o_6; + $o_5->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::AMP4EMAIL, HtmlFormatCode::EXPERIMENTAL]; $o_0->tags[] = $o_5; - $o_6 = new TagSpec(); - $o_6->tag_name = 'title'; - $o_6->spec_name = 'title'; - $o_0->tags[] = $o_6; $o_7 = new TagSpec(); - $o_7->tag_name = 'base'; + $o_7->tag_name = 'BASE'; + $o_7->unique = true; + $o_7->mandatory_parent = 'HEAD'; $o_8 = new AttrSpec(); - $o_8->name = 'target'; - $o_8->value_regex_casei = '(_blank|_self)'; + $o_8->name = 'href'; + $o_8->value = ['/']; $o_7->attrs[] = $o_8; + $o_9 = new AttrSpec(); + $o_9->name = 'target'; + $o_9->value_casei = ['_blank', '_self', '_top']; + $o_7->attrs[] = $o_9; + $o_7->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::EXPERIMENTAL]; $o_0->tags[] = $o_7; - $o_9 = new TagSpec(); - $o_9->tag_name = 'link'; - $o_9->spec_name = 'link rel='; - $o_10 = new AttrSpec(); - $o_10->name = 'href'; - $o_9->attrs[] = $o_10; + $o_10 = new TagSpec(); + $o_10->tag_name = 'LINK'; + $o_10->spec_name = 'link rel='; $o_11 = new AttrSpec(); - $o_11->name = 'rel'; - $o_11->mandatory = true; - $o_11->blacklisted_value_regex = '(^|\\s)(canonical|components|dns-prefetch|import|manifest|preconnect|prefetch|preload|prerender|serviceworker|stylesheet|subresource|)(\\s|$)'; - $o_9->attrs[] = $o_11; + $o_11->name = 'href'; + $o_10->attrs[] = $o_11; $o_12 = new AttrSpec(); - $o_12->name = 'sizes'; - $o_9->attrs[] = $o_12; - $o_13 = new AttrSpec(); - $o_13->name = 'type'; - $o_9->attrs[] = $o_13; - $o_9->attr_lists = ['common-link-attrs']; - $o_9->disallowed_ancestor = ['template']; - $o_0->tags[] = $o_9; - $o_14 = new TagSpec(); - $o_14->tag_name = 'link'; - $o_14->spec_name = 'link rel=canonical'; + $o_12->name = 'rel'; + $o_12->mandatory = true; + $o_12->blacklisted_value_regex = '(^|\\s)(canonical|components|import|manifest|preload|serviceworker|stylesheet|subresource|)(\\s|$)'; + $o_10->attrs[] = $o_12; + $o_10->attr_lists = ['common-link-attrs']; + $o_10->spec_url = 'https://www.ampproject.org/docs/reference/spec#html-tags'; + $o_10->disallowed_ancestor = ['TEMPLATE']; + $o_10->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_10; + $o_13 = new TagSpec(); + $o_13->tag_name = 'LINK'; + $o_13->spec_name = 'link rel=canonical'; + $o_13->mandatory = true; + $o_13->unique = true; + $o_13->mandatory_parent = 'HEAD'; + $o_14 = new AttrSpec(); + $o_14->name = 'href'; $o_14->mandatory = true; - $o_14->unique = true; - $o_14->mandatory_parent = 'head'; - $o_15 = new AttrSpec(); - $o_15->name = 'href'; - $o_15->mandatory = true; - $o_16 = new UrlSpec(); - $o_16->allowed_protocol = ['http', 'https']; - $o_16->allow_relative = true; - $o_15->value_url = $o_16; - $o_14->attrs[] = $o_15; - $o_17 = new AttrSpec(); - $o_17->name = 'rel'; - $o_17->mandatory = true; - $o_17->value = 'canonical'; - $o_17->dispatch_key = true; - $o_14->attrs[] = $o_17; - $o_14->attr_lists = ['common-link-attrs']; - $o_14->spec_url = 'https://www.ampproject.org/docs/reference/spec.html#required-markup'; - $o_0->tags[] = $o_14; - $o_18 = new TagSpec(); - $o_18->tag_name = 'link'; - $o_18->spec_name = 'link rel=stylesheet for fonts'; - $o_18->mandatory_parent = 'head'; - $o_19 = new AttrSpec(); - $o_19->name = 'href'; - $o_19->mandatory = true; - $o_19->value_regex = 'https://fonts\\.googleapis\\.com/css\\?.*|https://fonts\\.googleapis\\.com/icon\\?.*|https://fonts\\.googleapis\\.com/earlyaccess/.*\\.css|https://fast\\.fonts\\.net/.*|https://maxcdn\\.bootstrapcdn\\.com/font-awesome/.*'; - $o_18->attrs[] = $o_19; + $o_14->blacklisted_value_regex = '__amp_source_origin'; + $o_15 = new UrlSpec(); + $o_15->protocol = ['http', 'https']; + $o_14->value_url = $o_15; + $o_13->attrs[] = $o_14; + $o_16 = new AttrSpec(); + $o_16->name = 'rel'; + $o_16->mandatory = true; + $o_16->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_16->value_casei = ['canonical']; + $o_13->attrs[] = $o_16; + $o_13->attr_lists = ['common-link-attrs']; + $o_13->spec_url = 'https://www.ampproject.org/docs/reference/spec#required-markup'; + $o_13->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_13; + $o_17 = new TagSpec(); + $o_17->tag_name = 'LINK'; + $o_17->spec_name = 'link rel=manifest'; + $o_17->mandatory_parent = 'HEAD'; + $o_18 = new AttrSpec(); + $o_18->name = 'href'; + $o_18->mandatory = true; + $o_18->blacklisted_value_regex = '__amp_source_origin'; + $o_19 = new UrlSpec(); + $o_19->protocol = ['https']; + $o_18->value_url = $o_19; + $o_17->attrs[] = $o_18; $o_20 = new AttrSpec(); $o_20->name = 'rel'; $o_20->mandatory = true; - $o_20->value = 'stylesheet'; - $o_20->dispatch_key = true; - $o_18->attrs[] = $o_20; - $o_21 = new AttrSpec(); - $o_21->name = 'type'; - $o_21->value = 'text/css'; - $o_18->attrs[] = $o_21; + $o_20->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_20->value_casei = ['manifest']; + $o_17->attrs[] = $o_20; + $o_17->attr_lists = ['common-link-attrs']; + $o_17->spec_url = 'https://www.ampproject.org/docs/reference/spec#html-tags'; + $o_17->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS]; + $o_17->satisfies = ['amp-app-banner data source']; + $o_0->tags[] = $o_17; + $o_21 = new TagSpec(); + $o_21->tag_name = 'LINK'; + $o_21->spec_name = 'link rel=preload'; $o_22 = new AttrSpec(); - $o_22->name = 'media'; - $o_18->attrs[] = $o_22; - $o_0->tags[] = $o_18; - $o_23 = new TagSpec(); - $o_23->tag_name = 'link'; - $o_23->spec_name = 'link itemprop=sameAs'; + $o_22->name = 'as'; + $o_21->attrs[] = $o_22; + $o_23 = new AttrSpec(); + $o_23->name = 'href'; + $o_21->attrs[] = $o_23; $o_24 = new AttrSpec(); - $o_24->name = 'href'; + $o_24->name = 'rel'; $o_24->mandatory = true; - $o_23->attrs[] = $o_24; - $o_25 = new AttrSpec(); - $o_25->name = 'itemprop'; - $o_25->mandatory = true; - $o_25->value = 'sameAs'; - $o_25->dispatch_key = true; - $o_23->attrs[] = $o_25; - $o_23->attr_lists = ['common-link-attrs']; - $o_0->tags[] = $o_23; - $o_26 = new TagSpec(); - $o_26->tag_name = 'link'; - $o_26->spec_name = 'link itemprop='; + $o_24->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_24->value_casei = ['preload']; + $o_21->attrs[] = $o_24; + $o_21->attr_lists = ['common-link-attrs']; + $o_21->spec_url = 'https://www.ampproject.org/docs/reference/spec#html-tags'; + $o_21->disallowed_ancestor = ['TEMPLATE']; + $o_21->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_21; + $o_25 = new TagSpec(); + $o_25->tag_name = 'LINK'; + $o_25->spec_name = 'link rel=stylesheet for fonts'; + $o_25->mandatory_parent = 'HEAD'; + $o_26 = new AttrSpec(); + $o_26->name = 'async'; + $o_25->attrs[] = $o_26; $o_27 = new AttrSpec(); - $o_27->name = 'href'; - $o_27->mandatory = true; - $o_26->attrs[] = $o_27; + $o_27->name = 'crossorigin'; + $o_25->attrs[] = $o_27; $o_28 = new AttrSpec(); - $o_28->name = 'itemprop'; + $o_28->name = 'href'; $o_28->mandatory = true; - $o_26->attrs[] = $o_28; - $o_26->attr_lists = ['common-link-attrs']; - $o_0->tags[] = $o_26; - $o_29 = new TagSpec(); - $o_29->tag_name = 'meta'; - $o_29->spec_name = 'meta charset=utf-8'; - $o_29->mandatory = true; - $o_29->unique = true; - $o_29->mandatory_parent = 'head'; + $o_28->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|pro)\\.fontawesome\\.com/releases/v([0-9]+\\.?)+/css/(all|brands|solid|regular|light|fontawesome)\\.css|https://(use|pro)\\.fontawesome\\.com/[0-9a-zA-Z]+\\.css|https://use\\.typekit\\.net/[\\w\\p{L}\\p{N}_]+\\.css'; + $o_25->attrs[] = $o_28; + $o_29 = new AttrSpec(); + $o_29->name = 'integrity'; + $o_25->attrs[] = $o_29; $o_30 = new AttrSpec(); - $o_30->name = 'charset'; - $o_30->mandatory = true; - $o_30->value = 'utf-8'; - $o_30->dispatch_key = true; - $o_29->attrs[] = $o_30; - $o_29->spec_url = 'https://www.ampproject.org/docs/reference/spec.html#required-markup'; - $o_0->tags[] = $o_29; - $o_31 = new TagSpec(); - $o_31->tag_name = 'meta'; - $o_31->spec_name = 'meta name=viewport'; + $o_30->name = 'media'; + $o_25->attrs[] = $o_30; + $o_31 = new AttrSpec(); + $o_31->name = 'rel'; $o_31->mandatory = true; - $o_31->unique = true; - $o_31->mandatory_parent = 'head'; + $o_31->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_31->value_casei = ['stylesheet']; + $o_25->attrs[] = $o_31; $o_32 = new AttrSpec(); - $o_32->name = 'content'; - $o_32->mandatory = true; - $o_33 = new PropertySpecList(); - $o_34 = new PropertySpec(); - $o_34->name = 'width'; + $o_32->name = 'type'; + $o_32->value_casei = ['text/css']; + $o_25->attrs[] = $o_32; + $o_25->spec_url = 'https://www.ampproject.org/docs/reference/spec#custom-fonts'; + $o_25->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_25; + $o_33 = new TagSpec(); + $o_33->tag_name = 'LINK'; + $o_33->spec_name = 'link itemprop=sameAs'; + $o_34 = new AttrSpec(); + $o_34->name = 'href'; $o_34->mandatory = true; - $o_34->value = 'device-width'; - $o_33->properties[] = $o_34; - $o_35 = new PropertySpec(); - $o_35->name = 'height'; - $o_33->properties[] = $o_35; - $o_36 = new PropertySpec(); - $o_36->name = 'initial-scale'; - $o_33->properties[] = $o_36; - $o_37 = new PropertySpec(); - $o_37->name = 'minimum-scale'; + $o_33->attrs[] = $o_34; + $o_35 = new AttrSpec(); + $o_35->name = 'itemprop'; + $o_35->mandatory = true; + $o_35->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_35->value_casei = ['sameas']; + $o_33->attrs[] = $o_35; + $o_33->attr_lists = ['common-link-attrs']; + $o_33->spec_url = 'https://www.ampproject.org/docs/reference/spec#html-tags'; + $o_33->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_33; + $o_36 = new TagSpec(); + $o_36->tag_name = 'LINK'; + $o_36->spec_name = 'link itemprop='; + $o_37 = new AttrSpec(); + $o_37->name = 'href'; $o_37->mandatory = true; - $o_37->value_double = 1.0; - $o_33->properties[] = $o_37; - $o_38 = new PropertySpec(); - $o_38->name = 'maximum-scale'; - $o_33->properties[] = $o_38; - $o_39 = new PropertySpec(); - $o_39->name = 'shrink-to-fit'; - $o_33->properties[] = $o_39; - $o_40 = new PropertySpec(); - $o_40->name = 'user-scalable'; - $o_33->properties[] = $o_40; - $o_32->value_properties = $o_33; - $o_31->attrs[] = $o_32; + $o_36->attrs[] = $o_37; + $o_38 = new AttrSpec(); + $o_38->name = 'itemprop'; + $o_38->mandatory = true; + $o_36->attrs[] = $o_38; + $o_36->attr_lists = ['common-link-attrs']; + $o_36->spec_url = 'https://www.ampproject.org/docs/reference/spec#html-tags'; + $o_36->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_36; + $o_39 = new TagSpec(); + $o_39->tag_name = 'LINK'; + $o_39->spec_name = 'link property='; + $o_40 = new AttrSpec(); + $o_40->name = 'href'; + $o_40->mandatory = true; + $o_39->attrs[] = $o_40; $o_41 = new AttrSpec(); - $o_41->name = 'name'; + $o_41->name = 'property'; $o_41->mandatory = true; - $o_41->value = 'viewport'; - $o_41->dispatch_key = true; - $o_31->attrs[] = $o_41; - $o_31->spec_url = 'https://www.ampproject.org/docs/reference/spec.html#required-markup'; - $o_0->tags[] = $o_31; + $o_39->attrs[] = $o_41; + $o_39->attr_lists = ['common-link-attrs']; + $o_39->spec_url = 'https://www.ampproject.org/docs/reference/spec#html-tags'; + $o_39->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_39; $o_42 = new TagSpec(); - $o_42->tag_name = 'meta'; - $o_42->spec_name = 'meta http-equiv=X-UA-Compatible'; + $o_42->tag_name = 'META'; + $o_42->spec_name = 'meta charset=utf-8'; + $o_42->mandatory = true; + $o_42->unique = true; + $o_42->mandatory_parent = 'HEAD'; $o_43 = new AttrSpec(); - $o_43->name = 'http-equiv'; + $o_43->name = 'charset'; $o_43->mandatory = true; - $o_43->value = 'X-UA-Compatible'; - $o_43->dispatch_key = true; + $o_43->dispatch_key = AttrSpecDispatchKeyType::NAME_DISPATCH; + $o_43->value_casei = ['utf-8']; $o_42->attrs[] = $o_43; - $o_44 = new AttrSpec(); - $o_44->name = 'content'; + $o_42->spec_url = 'https://www.ampproject.org/docs/reference/spec#required-markup'; + $o_42->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::AMP4EMAIL, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_42; + $o_44 = new TagSpec(); + $o_44->tag_name = 'META'; + $o_44->spec_name = 'meta name=viewport'; $o_44->mandatory = true; - $o_45 = new PropertySpecList(); - $o_46 = new PropertySpec(); - $o_46->name = 'ie'; - $o_46->value = 'edge'; - $o_45->properties[] = $o_46; + $o_44->unique = true; + $o_44->mandatory_parent = 'HEAD'; + $o_45 = new AttrSpec(); + $o_45->name = 'content'; + $o_45->mandatory = true; + $o_46 = new PropertySpecList(); $o_47 = new PropertySpec(); - $o_47->name = 'chrome'; - $o_47->value = '1'; - $o_45->properties[] = $o_47; - $o_44->value_properties = $o_45; - $o_42->attrs[] = $o_44; - $o_0->tags[] = $o_42; - $o_48 = new TagSpec(); - $o_48->tag_name = 'meta'; - $o_48->spec_name = 'meta name= and content='; - $o_49 = new AttrSpec(); - $o_49->name = 'name'; - $o_49->blacklisted_value_regex = '(^|\\s)(viewport|content-disposition|revisit-after)(\\s|$)'; - $o_48->attrs[] = $o_49; - $o_50 = new AttrSpec(); - $o_50->name = 'content'; - $o_48->attrs[] = $o_50; - $o_51 = new AttrSpec(); - $o_51->name = 'property'; - $o_48->attrs[] = $o_51; - $o_52 = new AttrSpec(); - $o_52->name = 'itemprop'; - $o_48->attrs[] = $o_52; - $o_0->tags[] = $o_48; - $o_53 = new TagSpec(); - $o_53->tag_name = 'meta'; - $o_53->spec_name = 'meta http-equiv=content-type'; - $o_54 = new AttrSpec(); - $o_54->name = 'http-equiv'; - $o_54->mandatory = true; - $o_54->value = 'content-type'; - $o_54->dispatch_key = true; - $o_53->attrs[] = $o_54; + $o_47->name = 'width'; + $o_47->mandatory = true; + $o_47->value = 'device-width'; + $o_46->properties[] = $o_47; + $o_48 = new PropertySpec(); + $o_48->name = 'height'; + $o_46->properties[] = $o_48; + $o_49 = new PropertySpec(); + $o_49->name = 'initial-scale'; + $o_46->properties[] = $o_49; + $o_50 = new PropertySpec(); + $o_50->name = 'minimum-scale'; + $o_46->properties[] = $o_50; + $o_51 = new PropertySpec(); + $o_51->name = 'maximum-scale'; + $o_46->properties[] = $o_51; + $o_52 = new PropertySpec(); + $o_52->name = 'shrink-to-fit'; + $o_46->properties[] = $o_52; + $o_53 = new PropertySpec(); + $o_53->name = 'user-scalable'; + $o_46->properties[] = $o_53; + $o_54 = new PropertySpec(); + $o_54->name = 'viewport-fit'; + $o_46->properties[] = $o_54; + $o_45->value_properties = $o_46; + $o_44->attrs[] = $o_45; $o_55 = new AttrSpec(); - $o_55->name = 'content'; + $o_55->name = 'name'; $o_55->mandatory = true; - $o_55->value = 'text/html; charset=utf-8'; - $o_53->attrs[] = $o_55; - $o_0->tags[] = $o_53; + $o_55->value = ['viewport']; + $o_55->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_44->attrs[] = $o_55; + $o_44->spec_url = 'https://www.ampproject.org/docs/reference/spec#required-markup'; + $o_44->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_44; $o_56 = new TagSpec(); - $o_56->tag_name = 'meta'; - $o_56->spec_name = 'meta http-equiv=Content-Type'; + $o_56->tag_name = 'META'; + $o_56->spec_name = 'meta http-equiv=X-UA-Compatible'; $o_57 = new AttrSpec(); - $o_57->name = 'http-equiv'; + $o_57->name = 'content'; $o_57->mandatory = true; - $o_57->value = 'Content-Type'; - $o_57->dispatch_key = true; + $o_58 = new PropertySpecList(); + $o_59 = new PropertySpec(); + $o_59->name = 'ie'; + $o_59->value = 'edge'; + $o_58->properties[] = $o_59; + $o_60 = new PropertySpec(); + $o_60->name = 'chrome'; + $o_60->value = '1'; + $o_58->properties[] = $o_60; + $o_57->value_properties = $o_58; $o_56->attrs[] = $o_57; - $o_58 = new AttrSpec(); - $o_58->name = 'content'; - $o_58->mandatory = true; - $o_58->value = 'text/html; charset=utf-8'; - $o_56->attrs[] = $o_58; - $o_0->tags[] = $o_56; - $o_59 = new TagSpec(); - $o_59->tag_name = 'meta'; - $o_59->spec_name = 'meta http-equiv=content-language'; - $o_60 = new AttrSpec(); - $o_60->name = 'http-equiv'; - $o_60->mandatory = true; - $o_60->value = 'content-language'; - $o_60->dispatch_key = true; - $o_59->attrs[] = $o_60; $o_61 = new AttrSpec(); - $o_61->name = 'content'; + $o_61->name = 'http-equiv'; $o_61->mandatory = true; - $o_59->attrs[] = $o_61; - $o_0->tags[] = $o_59; + $o_61->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_61->value_casei = ['x-ua-compatible']; + $o_56->attrs[] = $o_61; + $o_56->spec_url = 'https://www.ampproject.org/docs/reference/spec#html-tags'; + $o_56->mandatory_ancestor = 'HEAD'; + $o_56->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS, HtmlFormatCode::EXPERIMENTAL]; + $o_0->tags[] = $o_56; $o_62 = new TagSpec(); - $o_62->tag_name = 'meta'; - $o_62->spec_name = 'meta http-equiv=pics-label'; + $o_62->tag_name = 'META'; + $o_62->spec_name = 'meta name=apple-itunes-app'; + $o_62->mandatory_parent = 'HEAD'; $o_63 = new AttrSpec(); - $o_63->name = 'http-equiv'; + $o_63->name = 'content'; $o_63->mandatory = true; - $o_63->value = 'pics-label'; - $o_63->dispatch_key = true; + $o_63->value_regex = '.*app-id=.*'; $o_62->attrs[] = $o_63; $o_64 = new AttrSpec(); - $o_64->name = 'content'; + $o_64->name = 'name'; $o_64->mandatory = true; + $o_64->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_64->value_casei = ['apple-itunes-app']; $o_62->attrs[] = $o_64; + $o_62->spec_url = 'https://www.ampproject.org/docs/reference/spec#html-tags'; + $o_62->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS]; + $o_62->satisfies = ['amp-app-banner data source']; $o_0->tags[] = $o_62; $o_65 = new TagSpec(); - $o_65->tag_name = 'meta'; - $o_65->spec_name = 'meta http-equiv=imagetoolbar'; + $o_65->tag_name = 'META'; + $o_65->spec_name = 'meta name=amp-experiments-opt-in'; + $o_65->mandatory_parent = 'HEAD'; $o_66 = new AttrSpec(); - $o_66->name = 'http-equiv'; + $o_66->name = 'content'; $o_66->mandatory = true; - $o_66->value = 'imagetoolbar'; - $o_66->dispatch_key = true; $o_65->attrs[] = $o_66; $o_67 = new AttrSpec(); - $o_67->name = 'content'; + $o_67->name = 'name'; $o_67->mandatory = true; + $o_67->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_67->value_casei = ['amp-experiments-opt-in']; $o_65->attrs[] = $o_67; + $o_65->html_format = [HtmlFormatCode::AMP, HtmlFormatCode::AMP4ADS]; $o_0->tags[] = $o_65; $o_68 = new TagSpec(); - $o_68->tag_name = 'meta'; - $o_68->spec_name = 'meta http-equiv=Content-Style-Type'; + $o_68->tag_name = 'META'; + $o_68->spec_name = 'meta name=amp-3p-iframe-src'; + $o_68->mandatory_parent = 'HEAD'; $o_69 = new AttrSpec(); - $o_69->name = 'http-equiv'; + $o_69->name = 'content'; $o_69->mandatory = true; - $o_69->value = 'Content-Style-Type'; - $o_69->dispatch_key = true; + $o_70 = new UrlSpec(); + $o_70->protocol = ['https']; + $o_69->value_url = $o_70; $o_68->attrs[] = $o_69; - $o_70 = new AttrSpec(); - $o_70->name = 'content'; - $o_70->mandatory = true; - $o_70->value = 'text/css'; - $o_68->attrs[] = $o_70; + $o_71 = new AttrSpec(); + $o_71->name = 'name'; + $o_71->mandatory = true; + $o_71->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_71->value_casei = ['amp-3p-iframe-src']; + $o_68->attrs[] = $o_71; + $o_68->spec_url = 'https://www.ampproject.org/docs/reference/components/amp-ad'; + $o_68->html_format = [HtmlFormatCode::AMP]; $o_0->tags[] = $o_68; - $o_71 = new TagSpec(); - $o_71->tag_name = 'meta'; - $o_71->spec_name = 'meta http-equiv=Content-Script-Type'; - $o_72 = new AttrSpec(); - $o_72->name = 'http-equiv'; - $o_72->mandatory = true; - $o_72->value = 'Content-Script-Type'; - $o_72->dispatch_key = true; - $o_71->attrs[] = $o_72; + $o_72 = new TagSpec(); + $o_72->tag_name = 'META'; + $o_72->spec_name = 'meta name=amp-experiment-token'; + $o_72->mandatory_parent = 'HEAD'; $o_73 = new AttrSpec(); $o_73->name = 'content'; $o_73->mandatory = true; - $o_73->value = 'text/javascript'; - $o_71->attrs[] = $o_73; - $o_0->tags[] = $o_71; - $o_74 = new TagSpec(); - $o_74->tag_name = 'meta'; - $o_74->spec_name = 'meta http-equiv=resource-type'; - $o_75 = new AttrSpec(); - $o_75->name = 'http-equiv'; - $o_75->mandatory = true; - $o_75->value = 'RESOURCE-TYPE'; - $o_75->dispatch_key = true; - $o_74->attrs[] = $o_75; + $o_72->attrs[] = $o_73; + $o_74 = new AttrSpec(); + $o_74->name = 'name'; + $o_74->mandatory = true; + $o_74->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_74->value_casei = ['amp-experiment-token']; + $o_72->attrs[] = $o_74; + $o_72->html_format = [HtmlFormatCode::AMP]; + $o_0->tags[] = $o_72; + $o_75 = new TagSpec(); + $o_75->tag_name = 'META'; + $o_75->spec_name = 'meta name=amp-link-variable-allowed-origin'; + $o_75->mandatory_parent = 'HEAD'; $o_76 = new AttrSpec(); $o_76->name = 'content'; $o_76->mandatory = true; - $o_74->attrs[] = $o_76; - $o_0->tags[] = $o_74; - $o_77 = new TagSpec(); - $o_77->tag_name = 'style'; - $o_77->spec_name = 'style amp-custom'; - $o_77->unique = true; - $o_77->mandatory_parent = 'head'; - $o_78 = new AttrSpec(); - $o_78->name = 'amp-custom'; - $o_78->mandatory = true; - $o_78->value = ''; - $o_77->attrs[] = $o_78; + $o_75->attrs[] = $o_76; + $o_77 = new AttrSpec(); + $o_77->name = 'name'; + $o_77->mandatory = true; + $o_77->dispatch_key = AttrSpecDispatchKeyType::NAME_VALUE_DISPATCH; + $o_77->value_casei = ['amp-link-variable-allowed-origin']; + $o_75->attrs[] = $o_77; + $o_75->html_format = [HtmlFormatCode::AMP]; + $o_0->tags[] = $o_75; + $o_78 = new TagSpec(); + $o_78->tag_name = 'META'; + $o_78->spec_name = 'meta name=amp-google-clientid-id-api'; + $o_78->mandatory_parent = 'HEAD'; $o_79 = new AttrSpec(); - $o_79->name = 'type'; - $o_79->value = 'text/css'; - $o_77->attrs[] = $o_79; - $o_77->spec_url = 'https://www.ampproject.org/docs/reference/spec.html#stylesheets'; - $o_80 = new CdataSpec(); - $o_80->max_bytes = 50000; - $o_80->max_bytes_spec_url = 'https://www.ampproject.org/docs/reference/spec.html#maximum-size'; - $o_81 = new BlackListedCDataRegex(); - $o_81->regex = ' - + - + - + - + ORIGINAL HTML @@ -53,9 +53,28 @@ Transformations made from HTML tags to AMP custom tags AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 4 +- The tag 'amp-facebook' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-facebook tag was removed due to validation issues. + + on line 9 +- The tag 'amp-facebook' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-facebook tag was removed due to validation issues. + + on line 14 +- The tag 'amp-facebook' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-facebook tag was removed due to validation issues. + + on line 19 +- The tag 'amp-facebook' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-facebook tag was removed due to validation issues. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-facebook', include path 'https://cdn.ampproject.org/v0/amp-facebook-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/fragment-html/facebook-non-iframe-fragment.html.out b/tests/test-data/fragment-html/facebook-non-iframe-fragment.html.out index 05e0c793..e1d76acc 100644 --- a/tests/test-data/fragment-html/facebook-non-iframe-fragment.html.out +++ b/tests/test-data/fragment-html/facebook-non-iframe-fragment.html.out @@ -1,15 +1,15 @@ -
- - - - - + + + + + + ORIGINAL HTML --------------- @@ -90,9 +90,38 @@ Transformations made from HTML tags to AMP custom tags AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + +
on line 1 +- The tag 'div' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: div tag was removed due to validation issues. + + on line 12 +- The tag 'amp-facebook' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-facebook tag was removed due to validation issues. + + on line 20 +- The tag 'amp-facebook' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-facebook tag was removed due to validation issues. + + on line 29 +- The tag 'amp-facebook' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-facebook tag was removed due to validation issues. + + on line 37 +- The tag 'amp-facebook' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-facebook tag was removed due to validation issues. + + on line 46 +- The tag 'amp-facebook' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-facebook tag was removed due to validation issues. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-facebook', include path 'https://cdn.ampproject.org/v0/amp-facebook-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/fragment-html/iframe-http-to-https-conversion.html.out b/tests/test-data/fragment-html/iframe-http-to-https-conversion.html.out index a7df3ee3..c5640d42 100644 --- a/tests/test-data/fragment-html/iframe-http-to-https-conversion.html.out +++ b/tests/test-data/fragment-html/iframe-http-to-https-conversion.html.out @@ -1,6 +1,6 @@ - - + + ORIGINAL HTML --------------- @@ -29,9 +29,18 @@ Transformations made from HTML tags to AMP custom tags AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + + - + - + - + @@ -56,12 +56,31 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 2 +- The tag 'amp-anim' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-anim tag was removed due to validation issues. + + on line 5 +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. + + on line 8 +- The tag 'amp-anim' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-anim tag was removed due to validation issues. + + on line 11 +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. + on line 14 -- The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? - [code: MANDATORY_TAG_ANCESTOR_WITH_HINT category: DISALLOWED_HTML_WITH_AMP_EQUIVALENT see: https://www.ampproject.org/docs/reference/amp-img.html] +- The tag 'img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML_WITH_AMP_EQUIVALENT] ACTION TAKEN: img tag was removed due to validation issues. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-anim', include path 'https://cdn.ampproject.org/v0/amp-anim-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/fragment-html/img-test-fragment.html.out b/tests/test-data/fragment-html/img-test-fragment.html.out index 20a30bb1..f5c30c80 100644 --- a/tests/test-data/fragment-html/img-test-fragment.html.out +++ b/tests/test-data/fragment-html/img-test-fragment.html.out @@ -1,31 +1,31 @@ - + - + - + - + - + - + - + - + - + ORIGINAL HTML @@ -84,29 +84,50 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 4 +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. + + on line 7 +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. + on line 10 -- The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? - [code: MANDATORY_TAG_ANCESTOR_WITH_HINT category: DISALLOWED_HTML_WITH_AMP_EQUIVALENT see: https://www.ampproject.org/docs/reference/amp-img.html] +- The tag 'img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML_WITH_AMP_EQUIVALENT] + ACTION TAKEN: img tag was removed due to validation issues. on line 13 -- The implied layout 'CONTAINER' is not supported by tag 'amp-img'. - [code: IMPLIED_LAYOUT_INVALID category: AMP_LAYOUT_PROBLEM see: https://www.ampproject.org/docs/reference/amp-img.html] - ACTION TAKEN: amp-img tried to fix problems with amp-img by trying to fetch height, width from image directly and/or setting layout to responsive +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. on line 16 -- The mandatory attribute 'height' is missing in tag 'amp-img'. - [code: MANDATORY_ATTR_MISSING category: AMP_LAYOUT_PROBLEM see: https://www.ampproject.org/docs/reference/amp-img.html] - ACTION TAKEN: amp-img tried to fix problems with amp-img by trying to fetch height, width from image directly and/or setting layout to responsive +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. on line 19 -- The attribute 'height' in tag 'amp-img' is set to the invalid value 'auto'. - [code: INVALID_ATTR_VALUE category: AMP_LAYOUT_PROBLEM see: https://www.ampproject.org/docs/reference/amp-img.html] - ACTION TAKEN: amp-img tried to fix problems with amp-img by trying to fetch height, width from image directly and/or setting layout to responsive +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. on line 22 -- Inconsistent units for width and height in tag 'amp-img' - width is specified in 'rem' whereas height is specified in 'px'. - [code: INCONSISTENT_UNITS_FOR_WIDTH_AND_HEIGHT category: AMP_LAYOUT_PROBLEM see: https://www.ampproject.org/docs/reference/amp-img.html] - ACTION TAKEN: amp-img tried to fix problems with amp-img by trying to fetch height, width from image directly and/or setting layout to responsive +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. + + on line 25 +- The tag 'amp-pixel' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-pixel tag was removed due to validation issues. + + on line 28 +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. COMPONENT NAMES WITH JS PATH ------------------------------ diff --git a/tests/test-data/fragment-html/instagram-fragment-with-caption.html.out b/tests/test-data/fragment-html/instagram-fragment-with-caption.html.out index 77b9fe54..541c86eb 100644 --- a/tests/test-data/fragment-html/instagram-fragment-with-caption.html.out +++ b/tests/test-data/fragment-html/instagram-fragment-with-caption.html.out @@ -1,4 +1,4 @@ - + @@ -35,9 +35,13 @@ Transformations made from HTML tags to AMP custom tags AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 2 +- The tag 'amp-instagram' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-instagram tag was removed due to validation issues. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-instagram', include path 'https://cdn.ampproject.org/v0/amp-instagram-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/fragment-html/object-video-fragment.html.out b/tests/test-data/fragment-html/object-video-fragment.html.out index a00438d3..4fc33e55 100644 --- a/tests/test-data/fragment-html/object-video-fragment.html.out +++ b/tests/test-data/fragment-html/object-video-fragment.html.out @@ -1,4 +1,4 @@ -http://video.golem.de/player/videoplayer.swf?id=2883&autoPl=false + ORIGINAL HTML --------------- @@ -19,7 +19,12 @@ Transformations made from HTML tags to AMP custom tags AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 1 +- The tag 'a' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: a tag was removed due to validation issues. COMPONENT NAMES WITH JS PATH ------------------------------ diff --git a/tests/test-data/fragment-html/object-vimeo-fragment.html.out b/tests/test-data/fragment-html/object-vimeo-fragment.html.out index d68c46db..48baec5a 100644 --- a/tests/test-data/fragment-html/object-vimeo-fragment.html.out +++ b/tests/test-data/fragment-html/object-vimeo-fragment.html.out @@ -1,4 +1,4 @@ - + ORIGINAL HTML --------------- @@ -19,9 +19,13 @@ Transformations made from HTML tags to AMP custom tags AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 1 +- The tag 'amp-vimeo' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-vimeo tag was removed due to validation issues. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-vimeo', include path 'https://cdn.ampproject.org/v0/amp-vimeo-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/fragment-html/object-youtube-fragment.html.out b/tests/test-data/fragment-html/object-youtube-fragment.html.out index f61c359a..7b608b8e 100644 --- a/tests/test-data/fragment-html/object-youtube-fragment.html.out +++ b/tests/test-data/fragment-html/object-youtube-fragment.html.out @@ -1,4 +1,4 @@ - + ORIGINAL HTML --------------- @@ -19,9 +19,13 @@ Transformations made from HTML tags to AMP custom tags AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 1 +- The tag 'amp-youtube' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-youtube tag was removed due to validation issues. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-youtube', include path 'https://cdn.ampproject.org/v0/amp-youtube-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/fragment-html/pinterest-fragment.html.out b/tests/test-data/fragment-html/pinterest-fragment.html.out index fd5b62a7..16dd9678 100644 --- a/tests/test-data/fragment-html/pinterest-fragment.html.out +++ b/tests/test-data/fragment-html/pinterest-fragment.html.out @@ -1,4 +1,4 @@ - + ORIGINAL HTML @@ -16,9 +16,13 @@ Transformations made from HTML tags to AMP custom tags AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 1 +- The tag 'amp-pinterest' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-pinterest tag was removed due to validation issues. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-pinterest', include path 'https://cdn.ampproject.org/v0/amp-pinterest-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/fragment-html/sample-html-fragment.html.out b/tests/test-data/fragment-html/sample-html-fragment.html.out index 90d79b57..25659fcc 100644 --- a/tests/test-data/fragment-html/sample-html-fragment.html.out +++ b/tests/test-data/fragment-html/sample-html-fragment.html.out @@ -1,11 +1,11 @@ -

Run

-

CNN

+ + - -

BBC

-

-

This is a sample

sample
paragraph - + + + + paragraph + @@ -39,43 +39,76 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL +

on line 1 +- The tag 'p' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: p tag was removed due to validation issues. + on line 1 -- The attribute 'style' may not appear in tag 'a'. - [code: DISALLOWED_ATTR category: DISALLOWED_HTML] - ACTION TAKEN: a.style attribute was removed due to validation issues. -- Invalid URL protocol 'javascript:' for attribute 'href' in tag 'a'. - [code: INVALID_URL_PROTOCOL category: DISALLOWED_HTML] - ACTION TAKEN: a.href attribute was removed due to validation issues. +- The tag 'a' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: a tag was removed due to validation issues. + +

on line 2 +- The tag 'p' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: p tag was removed due to validation issues. on line 2 -- The attribute 'style' may not appear in tag 'a'. - [code: DISALLOWED_ATTR category: DISALLOWED_HTML] - ACTION TAKEN: a.style attribute was removed due to validation issues. -- The attribute 'target' in tag 'a' is set to the invalid value '_parent'. - [code: INVALID_ATTR_VALUE category: DISALLOWED_HTML] - ACTION TAKEN: a.target attribute was removed due to validation issues. +- The tag 'a' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: a tag was removed due to validation issues. + + on line 4 +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. + +

on line 5 +- The tag 'p' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: p tag was removed due to validation issues. + + on line 5 +- The tag 'a' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: a tag was removed due to validation issues. + +

on line 6 +- The tag 'p' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: p tag was removed due to validation issues. on line 6 - The tag 'input' is disallowed. [code: DISALLOWED_TAG category: DISALLOWED_HTML] ACTION TAKEN: input tag was removed due to validation issues. +

on line 7 +- The tag 'p' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: p tag was removed due to validation issues. +

on line 7 -- The attribute 'onmouseover' may not appear in tag 'div'. - [code: DISALLOWED_ATTR category: DISALLOWED_HTML] - ACTION TAKEN: div.onmouseover attribute was removed due to validation issues. +- The tag 'div' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: div tag was removed due to validation issues. + + on line 8 +- The tag 'amp-iframe' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-iframe tag was removed due to validation issues. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -303,58 +166,254 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - Login - - - - - - - - - - - ORIGINAL HTML @@ -94,19 +53,119 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - -Hello, world. - - - ORIGINAL HTML @@ -74,21 +42,89 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 17 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 18 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 19 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 20 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + on line 25 -- The property 'minimum-scale' in attribute 'content' in tag 'meta name=viewport' is set to 'not-a-number', which is invalid. - [code: INVALID_PROPERTY_VALUE_IN_ATTR_VALUE category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] - ACTION TAKEN: In meta.content the "minimum-scale=not-a-number" property value pair was removed from attribute due to validation issues. -- The property 'foo' in attribute 'content' in tag 'meta name=viewport' is disallowed. - [code: DISALLOWED_PROPERTY_IN_ATTR_VALUE category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] - ACTION TAKEN: In meta.content the "foo=bar" property value pair was removed from attribute due to validation issues. The resulting attribute was empty and was also removed. -- The property 'width' is missing from attribute 'content' in tag 'meta name=viewport'. - [code: MANDATORY_PROPERTY_MISSING_FROM_ATTR_VALUE category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] -- FINAL ACTION TAKEN: meta tag removed from head as it still does not validate. Could not fix tag validation problems. +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - -Hello, world. - - - ORIGINAL HTML @@ -58,7 +38,91 @@ Transformations made from HTML tags to AMP custom tags AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 7 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 8 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 9 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 10 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 11 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - - - - - ORIGINAL HTML @@ -82,16 +47,105 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + - - - - - - - - - ORIGINAL HTML @@ -23,24 +10,35 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 1 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + GLOBAL WARNING -- The mandatory tag 'head' is missing or incorrect. - [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] - ACTION TAKEN: head tag was added to the document. +- The mandatory tag 'HTML' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'HEAD' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] - The mandatory tag 'link rel=canonical' is missing or incorrect. - [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] - The mandatory tag 'meta charset=utf-8' is missing or incorrect. - [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] ACTION TAKEN: meta charset=utf-8 tag was added to the document. - The mandatory tag 'meta name=viewport' is missing or incorrect. - [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] ACTION TAKEN: meta name=viewport tag was added to the document. -- The mandatory tag 'body' is missing or incorrect. - [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] - ACTION TAKEN: body tag was added to the document. +- The mandatory tag 'head > style[amp4ads-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/amp-a4a-format.md#boilerplate] +- The mandatory tag 'head > style[amp4email-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The mandatory tag 'BODY' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] - The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. - [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] ACTION TAKEN: amphtml engine v0.js script tag was added to the document. +- The mandatory tag 'amp4ads engine amp4ads-v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] - The mandatory tag 'noscript enclosure for boilerplate' is missing or incorrect. [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] ACTION TAKEN: noscript tag was added to the document. diff --git a/tests/test-data/full-html/incorrect_custom_style.html.out b/tests/test-data/full-html/incorrect_custom_style.html.out index 60aef94e..d515760a 100644 --- a/tests/test-data/full-html/incorrect_custom_style.html.out +++ b/tests/test-data/full-html/incorrect_custom_style.html.out @@ -1,61 +1,3 @@ - - - - - - - - - - - - - ORIGINAL HTML @@ -128,31 +70,94 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 24 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 25 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + - - - - - - ORIGINAL HTML @@ -74,15 +43,89 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 23 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 24 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 26 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 27 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + - - - - Click here to see an important message. - It's CAse inSenSitive. - vbscript is also dangerous - data urls have some risks - - - ORIGINAL HTML @@ -72,25 +42,109 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 18 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 19 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 20 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 21 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 22 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - -Hello, world. - - - ORIGINAL HTML @@ -105,15 +58,139 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 17 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 18 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 19 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 20 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 21 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 27 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 28 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 29 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 30 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + on line 32 -- The attribute 'name' in tag 'meta name= and content=' is set to the invalid value 'content-disposition'. - [code: INVALID_ATTR_VALUE category: DISALLOWED_HTML] - ACTION TAKEN: meta.name attribute was removed due to validation issues. +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 33 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 35 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 37 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -318,150 +160,425 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 23 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 24 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 26 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 27 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - -Hello, world. - - - ORIGINAL HTML @@ -72,7 +41,91 @@ Line 34: AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 24 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 25 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - -Hello, world. - - - ORIGINAL HTML @@ -76,13 +44,89 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 24 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 25 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - -Hello, world. - - - ORIGINAL HTML @@ -78,13 +45,89 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 23 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 24 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 26 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 27 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + - - - - - Hello World! - - ORIGINAL HTML @@ -72,16 +42,105 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - ORIGINAL HTML @@ -42,14 +26,94 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 2 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 3 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 4 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 5 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + - - - - - - - - - - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -147,26 +85,180 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - -

AMP boilerplate

-

Testing if the old validator is still accepted.

-

- "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..." - "There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..." -

- - - ORIGINAL HTML @@ -48,15 +28,116 @@ Line 21: AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 2 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 3 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 4 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 5 +- The tag 'title' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: title tag was removed due to validation issues. + +<link rel="canonical" href="amps.html"> on line 6 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> on line 7 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<link href="https://fonts.googleapis.com/css?family=Questrial" rel="stylesheet" type="text/css"> on line 8 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. <style> on line 9 -- The tag 'head > style[amp-boilerplate] - old variant' is deprecated - use 'head > style[amp-boilerplate]' instead. - [code: DEPRECATED_TAG category: DEPRECATION see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<noscript> on line 9 +- The tag 'noscript' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: noscript tag was removed due to validation issues. <style> on line 9 -- The tag 'noscript > style[amp-boilerplate] - old variant' is deprecated - use 'noscript > style[amp-boilerplate]' instead. - [code: DEPRECATED_TAG category: DEPRECATION see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<script async src="https://cdn.ampproject.org/v0.js"> on line 10 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<body> on line 12 +- The tag 'body' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: body tag was removed due to validation issues. + +<h1> on line 13 +- The tag 'h1' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: h1 tag was removed due to validation issues. + +<h2> on line 14 +- The tag 'h2' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: h2 tag was removed due to validation issues. + +<p> on line 15 +- The tag 'p' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: p tag was removed due to validation issues. + +GLOBAL WARNING +- The mandatory tag 'HTML' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'HEAD' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'link rel=canonical' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'meta charset=utf-8' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta charset=utf-8 tag was added to the document. +- The mandatory tag 'meta name=viewport' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta name=viewport tag was added to the document. +- The mandatory tag 'head > style[amp4ads-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/amp-a4a-format.md#boilerplate] +- The mandatory tag 'head > style[amp4email-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The mandatory tag 'BODY' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: amphtml engine v0.js script tag was added to the document. +- The mandatory tag 'amp4ads engine amp4ads-v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'noscript enclosure for boilerplate' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript tag was added to the document. +- The mandatory tag 'head > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: head > style[amp-boilerplate] tag was added to the document. +- The mandatory tag 'noscript > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript > style[amp-boilerplate] tag was added to the document. COMPONENT NAMES WITH JS PATH ------------------------------ diff --git a/tests/test-data/full-html/regexps.html.out b/tests/test-data/full-html/regexps.html.out index fa529fe9..9379e5ab 100644 --- a/tests/test-data/full-html/regexps.html.out +++ b/tests/test-data/full-html/regexps.html.out @@ -1,82 +1,3 @@ -<!DOCTYPE html> -<!-- - Copyright 2015 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. ---><!-- - Test Description: - This tests looks at specific errors related to positive and negative - regexps used inside the validator. ---><html amp><head> - <meta charset="utf-8"> - <link rel="canonical" href="./regular-html-version.html"> - <meta name="viewport" content="width=device-width,minimum-scale=1"> - <style>body {opacity: 0}</style> - <noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> - <script async src="https://cdn.ampproject.org/v0.js"></script> - - <!-- - src value_regex: "https://cdn\\.ampproject\\.org/v0/amp-vine-(latest|0\\.1).js" - The first example is valid. The latter two examples are invalid. - --> - <script async custom-element="amp-vine" src="https://cdn.ampproject.org/v0/amp-vine-latest.js"></script> - - - - <!-- - href value_regex: "https://fonts\\.googleapis\\.com/css\\?.*|https://fast\\.fonts\\.net/.*" - The first example is valid, the second example is invalid. - --> - <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?foobar"> - - - <!-- - rel value_regex: lenghty, see protoascii - The first three examples are valid. The latter three examples are invalid. - --> - <link rel="accessibility"> - <link rel="accessibility alternate"> - <link rel="accessibility alternate archives"> - - - - - <!-- - name blacklisted_value_regex: "(^|\\s)(viewport|content-disposition|revisit-after)($|\\s)" - The first two examples are valid. The latter two examples are invalid. - --> - <meta name="valid" content=""> - <meta name="validcontent-disposition" content=""> - <meta content=""> - <meta content=""> - - <script async custom-element="amp-audio" src="https://cdn.ampproject.org/v0/amp-audio-0.1.js"></script> -</head> -<body> - - <!-- - autoplay value_regex: "^$|desktop|tablet|mobile" - The first two examples are valid, the latter three examples are invalid. - --> - <amp-audio src="https://exmaple.com/audio" layout="fixed" autoplay></amp-audio> - <amp-audio src="https://example.com/audio" layout="fixed" autoplay="desktop"></amp-audio> - <amp-audio src="https://example.com/audio" layout="fixed"></amp-audio> - <amp-audio src="https://example.com/audio" layout="fixed"></amp-audio> - <amp-audio src="https://example.com/audio" layout="fixed"></amp-audio> - -</body> - -</html> ORIGINAL HTML @@ -171,82 +92,190 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL +<html amp> on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + +<head> on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + +<meta charset="utf-8"> on line 24 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<link rel="canonical" href="./regular-html-version.html"> on line 25 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<meta name="viewport" content="width=device-width,minimum-scale=1"> on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + <style> on line 27 -- The tag 'head > style[amp-boilerplate] - old variant' is deprecated - use 'head > style[amp-boilerplate]' instead. - [code: DEPRECATED_TAG category: DEPRECATION see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] -- The mandatory text (CDATA) inside tag 'head > style[amp-boilerplate] - old variant' is missing or incorrect. - [code: MANDATORY_CDATA_MISSING_OR_INCORRECT category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] - ACTION TAKEN: head > style[amp-boilerplate] - old variant CDATA was added or modified to fit requirements. +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<noscript> on line 28 +- The tag 'noscript' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: noscript tag was removed due to validation issues. + +<style amp-boilerplate> on line 28 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<script async src="https://cdn.ampproject.org/v0.js"> on line 29 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<script async custom-element="amp-vine" src="https://cdn.ampproject.org/v0/amp-vine-latest.js"> on line 35 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. <script async custom-element="amp-vine" src="https://cdn.ampproject.org/v0/amp-vine-0.1.js?foobar"> on line 36 -- The attribute 'src' in tag 'amp-vine extension .js script' is set to the invalid value 'https://cdn.ampproject.org/v0/amp-vine-0.1.js?foobar'. - [code: INVALID_ATTR_VALUE category: CUSTOM_JAVASCRIPT_DISALLOWED see: https://www.ampproject.org/docs/reference/extended/amp-vine.html] - ACTION TAKEN: script.src attribute was removed due to validation issues. -- FINAL ACTION TAKEN: script tag removed from head as it still does not validate. Could not fix tag validation problems. +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. <script async custom-element="amp-vine" src="http://xss.com/https://cdn.ampproject.org/v0/amp-vine-0.1.js?foobar"> on line 37 -- The attribute 'src' in tag 'amp-vine extension .js script' is set to the invalid value 'http://xss.com/https://cdn.ampproject.org/v0/amp-vine-0.1.js?foobar'. - [code: INVALID_ATTR_VALUE category: CUSTOM_JAVASCRIPT_DISALLOWED see: https://www.ampproject.org/docs/reference/extended/amp-vine.html] - ACTION TAKEN: script.src attribute was removed due to validation issues. -- FINAL ACTION TAKEN: script tag removed from head as it still does not validate. Could not fix tag validation problems. +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?foobar"> on line 44 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. <link rel="stylesheet" type="text/css" href="http://xss.com/https://fonts.googleapis.com/css?foobar"> on line 46 -- The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value 'http://xss.com/https://fonts.googleapis.com/css?foobar'. - [code: INVALID_ATTR_VALUE category: AUTHOR_STYLESHEET_PROBLEM] - ACTION TAKEN: link.href attribute was removed due to validation issues. -- FINAL ACTION TAKEN: link tag removed from head as it still does not validate. Could not fix tag validation problems. +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<link rel="accessibility"> on line 52 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<link rel="accessibility alternate"> on line 53 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<link rel="accessibility alternate archives"> on line 54 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. <link rel="import"> on line 55 -- The attribute 'rel' in tag 'link rel=' is set to the invalid value 'import'. - [code: INVALID_ATTR_VALUE category: DISALLOWED_HTML] - ACTION TAKEN: link.rel attribute was removed due to validation issues. -- FINAL ACTION TAKEN: link tag removed from head as it still does not validate. Could not fix tag validation problems. +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. <link rel="accessibility subresource"> on line 56 -- The attribute 'rel' in tag 'link rel=' is set to the invalid value 'accessibility subresource'. - [code: INVALID_ATTR_VALUE category: DISALLOWED_HTML] - ACTION TAKEN: link.rel attribute was removed due to validation issues. -- FINAL ACTION TAKEN: link tag removed from head as it still does not validate. Could not fix tag validation problems. +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. <link rel="manifest accessibility"> on line 57 -- The attribute 'rel' in tag 'link rel=' is set to the invalid value 'manifest accessibility'. - [code: INVALID_ATTR_VALUE category: DISALLOWED_HTML] - ACTION TAKEN: link.rel attribute was removed due to validation issues. -- FINAL ACTION TAKEN: link tag removed from head as it still does not validate. Could not fix tag validation problems. +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<meta name="valid" content> on line 63 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<meta name="validcontent-disposition" content> on line 64 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. <meta name="content-disposition" content> on line 65 -- The attribute 'name' in tag 'meta name= and content=' is set to the invalid value 'content-disposition'. - [code: INVALID_ATTR_VALUE category: DISALLOWED_HTML] - ACTION TAKEN: meta.name attribute was removed due to validation issues. +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. <meta name="invalid content-disposition" content> on line 66 -- The attribute 'name' in tag 'meta name= and content=' is set to the invalid value 'invalid content-disposition'. - [code: INVALID_ATTR_VALUE category: DISALLOWED_HTML] - ACTION TAKEN: meta.name attribute was removed due to validation issues. +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<body> on line 69 +- The tag 'body' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: body tag was removed due to validation issues. + +<amp-audio src="https://exmaple.com/audio" layout="fixed" autoplay> on line 75 +- The tag 'amp-audio' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-audio tag was removed due to validation issues. + +<amp-audio src="https://example.com/audio" layout="fixed" autoplay="desktop"> on line 76 +- The tag 'amp-audio' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-audio tag was removed due to validation issues. <amp-audio src="https://example.com/audio" layout="fixed" autoplay="invalid"> on line 77 -- The attribute 'autoplay' in tag 'amp-audio' is set to the invalid value 'invalid'. - [code: INVALID_ATTR_VALUE category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-audio.html] - ACTION TAKEN: amp-audio.autoplay attribute was removed due to validation issues. +- The tag 'amp-audio' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-audio tag was removed due to validation issues. <amp-audio src="https://example.com/audio" layout="fixed" autoplay="desktopfoo"> on line 78 -- The attribute 'autoplay' in tag 'amp-audio' is set to the invalid value 'desktopfoo'. - [code: INVALID_ATTR_VALUE category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-audio.html] - ACTION TAKEN: amp-audio.autoplay attribute was removed due to validation issues. +- The tag 'amp-audio' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-audio tag was removed due to validation issues. <amp-audio src="https://example.com/audio" layout="fixed" autoplay="foodesktop"> on line 79 -- The attribute 'autoplay' in tag 'amp-audio' is set to the invalid value 'foodesktop'. - [code: INVALID_ATTR_VALUE category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-audio.html] - ACTION TAKEN: amp-audio.autoplay attribute was removed due to validation issues. +- The tag 'amp-audio' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-audio tag was removed due to validation issues. GLOBAL WARNING -- The tag 'head > style[amp-boilerplate]' is missing or incorrect, but required by 'noscript > style[amp-boilerplate]'. - [code: TAG_REQUIRED_BY_MISSING category: GENERIC see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] -- The tag 'amp-audio extension .js script' is missing or incorrect, but required by 'amp-audio'. - [code: TAG_REQUIRED_BY_MISSING category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-audio.html] - ACTION TAKEN: amp-audio custom component script tag added to head +- The mandatory tag 'HTML' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'HEAD' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'link rel=canonical' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'meta charset=utf-8' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta charset=utf-8 tag was added to the document. +- The mandatory tag 'meta name=viewport' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta name=viewport tag was added to the document. +- The mandatory tag 'head > style[amp4ads-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/amp-a4a-format.md#boilerplate] +- The mandatory tag 'head > style[amp4email-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The mandatory tag 'BODY' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: amphtml engine v0.js script tag was added to the document. +- The mandatory tag 'amp4ads engine amp4ads-v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'noscript enclosure for boilerplate' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript tag was added to the document. +- The mandatory tag 'head > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: head > style[amp-boilerplate] tag was added to the document. +- The mandatory tag 'noscript > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript > style[amp-boilerplate] tag was added to the document. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-audio', include path 'https://cdn.ampproject.org/v0/amp-audio-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/full-html/several_errors.html.out b/tests/test-data/full-html/several_errors.html.out index 6dd54518..13064b5c 100644 --- a/tests/test-data/full-html/several_errors.html.out +++ b/tests/test-data/full-html/several_errors.html.out @@ -1,42 +1,3 @@ -<!DOCTYPE html> -<!-- - Copyright 2015 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. ---><!-- - Test Description: - This example has several problems - see the .out file. ---><html amp><head> - <meta> - <link rel="canonical" href="./regular-html-version.html"> - <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> - - <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script> -<meta charset="utf-8"> -<meta name="viewport" content="width=device-width,minimum-scale=1"> -<script async src="https://cdn.ampproject.org/v0.js"></script> -</head> -<body> - <table><tr><td>Tables are allowed</td></tr></table> - <amp-img src="dimensions_are_missing.jpg" layout="fixed"></amp-img> - <!-- We don't allow percent as a size unit either. --> - <amp-ad height="300"> - <!-- <script>document.write(…)</script> --> - </amp-ad> - <amp-ad width="42" height="42"></amp-ad> -</body> - -</html> ORIGINAL HTML @@ -88,42 +49,114 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL +<html amp> on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + +<head> on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + <meta charset="pick-a-key"> on line 23 -- The attribute 'charset' may not appear in tag 'meta name= and content='. - [code: DISALLOWED_ATTR category: DISALLOWED_HTML] - ACTION TAKEN: meta.charset attribute was removed due to validation issues. +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<link rel="canonical" href="./regular-html-version.html"> on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<style amp-boilerplate> on line 25 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<noscript> on line 25 +- The tag 'noscript' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: noscript tag was removed due to validation issues. + +<style amp-boilerplate> on line 25 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. <script type="javascript"> on line 26 -- The tag 'script' is disallowed except in specific forms. - [code: GENERAL_DISALLOWED_TAG category: CUSTOM_JAVASCRIPT_DISALLOWED] +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] ACTION TAKEN: script tag was removed due to validation issues. +<body> on line 30 +- The tag 'body' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: body tag was removed due to validation issues. + +<table> on line 31 +- The tag 'table' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: table tag was removed due to validation issues. + +<tr> on line 31 +- The tag 'tr' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: tr tag was removed due to validation issues. + +<td> on line 31 +- The tag 'td' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: td tag was removed due to validation issues. + <amp-img src="dimensions_are_missing.jpg" layout="fixed"> on line 32 -- The mandatory attribute 'height' is missing in tag 'amp-img'. - [code: MANDATORY_ATTR_MISSING category: AMP_LAYOUT_PROBLEM see: https://www.ampproject.org/docs/reference/amp-img.html] +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. <amp-ad width="100%" height="300"> on line 34 -- The attribute 'width' in tag 'amp-ad' is set to the invalid value '100%'. - [code: INVALID_ATTR_VALUE category: AMP_LAYOUT_PROBLEM see: https://www.ampproject.org/docs/reference/amp-ad.html] - ACTION TAKEN: amp-ad.width attribute was removed due to validation issues. -- The mandatory attribute 'type' is missing in tag 'amp-ad'. - [code: MANDATORY_ATTR_MISSING category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/amp-ad.html] +- The tag 'amp-ad' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-ad tag was removed due to validation issues. <amp-ad width="42" height="42" made_up_attribute="oh hi"> on line 37 -- The attribute 'made_up_attribute' may not appear in tag 'amp-ad'. - [code: DISALLOWED_ATTR category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/amp-ad.html] - ACTION TAKEN: amp-ad.made_up_attribute attribute was removed due to validation issues. +- The tag 'amp-ad' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-ad tag was removed due to validation issues. GLOBAL WARNING +- The mandatory tag 'HTML' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'HEAD' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'link rel=canonical' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] - The mandatory tag 'meta charset=utf-8' is missing or incorrect. - [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] ACTION TAKEN: meta charset=utf-8 tag was added to the document. - The mandatory tag 'meta name=viewport' is missing or incorrect. - [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] ACTION TAKEN: meta name=viewport tag was added to the document. +- The mandatory tag 'head > style[amp4ads-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/amp-a4a-format.md#boilerplate] +- The mandatory tag 'head > style[amp4email-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The mandatory tag 'BODY' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] - The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. - [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec.html#required-markup] + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] ACTION TAKEN: amphtml engine v0.js script tag was added to the document. +- The mandatory tag 'amp4ads engine amp4ads-v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'noscript enclosure for boilerplate' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript tag was added to the document. +- The mandatory tag 'head > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: head > style[amp-boilerplate] tag was added to the document. +- The mandatory tag 'noscript > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript > style[amp-boilerplate] tag was added to the document. COMPONENT NAMES WITH JS PATH ------------------------------ diff --git a/tests/test-data/full-html/spec_example.html.out b/tests/test-data/full-html/spec_example.html.out index 6abf0042..da977e6b 100644 --- a/tests/test-data/full-html/spec_example.html.out +++ b/tests/test-data/full-html/spec_example.html.out @@ -1,57 +1,3 @@ -<!DOCTYPE html> -<!-- - Copyright 2015 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. ---><!-- - Test Description: - This is the sample document from the AMP spec. - https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md ---><html amp><head> - <meta charset="utf-8"> - <title>Sample document - - - - - - - - - - -

Sample document

-

- Some text - -

- - - - - ORIGINAL HTML @@ -121,7 +67,131 @@ Line 60: AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 24 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 25 +- The tag 'title' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: title tag was removed due to validation issues. + +<link rel="canonical" href="./regular-html-version.html"> on line 26 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> on line 27 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<style amp-custom> on line 28 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<script type="application/ld+json"> on line 31 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"> on line 42 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<style amp-boilerplate> on line 43 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<noscript> on line 43 +- The tag 'noscript' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: noscript tag was removed due to validation issues. + +<style amp-boilerplate> on line 43 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<script async src="https://cdn.ampproject.org/v0.js"> on line 44 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<body> on line 46 +- The tag 'body' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: body tag was removed due to validation issues. + +<h1> on line 47 +- The tag 'h1' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: h1 tag was removed due to validation issues. + +<p> on line 48 +- The tag 'p' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: p tag was removed due to validation issues. + +<amp-img src="sample.jpg" width="300" height="300"> on line 50 +- The tag 'amp-img' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-img tag was removed due to validation issues. + +<amp-ad width="300" height="250" type="a9" data-aax_size="300x250" data-aax_pubname="test123" data-aax_src="302"> on line 56 +- The tag 'amp-ad' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-ad tag was removed due to validation issues. + +GLOBAL WARNING +- The mandatory tag 'HTML' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'HEAD' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'link rel=canonical' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'meta charset=utf-8' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta charset=utf-8 tag was added to the document. +- The mandatory tag 'meta name=viewport' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta name=viewport tag was added to the document. +- The mandatory tag 'head > style[amp4ads-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/amp-a4a-format.md#boilerplate] +- The mandatory tag 'head > style[amp4email-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The mandatory tag 'BODY' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: amphtml engine v0.js script tag was added to the document. +- The mandatory tag 'amp4ads engine amp4ads-v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'noscript enclosure for boilerplate' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript tag was added to the document. +- The mandatory tag 'head > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: head > style[amp-boilerplate] tag was added to the document. +- The mandatory tag 'noscript > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript > style[amp-boilerplate] tag was added to the document. COMPONENT NAMES WITH JS PATH ------------------------------ diff --git a/tests/test-data/full-html/svg.html.out b/tests/test-data/full-html/svg.html.out index 4f3d5b6a..f534f32b 100644 --- a/tests/test-data/full-html/svg.html.out +++ b/tests/test-data/full-html/svg.html.out @@ -1,87 +1,3 @@ -<!DOCTYPE html> -<!-- - Copyright 2015 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. ---><!-- - Test Description: - Tests SVG tags and attrs. ---><html amp><head> - <meta charset="utf-8"> - <link rel="canonical" href="./regular-html-version.html"> - <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui"> - <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> - <script async src="https://cdn.ampproject.org/v0.js"></script> -</head> -<body> - <h2>SVG</h2> - <!-- same svg pic as the one in valid_examples_from_github/everything.amp.html --> - <!-- "unofficial amphtml logo" --> - <svg width="400" height="296" viewBox="1400 500 3000 2500"> - <path d="m 3766.9354,1578.1181 c 58.2769,-756.81944 -408.1876,-717.21057 -510.4769,-701.02201 -79.902,12.64545 -239.2559,90.53098 -313.8601,318.92831 -82.3686,252.1683 143.3895,461.6098 259.4436,801.3231 172.8182,640.8523 -882.0196,923.1062 -1227.7959,798.7381 -69.3048,-30.0286 -182.3973,-108.7232 -158.8806,-186.5382 8.5153,-72.4218 -105.5719,-107.3077 -82.4098,-11.1024 95.373,379.694 618.3608,323.5968 1066.1849,144.2115 250.0432,-100.16 489.5859,-347.2474 489.7608,-633.164 -50.7024,-386.8592 -391.2774,-599.5297 -282.7825,-917.5279 173.2946,-330.57664 355.7612,-318.24308 596.6594,-169.4657 82.8022,96.8444 115.4521,181.225 119.5309,313.0092 2.5525,82.4609 -36.2889,260.8703 44.6262,242.61 z" fill="#669900" /> - <path d="m 4416.0026,1455.3672 c 77.2745,23.6811 73.5053,107.3467 75.9575,166.8979 15.3869,149.8221 -6.2292,300.1828 4.2896,450.1688 -8.5601,219.3654 0.7438,438.9849 -1.682,658.4723 -9.842,56.6077 34.5512,148.3936 -55.7836,165.4604 -81.0177,12.4369 -163.7234,-0.9781 -245.5127,3.3739 -248.997,-1.7285 -498.1326,1.9053 -747.01,-2.3009 -86.3231,6.2887 -77.5196,-71.1333 -75.8856,-133.0733 43.1106,-461.6582 -55.107,-895.0067 58.8105,-1302.5316 173.2754,-4.339 702.7558,-6.7657 986.8163,-6.4675 z" fill="#6699ff" /> - <path d="m 3534.2772,1717.8648 c 221.2517,21.2119 572.0499,-17.0571 851.7094,28.1009 -21.0892,135.2035 -26.2108,343.7127 -18.8464,481.1314 0.6629,160.8137 -8.6026,320.1194 -0.3032,497.6322 -118.3583,29.6629 -269.1727,23.1546 -403.9033,17.3782 -156.4796,-6.7087 -363.7832,20.958 -488.8767,-22.9287 16.6915,-141.6537 14.7827,-372.2907 21.3755,-514.5289 7.5082,-162.6119 26.4066,-324.4933 38.8447,-486.7851 z" fill="#3366cc" /> - <path d="m 3889.2766,1650.5266 c 27.7364,23.6886 72.1445,20.4506 101.2331,1.0458 22.3604,-17.6131 19.1236,-56.6446 -8.0767,-68.5575 -51.3171,-39.4426 -125.0811,27.5752 -93.1564,67.5117 z" fill="#ff6600" /> - <path d="m 3985.4115,1806.5993 c -54.1134,86.3413 -120.9065,155.5988 -208.7186,279.6705 -98.9752,111.8484 -122.1792,163.717 136.357,69.2462 175.8375,-36.4294 35.4891,130.704 -15.9848,267.0009 -45.1026,119.4263 -83.2501,196.2986 -92.2725,256.8308 139.8358,-155.934 233.9965,-339.5471 357.0405,-505.614 167.1182,-233.0853 -225.0018,-15.3832 -266.0121,-102.9119 38.3338,-115.9788 97.6167,-173.7877 89.7826,-252.6178 l -0.1926,-11.6047 0,0 z" fill="#ffcc00" /> - <path d="m 4099.9162,1659.9255 c 27.7366,23.6887 72.1447,20.4507 101.2333,1.046 22.3604,-17.6133 19.1235,-56.6446 -8.0768,-68.5575 -51.3168,-39.4426 -125.0812,27.5752 -93.1565,67.5115 z" fill="#ff6600" /> - <path d="m 3681.6605,1651.4038 c 27.7364,23.6888 72.1445,20.4506 101.2332,1.046 22.3603,-17.6132 19.1234,-56.6448 -8.0769,-68.5575 -51.3169,-39.4428 -125.0811,27.5751 -93.1563,67.5115 z" fill="#ff6600" /> - <path d="m 2575.0536,1072.0944 c -41.7949,-215.28999 -198.1073,64.4153 -379.7157,193.092 -133.7465,94.7647 -234.5954,11.3165 -570.0903,133.4228 -401.8972,146.2742 -388.2427,684.9442 -224.4598,986.8548 366.0107,674.6879 1103.0419,131.271 1216.6407,-55.3662 104.6211,-171.8874 330.8926,-138.9279 453.9675,-237.6837 59.7216,-47.9209 -5.9599,-359.9096 -105.7909,-337.7945 -648.2816,143.6118 -380.3137,-629.7889 -390.5515,-682.5252 z" fill="#ffcc00" /> - <path d="m 2058.3207,1381.3517 c -555.3851,-61.9665 -825.72,463.8013 -645.5204,442.4364 185.0637,-21.9416 158.9799,-504.669 310.9149,49.8713 57.2299,208.8816 401.8092,439.7925 494.821,638.6355 11.6767,57.5407 75.9987,46.3975 104.7889,25.124 31.5505,-23.313 18.9107,-80.0105 6.3288,-117.0635 -83.6721,-143.0048 -274.9312,-272.5734 -377.898,-377.9464 -120.8368,-136.4516 -208.1109,-334.9469 -151.0128,-495.0356 34.8137,-61.4683 63.3834,-80.7131 124.7882,-78.1048 55.22,9.7787 202.4079,237.5436 211.6533,157.296 6.1561,-44.3048 11.1555,-235.1689 -78.8639,-245.2129 z" fill="#ff6600" /> - <path d="m 4005.3105,689.39563 c -132.1157,120.32132 -1412.0359,816.95107 -1555.1646,911.30147 160.4961,184.2922 15.234,-12.8488 95.6898,137.9579 550.1675,-329.2476 954.2058,-586.1938 1528.6046,-873.93017 75.1515,-104.89315 -12.1136,-113.30773 -69.1298,-175.3292 z" fill="#3366cc" /> - <path d="m 2194.3681,1352.5268 c 9.2935,-33.3595 115.3351,-96.1488 116.2957,-60.9354 14.1803,519.7676 226.8596,740.1443 346.5092,899.2496 -9.1403,53.8137 -95.4967,108.843 -112.5912,76.6163 -104.516,-105.815 -172.0892,-466.006 -263.1765,-522.0611 -35.4594,-21.8216 12.7645,157.4396 -44.8138,184.0385 -77.4149,35.7627 -124.043,-138.0522 -229.1002,-113.7727 -18.3195,211.0153 555.9431,443.0665 505.2979,529.8185 -23.9237,43.5892 -81.9643,131.8588 -116.5557,78.0317 -146.1854,-207.6808 -213.2253,-245.8824 -420.072,-434.4752 -155.6003,-141.8688 -136.5394,-403.4861 -68.1091,-424.1442 116.1363,-27.4812 191.9444,245.9541 275.2956,188.1784 65.7711,-140.9662 -10.6629,-310.5452 11.0201,-400.5444 z" fill="#669900" /> - <path d="m 1640.1413,1783.8678 c -1.2739,288.86 586.9469,664.0874 521.3165,807.9936 -69.3201,51.7542 -264.7475,48.6232 -223.0496,-59.7663 40.7522,-117.7527 -130.0456,-272.4627 -303.3394,-291.2684 -296.5803,-32.1851 105.9828,212.4171 191.594,291.2294 36.2581,33.3788 125.7201,137.2209 -60.6765,119.5389 -142.0502,-35.061 -243.6721,-174.3502 -325.3694,-295.8032 -78.4159,-116.5746 -186.0507,-483.4195 -48.246,-480.286 125.3372,6.1146 22.5452,202.8366 86.2367,275.034 41.4944,47.0359 443.4581,128.9297 80.3823,-189.183 -157.9532,-138.3924 81.516,-260.2092 81.1514,-177.489 z" fill="#3366cc" /> - <path d="m 4079.5806,868.74488 c -18.4503,-3.3062 -24.5591,-6.34261 -33.5316,-16.66736 -4.696,-5.40376 -13.8197,-14.12548 -20.2749,-19.38163 -15.4956,-12.61776 -67.3382,-71.44012 -79.5473,-90.25706 -5.3049,-8.17621 -11.2871,-16.48111 -13.2935,-18.45531 -3.2617,-3.20909 -2.0572,-6.35995 11.3672,-29.73174 8.2588,-14.37823 17.879,-28.42525 21.3781,-31.21559 5.1887,-4.13699 12.0245,-5.80701 37.0394,-9.04885 16.8723,-2.18653 54.8305,-8.80671 84.352,-14.71151 29.5216,-5.90476 65.0265,-12.78154 78.8997,-15.28165 l 25.2242,-4.54567 23.7713,9.77618 c 62.8275,25.83824 111.7721,65.33019 111.7721,90.18546 1e-4,5.06675 -4.6709,12.80857 -17.366,28.78381 -52.1377,65.60993 -108.3882,110.96089 -146.1569,117.83656 -19.9034,3.62333 -69.5666,5.23515 -83.6338,2.71436 z" fill="#ff6600" /> - <path d="m 2377.3238,1269.2624 c -26.787,279.7212 111.0044,672.201 309.1165,843.6212 80.8729,69.9767 240.8138,-4.026 318.9086,-41.6454 45.2094,-35.9724 35.0313,-101.296 26.1997,-150.9873 -17.4339,-69.7557 -49.832,-121.797 -100.685,-116.1204 -45.4057,5.0682 -68.5356,8.8251 -64.9322,120.9642 1.3601,42.327 -40.4759,93.1741 -89.0657,90.4079 -52.9357,4.327 -75.8994,-38.881 -101.1012,-69.9814 -212.4085,-262.1247 -233.2146,-599.5762 -162.849,-813.093 10.758,-32.6441 5.6189,-86.0919 -34.34,-65.3213 -75.6217,39.3078 -93.8408,124.7689 -101.2517,202.1555 z" fill="#ff6600" /> - </svg> - -<!-- This has some text saying "Oh HI I'm an SVG." and three geometric shapes - in red, green, and blue underneath. --> -<svg width="640" height="480"> - <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ --> - <g> - <title>Layer 1 - Oh Hi I'm an SVG. - - - - - - - - - - - - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -178,7 +94,261 @@ Line 87: AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - ORIGINAL HTML @@ -77,37 +43,132 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 2 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 3 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 4 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 5 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 6 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - ORIGINAL HTML @@ -95,37 +48,132 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 7 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 8 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 9 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 10 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 11 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - - - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -132,28 +73,165 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 27 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 28 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 29 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 30 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 31 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - Valid URL - Valid URL - Valid URL - Valid URL - Valid URL - Valid URL - Valid URL - Valid URL - Invalid protocol - Invalid protocol - Invalid protocol - Invalid protocol - Invalid protocol - Valid protocol - Malformed URL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -179,135 +95,279 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 24 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + on line 25 -- Invalid URL protocol 'javascript:' for attribute 'href' in tag 'link rel=canonical'. - [code: INVALID_URL_PROTOCOL category: DISALLOWED_HTML see: https://www.ampproject.org/docs/reference/spec.html#required-markup] - ACTION TAKEN: link.href attribute was removed due to validation issues. -- FINAL ACTION TAKEN: link tag removed from head as it still does not validate. Could not fix tag validation problems. +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - -
-

Section 1

-

Bunch of awesome content

-
-
-

Section 2

-
Bunch of awesome content
-
-
-

Section 3

- -
-
-

Properly nested amp-accordion

- -
-

Nested section

-

It's possible to nest amp-accordions.

-
-
-
-
-
The header tag is supported as well.
-

Even more awesome.

-
-
- - - - - -

Some paragraph of text that doesn't belong here.

-
-
header which isn't h1-h6.
-
a second child
-
a third child
-
-
- - - ORIGINAL HTML @@ -152,19 +82,225 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -89,17 +50,105 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -103,9 +63,112 @@ Line 56: AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 24 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 25 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -105,15 +64,114 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 23 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 24 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 26 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 27 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - - -

-

-

- - - - - - - - - - - - - ORIGINAL HTML @@ -250,157 +131,391 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -105,9 +65,112 @@ Line 58: AMP-HTML Validation Issues and Fixes ------------------------------------- -PASS +FAIL + + on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 24 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 25 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - -
-

Section 1

-

Content

-
-
-

Section 2

-

Content

-
-
- - -
- - - - - - - ORIGINAL HTML @@ -119,24 +66,170 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 22 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 23 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 24 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 25 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + - - - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -104,22 +61,130 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 26 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + - - - - - - - - - - - - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -143,50 +92,149 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 26 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + + - - - - -

Vimeo

- - - - - - - - - - - - - - - - - - - - - ORIGINAL HTML @@ -114,21 +63,140 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL + on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + + on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + + on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + + on line 24 +- The tag 'title' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: title tag was removed due to validation issues. + +<link rel="canonical" href="amps.html"> on line 25 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> on line 26 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<link href="https://fonts.googleapis.com/css?family=Questrial" rel="stylesheet" type="text/css"> on line 27 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<script async custom-element="amp-vimeo" src="https://cdn.ampproject.org/v0/amp-vimeo-0.1.js"> on line 28 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<style amp-boilerplate> on line 29 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<noscript> on line 29 +- The tag 'noscript' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: noscript tag was removed due to validation issues. + +<style amp-boilerplate> on line 29 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<script async src="https://cdn.ampproject.org/v0.js"> on line 30 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<body> on line 32 +- The tag 'body' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: body tag was removed due to validation issues. + +<h2> on line 33 +- The tag 'h2' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: h2 tag was removed due to validation issues. + +<amp-vimeo data-videoid="27246366" width="500" height="281"> on line 36 +- The tag 'amp-vimeo' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-vimeo tag was removed due to validation issues. + +<amp-vimeo data-videoid="27246366" width="500" height="281" layout="responsive" noloading> on line 39 +- The tag 'amp-vimeo' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-vimeo tag was removed due to validation issues. + +<amp-vimeo data-videoid="27246366" width="500" height="281" layout="responsive" noloading="noloading"> on line 42 +- The tag 'amp-vimeo' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-vimeo tag was removed due to validation issues. + <amp-vimeo data-videoid="i don't think so" width="500" height="281" layout="responsive"> on line 45 -- The attribute 'data-videoid' in tag 'amp-vimeo' is set to the invalid value 'i don't think so'. - [code: INVALID_ATTR_VALUE category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-vimeo.html] - ACTION TAKEN: amp-vimeo.data-videoid attribute was removed due to validation issues. +- The tag 'amp-vimeo' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-vimeo tag was removed due to validation issues. <amp-vimeo width="500" height="281" layout="responsive"> on line 48 -- The mandatory attribute 'data-videoid' is missing in tag 'amp-vimeo'. - [code: MANDATORY_ATTR_MISSING category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-vimeo.html] +- The tag 'amp-vimeo' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-vimeo tag was removed due to validation issues. <amp-vimeo width="500" height="281" layout="responsive" noloading="foo"> on line 51 -- The attribute 'noloading' in tag 'amp-vimeo' is set to the invalid value 'foo'. - [code: INVALID_ATTR_VALUE category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-vimeo.html] - ACTION TAKEN: amp-vimeo.noloading attribute was removed due to validation issues. +- The tag 'amp-vimeo' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-vimeo tag was removed due to validation issues. + +GLOBAL WARNING +- The mandatory tag 'HTML' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'HEAD' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'link rel=canonical' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'meta charset=utf-8' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta charset=utf-8 tag was added to the document. +- The mandatory tag 'meta name=viewport' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta name=viewport tag was added to the document. +- The mandatory tag 'head > style[amp4ads-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/amp-a4a-format.md#boilerplate] +- The mandatory tag 'head > style[amp4email-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The mandatory tag 'BODY' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: amphtml engine v0.js script tag was added to the document. +- The mandatory tag 'amp4ads engine amp4ads-v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'noscript enclosure for boilerplate' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript tag was added to the document. +- The mandatory tag 'head > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: head > style[amp-boilerplate] tag was added to the document. +- The mandatory tag 'noscript > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript > style[amp-boilerplate] tag was added to the document. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-vimeo', include path 'https://cdn.ampproject.org/v0/amp-vimeo-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/full-html/validator-amp-youtube.html.out b/tests/test-data/full-html/validator-amp-youtube.html.out index 461ea0f5..e92d4fd7 100644 --- a/tests/test-data/full-html/validator-amp-youtube.html.out +++ b/tests/test-data/full-html/validator-amp-youtube.html.out @@ -1,50 +1,3 @@ -<!DOCTYPE html> -<!-- - Copyright 2015 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. ---><!-- - Test Description: - Tests for the amp-youtube tag. See the inline comments. ---><html amp><head> - <meta charset="utf-8"> - <link rel="canonical" href="./regular-html-version.html"> - <meta name="viewport" content="width=device-width,minimum-scale=1"> - <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> - <script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-latest.js"></script> - <script async src="https://cdn.ampproject.org/v0.js"></script> -</head> -<body> - <!-- This deprecated, we now prefer data-videoid. --> - <amp-youtube width="480" height="270" video-id="https://www.youtube.com/watch?v=9bZkp7q19f0"> - </amp-youtube> - <amp-youtube width="480" height="270" video-id="9bZkp7q19f0"> - </amp-youtube> - <!-- This is the current way to do it, according to -https://github.com/ampproject/amphtml/blob/master/extensions/amp-youtube/amp-youtube.md --> - <amp-youtube width="480" height="270" data-videoid="https://www.youtube.com/watch?v=dQw4w9WgXcQ"> - </amp-youtube> - <!-- This is invalid, the video id is missing. --> - <amp-youtube width="480" height="270"></amp-youtube> - <!-- This is also invalid, dimensions are missing. --> - <amp-youtube data-videoid="https://www.youtube.com/watch?v=dQw4w9WgXcQ"> - </amp-youtube> - <!-- This is invalid, one can only have one of these two. --> - <amp-youtube width="480" height="270" video-id="https://www.youtube.com/watch?v=9bZkp7q19f0"> - </amp-youtube> -</body> - -</html> ORIGINAL HTML @@ -111,30 +64,125 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL +<html amp> on line 21 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + +<head> on line 22 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + +<meta charset="utf-8"> on line 23 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<link rel="canonical" href="./regular-html-version.html"> on line 24 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<meta name="viewport" content="width=device-width,minimum-scale=1"> on line 25 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<style amp-boilerplate> on line 26 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<noscript> on line 26 +- The tag 'noscript' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: noscript tag was removed due to validation issues. + +<style amp-boilerplate> on line 26 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-latest.js"> on line 27 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<script async src="https://cdn.ampproject.org/v0.js"> on line 28 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<body> on line 30 +- The tag 'body' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: body tag was removed due to validation issues. + <amp-youtube width="480" height="270" video-id="https://www.youtube.com/watch?v=9bZkp7q19f0"> on line 33 -- The attribute 'video-id' in tag 'amp-youtube' is deprecated - use 'data-videoid' instead. - [code: DEPRECATED_ATTR category: DEPRECATION see: https://www.ampproject.org/docs/reference/extended/amp-youtube.html] +- The tag 'amp-youtube' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-youtube tag was removed due to validation issues. <amp-youtube width="480" height="270" video-id="9bZkp7q19f0"> on line 36 -- The attribute 'video-id' in tag 'amp-youtube' is deprecated - use 'data-videoid' instead. - [code: DEPRECATED_ATTR category: DEPRECATION see: https://www.ampproject.org/docs/reference/extended/amp-youtube.html] +- The tag 'amp-youtube' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-youtube tag was removed due to validation issues. + +<amp-youtube width="480" height="270" data-videoid="https://www.youtube.com/watch?v=dQw4w9WgXcQ"> on line 41 +- The tag 'amp-youtube' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-youtube tag was removed due to validation issues. <amp-youtube width="480" height="270"> on line 44 -- The tag 'amp-youtube' is missing a mandatory attribute - pick one of ['src', 'data-videoid']. - [code: MANDATORY_ONEOF_ATTR_MISSING category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-youtube.html] +- The tag 'amp-youtube' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-youtube tag was removed due to validation issues. <amp-youtube data-videoid="https://www.youtube.com/watch?v=dQw4w9WgXcQ"> on line 46 -- The implied layout 'CONTAINER' is not supported by tag 'amp-youtube'. - [code: IMPLIED_LAYOUT_INVALID category: AMP_LAYOUT_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-youtube.html] +- The tag 'amp-youtube' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-youtube tag was removed due to validation issues. <amp-youtube width="480" height="270" video-id="https://www.youtube.com/watch?v=9bZkp7q19f0" data-videoid="https://www.youtube.com/watch?v=dQw4w9WgXcQ"> on line 51 -- The attribute 'video-id' in tag 'amp-youtube' is deprecated - use 'data-videoid' instead. - [code: DEPRECATED_ATTR category: DEPRECATION see: https://www.ampproject.org/docs/reference/extended/amp-youtube.html] -- Mutually exclusive attributes encountered in tag 'amp-youtube' - pick one of ['src', 'data-videoid']. - [code: MUTUALLY_EXCLUSIVE_ATTRS category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-youtube.html] - ACTION TAKEN: data-videoid attribute(s) removed as they were mutually exclusive. +- The tag 'amp-youtube' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-youtube tag was removed due to validation issues. + +GLOBAL WARNING +- The mandatory tag 'HTML' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'HEAD' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'link rel=canonical' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'meta charset=utf-8' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta charset=utf-8 tag was added to the document. +- The mandatory tag 'meta name=viewport' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta name=viewport tag was added to the document. +- The mandatory tag 'head > style[amp4ads-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/amp-a4a-format.md#boilerplate] +- The mandatory tag 'head > style[amp4email-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The mandatory tag 'BODY' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: amphtml engine v0.js script tag was added to the document. +- The mandatory tag 'amp4ads engine amp4ads-v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'noscript enclosure for boilerplate' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript tag was added to the document. +- The mandatory tag 'head > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: head > style[amp-boilerplate] tag was added to the document. +- The mandatory tag 'noscript > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript > style[amp-boilerplate] tag was added to the document. COMPONENT NAMES WITH JS PATH ------------------------------ -'amp-youtube', include path 'https://cdn.ampproject.org/v0/amp-youtube-0.1.js' - +No custom amp script includes required diff --git a/tests/test-data/full-html/video-to-amp-video-conversion.html.out b/tests/test-data/full-html/video-to-amp-video-conversion.html.out index f036d46d..8aef906a 100644 --- a/tests/test-data/full-html/video-to-amp-video-conversion.html.out +++ b/tests/test-data/full-html/video-to-amp-video-conversion.html.out @@ -1,23 +1,3 @@ -<!DOCTYPE html> -<html amp><head> - <meta charset="utf-8"> - <link rel="canonical" href="./regular-video.html"> - <meta name="viewport" content="width=device-width,minimum-scale=1"> - <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> - <script async src="https://cdn.ampproject.org/v0.js"></script> -</head> -<body> - <amp-video controls autoplay width="500" data-provider="MGM" layout="responsive" height="281"><div fallback><div>Your browser does not support the <strong>video</strong> tag</div><p>Try using recent versions of Google Chrome or Firefox</p></div> - <source type="video/mp4" src="/video/movie.mp4"> - <source type="video/webm" src="/video/movie.webm"> - <track kind="captions" src="/captions.en.vtt" srclang="en" label="English"> - <track kind="captions" src="/captions.hi.vtt" srclang="hi" label="Hindi"> - - - </amp-video> -</body> - -</html> ORIGINAL HTML @@ -56,13 +36,134 @@ AMP-HTML Validation Issues and Fixes ------------------------------------- FAIL +<div fallback> on line 0 +- The tag 'div' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: div tag was removed due to validation issues. + +<html amp> on line 2 +- The tag 'html' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: html tag was removed due to validation issues. + +<head> on line 3 +- The tag 'head' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: head tag was removed due to validation issues. + +<meta charset="utf-8"> on line 4 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<link rel="canonical" href="./regular-video.html"> on line 5 +- The tag 'link' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: link tag was removed due to validation issues. + +<meta name="viewport" content="width=device-width,minimum-scale=1"> on line 6 +- The tag 'meta' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: meta tag was removed due to validation issues. + +<style amp-boilerplate> on line 7 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<noscript> on line 7 +- The tag 'noscript' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: noscript tag was removed due to validation issues. + +<style amp-boilerplate> on line 7 +- The tag 'style' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: style tag was removed due to validation issues. + +<script async src="https://cdn.ampproject.org/v0.js"> on line 8 +- The tag 'script' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: script tag was removed due to validation issues. + +<body> on line 10 +- The tag 'body' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: body tag was removed due to validation issues. + +<amp-video controls autoplay width="500" data-provider="MGM" layout="responsive" height="281"> on line 11 +- The tag 'amp-video' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: amp-video tag was removed due to validation issues. + +<source type="video/mp4" src="/video/movie.mp4"> on line 12 +- The tag 'source' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: source tag was removed due to validation issues. + +<source type="video/webm" src="/video/movie.webm"> on line 13 +- The tag 'source' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: source tag was removed due to validation issues. + <track kind="captions" src="/captions.en.vtt" srclang="en" label="English"> on line 14 -- The relative URL '/captions.en.vtt' for attribute 'src' in tag 'amp-video > track' is disallowed. - [code: DISALLOWED_RELATIVE_URL category: AMP_TAG_PROBLEM] +- The tag 'track' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: track tag was removed due to validation issues. <track kind="captions" src="/captions.hi.vtt" srclang="hi" label="Hindi"> on line 15 -- The relative URL '/captions.hi.vtt' for attribute 'src' in tag 'amp-video > track' is disallowed. - [code: DISALLOWED_RELATIVE_URL category: AMP_TAG_PROBLEM] +- The tag 'track' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: track tag was removed due to validation issues. + +<div> on line 16 +- The tag 'div' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: div tag was removed due to validation issues. + +<strong> on line 16 +- The tag 'strong' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: strong tag was removed due to validation issues. + +<p> on line 17 +- The tag 'p' is disallowed. + [code: DISALLOWED_TAG category: DISALLOWED_HTML] + ACTION TAKEN: p tag was removed due to validation issues. + +GLOBAL WARNING +- The mandatory tag 'HTML' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'HEAD' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'link rel=canonical' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'meta charset=utf-8' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta charset=utf-8 tag was added to the document. +- The mandatory tag 'meta name=viewport' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: meta name=viewport tag was added to the document. +- The mandatory tag 'head > style[amp4ads-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/amp-a4a-format.md#boilerplate] +- The mandatory tag 'head > style[amp4email-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] +- The mandatory tag 'BODY' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] + ACTION TAKEN: amphtml engine v0.js script tag was added to the document. +- The mandatory tag 'amp4ads engine amp4ads-v0.js script' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://www.ampproject.org/docs/reference/spec#required-markup] +- The mandatory tag 'noscript enclosure for boilerplate' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript tag was added to the document. +- The mandatory tag 'head > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: head > style[amp-boilerplate] tag was added to the document. +- The mandatory tag 'noscript > style[amp-boilerplate]' is missing or incorrect. + [code: MANDATORY_TAG_MISSING category: MANDATORY_AMP_TAG_MISSING_OR_INCORRECT see: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md] + ACTION TAKEN: noscript > style[amp-boilerplate] tag was added to the document. COMPONENT NAMES WITH JS PATH ------------------------------ From f02684efd9e5293c1b7f13d4a284b34f6a8c8361 Mon Sep 17 00:00:00 2001 From: James Williams <jimwills@hotmail.com> Date: Thu, 15 Nov 2018 12:43:50 +0000 Subject: [PATCH 4/8] DD-753 updated error const --- src/Validate/SValidationResult.php | 214 ++++++++++++++++++++--------- 1 file changed, 148 insertions(+), 66 deletions(-) diff --git a/src/Validate/SValidationResult.php b/src/Validate/SValidationResult.php index 932019ef..0b5b7d37 100644 --- a/src/Validate/SValidationResult.php +++ b/src/Validate/SValidationResult.php @@ -78,127 +78,209 @@ public static function specificity($code) { switch ($code) { case ValidationErrorCode::UNKNOWN_CODE: - return 0; + return 0; case ValidationErrorCode::MANDATORY_CDATA_MISSING_OR_INCORRECT: - return 1; + return 1; case ValidationErrorCode::CDATA_VIOLATES_BLACKLIST: - return 2; - case ValidationErrorCode::WRONG_PARENT_TAG: - return 3; + return 2; + case ValidationErrorCode::NON_WHITESPACE_CDATA_ENCOUNTERED: + return 3; + case ValidationErrorCode::INVALID_JSON_CDATA: + return 4; case ValidationErrorCode::DISALLOWED_TAG_ANCESTOR: - return 4; + return 5; case ValidationErrorCode::MANDATORY_TAG_ANCESTOR: - return 5; + return 6; case ValidationErrorCode::MANDATORY_TAG_ANCESTOR_WITH_HINT: - return 6; + return 7; case ValidationErrorCode::MANDATORY_TAG_MISSING: - return 7; + return 8; + case ValidationErrorCode::WRONG_PARENT_TAG: + return 9; case ValidationErrorCode::TAG_REQUIRED_BY_MISSING: - return 8; - case ValidationErrorCode::ATTR_REQUIRED_BUT_MISSING: - return 9; + return 10; + case ValidationErrorCode::TAG_EXCLUDED_BY_TAG: + return 11; + case ValidationErrorCode::MISSING_REQUIRED_EXTENSION: + return 12; + case ValidationErrorCode::ATTR_MISSING_REQUIRED_EXTENSION: + return 13; + case ValidationErrorCode::WARNING_TAG_REQUIRED_BY_MISSING: + return 14; + case ValidationErrorCode::EXTENSION_UNUSED: + return 15; + case ValidationErrorCode::WARNING_EXTENSION_UNUSED: + return 16; + case ValidationErrorCode::WARNING_EXTENSION_DEPRECATED_VERSION: + return 17; case ValidationErrorCode::DISALLOWED_TAG: - return 10; + return 18; case ValidationErrorCode::DISALLOWED_ATTR: - return 11; + return 19; case ValidationErrorCode::INVALID_ATTR_VALUE: - return 12; + return 20; + case ValidationErrorCode::DUPLICATE_ATTRIBUTE: + return 21; case ValidationErrorCode::ATTR_VALUE_REQUIRED_BY_LAYOUT: - return 13; + return 22; case ValidationErrorCode::MANDATORY_ATTR_MISSING: - return 14; + return 23; case ValidationErrorCode::MANDATORY_ONEOF_ATTR_MISSING: - return 15; + return 24; + case ValidationErrorCode::MANDATORY_ANYOF_ATTR_MISSING: + return 25; + case ValidationErrorCode::ATTR_REQUIRED_BUT_MISSING: + return 26; case ValidationErrorCode::DUPLICATE_UNIQUE_TAG: - return 16; - case ValidationErrorCode::STYLESHEET_TOO_LONG_OLD_VARIANT: - return 17; + return 27; + case ValidationErrorCode::DUPLICATE_UNIQUE_TAG_WARNING: + return 28; case ValidationErrorCode::STYLESHEET_TOO_LONG: - return 18; - case ValidationErrorCode::CSS_SYNTAX: - return 19; + return 29; + case ValidationErrorCode::STYLESHEET_AND_INLINE_STYLE_TOO_LONG: + return 30; + case ValidationErrorCode::INLINE_STYLE_TOO_LONG: + return 31; case ValidationErrorCode::CSS_SYNTAX_INVALID_AT_RULE: - return 20; + return 32; case ValidationErrorCode::MANDATORY_PROPERTY_MISSING_FROM_ATTR_VALUE: - return 21; + return 33; case ValidationErrorCode::INVALID_PROPERTY_VALUE_IN_ATTR_VALUE: - return 22; + return 34; case ValidationErrorCode::DISALLOWED_PROPERTY_IN_ATTR_VALUE: - return 23; + return 35; case ValidationErrorCode::MUTUALLY_EXCLUSIVE_ATTRS: - return 24; + return 36; case ValidationErrorCode::UNESCAPED_TEMPLATE_IN_ATTR_VALUE: - return 25; + return 37; case ValidationErrorCode::TEMPLATE_PARTIAL_IN_ATTR_VALUE: - return 26; + return 38; case ValidationErrorCode::TEMPLATE_IN_ATTR_NAME: - return 27; + return 39; case ValidationErrorCode::INCONSISTENT_UNITS_FOR_WIDTH_AND_HEIGHT: - return 28; + return 40; + case ValidationErrorCode::MISSING_LAYOUT_ATTRIBUTES: + return 41; case ValidationErrorCode::IMPLIED_LAYOUT_INVALID: - return 29; + return 42; case ValidationErrorCode::SPECIFIED_LAYOUT_INVALID: - return 30; - case ValidationErrorCode::DEV_MODE_ENABLED: - return 31; + return 43; case ValidationErrorCode::ATTR_DISALLOWED_BY_IMPLIED_LAYOUT: - return 32; + return 44; case ValidationErrorCode::ATTR_DISALLOWED_BY_SPECIFIED_LAYOUT: - return 33; + return 45; case ValidationErrorCode::DUPLICATE_DIMENSION: - return 34; + return 46; case ValidationErrorCode::DISALLOWED_RELATIVE_URL: - return 35; + return 47; case ValidationErrorCode::MISSING_URL: - return 36; + return 48; + case ValidationErrorCode::DISALLOWED_DOMAIN: + return 49; case ValidationErrorCode::INVALID_URL_PROTOCOL: - return 37; + return 50; case ValidationErrorCode::INVALID_URL: - return 38; + return 51; + case ValidationErrorCode::DISALLOWED_STYLE_ATTR: + return 52; case ValidationErrorCode::CSS_SYNTAX_STRAY_TRAILING_BACKSLASH: - return 39; + return 53; case ValidationErrorCode::CSS_SYNTAX_UNTERMINATED_COMMENT: - return 40; + return 54; case ValidationErrorCode::CSS_SYNTAX_UNTERMINATED_STRING: - return 41; + return 55; case ValidationErrorCode::CSS_SYNTAX_BAD_URL: - return 42; + return 56; case ValidationErrorCode::CSS_SYNTAX_EOF_IN_PRELUDE_OF_QUALIFIED_RULE: - return 43; + return 57; case ValidationErrorCode::CSS_SYNTAX_INVALID_DECLARATION: - return 44; + return 58; case ValidationErrorCode::CSS_SYNTAX_INCOMPLETE_DECLARATION: - return 45; + return 59; case ValidationErrorCode::CSS_SYNTAX_ERROR_IN_PSEUDO_SELECTOR: - return 46; + return 60; case ValidationErrorCode::CSS_SYNTAX_MISSING_SELECTOR: - return 47; + return 61; case ValidationErrorCode::CSS_SYNTAX_NOT_A_SELECTOR_START: - return 48; + return 62; case ValidationErrorCode::CSS_SYNTAX_UNPARSED_INPUT_REMAINS_IN_SELECTOR: - return 49; + return 63; case ValidationErrorCode::CSS_SYNTAX_MISSING_URL: - return 50; + return 64; + case ValidationErrorCode::CSS_SYNTAX_DISALLOWED_DOMAIN: + return 65; case ValidationErrorCode::CSS_SYNTAX_INVALID_URL: - return 51; + return 66; case ValidationErrorCode::CSS_SYNTAX_INVALID_URL_PROTOCOL: - return 52; + return 67; case ValidationErrorCode::CSS_SYNTAX_DISALLOWED_RELATIVE_URL: - return 53; + return 68; case ValidationErrorCode::INCORRECT_NUM_CHILD_TAGS: - return 54; + return 69; case ValidationErrorCode::DISALLOWED_CHILD_TAG_NAME: - return 55; + return 70; case ValidationErrorCode::DISALLOWED_FIRST_CHILD_TAG_NAME: - return 56; + return 71; case ValidationErrorCode::CSS_SYNTAX_INVALID_ATTR_SELECTOR: - return 57; + return 72; + case ValidationErrorCode::CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT: + return 73; + case ValidationErrorCode::MANDATORY_REFERENCE_POINT_MISSING: + return 74; + case ValidationErrorCode::DUPLICATE_REFERENCE_POINT: + return 75; + case ValidationErrorCode::TAG_REFERENCE_POINT_CONFLICT: + return 76; + case ValidationErrorCode::CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT_SINGULAR: + return 77; + case ValidationErrorCode::CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE: + return 78; + case ValidationErrorCode::CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE_WITH_HINT: + return 79; + case ValidationErrorCode::CSS_SYNTAX_PROPERTY_DISALLOWED_WITHIN_AT_RULE: + return 80; + case ValidationErrorCode::CSS_SYNTAX_PROPERTY_DISALLOWED_TOGETHER_WITH: + return 81; + case ValidationErrorCode::CSS_SYNTAX_PROPERTY_REQUIRES_QUALIFICATION: + return 82; + case ValidationErrorCode::BASE_TAG_MUST_PRECEED_ALL_URLS: + return 83; + case ValidationErrorCode::DISALLOWED_SCRIPT_TAG: + return 100; case ValidationErrorCode::GENERAL_DISALLOWED_TAG: - return 100; + return 101; case ValidationErrorCode::DEPRECATED_ATTR: - return 101; + return 102; case ValidationErrorCode::DEPRECATED_TAG: - return 102; + return 103; + case ValidationErrorCode::DISALLOWED_MANUFACTURED_BODY: + return 104; + case ValidationErrorCode::DOCUMENT_TOO_COMPLEX: + return 105; + case ValidationErrorCode::INCORRECT_MIN_NUM_CHILD_TAGS: + return 106; + case ValidationErrorCode::TAG_NOT_ALLOWED_TO_HAVE_SIBLINGS: + return 107; + case ValidationErrorCode::MANDATORY_LAST_CHILD_TAG: + return 108; + case ValidationErrorCode::CSS_SYNTAX_INVALID_PROPERTY: + return 109; + case ValidationErrorCode::CSS_SYNTAX_INVALID_PROPERTY_NOLIST: + return 110; + case ValidationErrorCode::CSS_SYNTAX_QUALIFIED_RULE_HAS_NO_DECLARATIONS: + return 111; + case ValidationErrorCode::CSS_SYNTAX_DISALLOWED_QUALIFIED_RULE_MUST_BE_INSIDE_KEYFRAME: + return 112; + case ValidationErrorCode::CSS_SYNTAX_DISALLOWED_KEYFRAME_INSIDE_KEYFRAME: + return 113; + case ValidationErrorCode::CSS_SYNTAX_MALFORMED_MEDIA_QUERY: + return 115; + case ValidationErrorCode::CSS_SYNTAX_DISALLOWED_MEDIA_TYPE: + return 116; + case ValidationErrorCode::CSS_SYNTAX_DISALLOWED_MEDIA_FEATURE: + return 117; + case ValidationErrorCode::INVALID_UTF8: + return 118; default: throw new \Exception('Unknown error code'); } From d75cbbea61bc75b7635166eca04d08f3612c4e4d Mon Sep 17 00:00:00 2001 From: James Williams <jimwills@hotmail.com> Date: Thu, 15 Nov 2018 12:44:45 +0000 Subject: [PATCH 5/8] DD-753 updated CSS_SYNTAX, its a little questionable --- src/Validate/CdataMatcher.php | 2 +- src/Validate/ParsedTagSpec.php | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Validate/CdataMatcher.php b/src/Validate/CdataMatcher.php index 69345fcb..d6c87585 100644 --- a/src/Validate/CdataMatcher.php +++ b/src/Validate/CdataMatcher.php @@ -91,7 +91,7 @@ public function match($cdata, Context $context, SValidationResult $result) try { $this->validateCssSpec($cdata, $context, $result, $cdata_spec); } catch (\Exception $e) { - $context->addError(ValidationErrorCode::CSS_SYNTAX, + $context->addError(ValidationErrorCode::UNKNOWN_CODE, [ParsedTagSpec::getTagSpecName($this->tag_spec), 'CSS Parser Error: ' . $e->getMessage()], $this->tag_spec->spec_url, $result); } } diff --git a/src/Validate/ParsedTagSpec.php b/src/Validate/ParsedTagSpec.php index 10315e94..ac1f808b 100644 --- a/src/Validate/ParsedTagSpec.php +++ b/src/Validate/ParsedTagSpec.php @@ -148,9 +148,6 @@ public function getDispatchKey() if (empty(($attr_value))) { $attr_value = ''; } - //var_dump($attr_name); - //var_dump($attr_value); - //var_dump($mandatory_parent); return TagSpecDispatch::makeDispatchKey($attr_name, $attr_value, $mandatory_parent); } From c57d3d12e68d332c8e202ad8314ae3be106a6207 Mon Sep 17 00:00:00 2001 From: James Williams <jimwills@hotmail.com> Date: Thu, 15 Nov 2018 12:45:53 +0000 Subject: [PATCH 6/8] DD-753 updating CSS_SYNTAX --- src/Validate/RenderValidationResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Validate/RenderValidationResult.php b/src/Validate/RenderValidationResult.php index 5c040e82..d7cfcc1d 100644 --- a/src/Validate/RenderValidationResult.php +++ b/src/Validate/RenderValidationResult.php @@ -294,7 +294,7 @@ public function categorizeError(ValidationError $error) return ErrorCategoryCode::AUTHOR_STYLESHEET_PROBLEM; } - if ($error->code === ValidationErrorCode::CSS_SYNTAX && + if ($error->code === ValidationErrorCode::UNKNOWN_CODE && isset($error->params[0]) && $error->params[0] === 'style amp-custom' ) { return ErrorCategoryCode::AUTHOR_STYLESHEET_PROBLEM; From 1c3901a0d2b4adb638bbce28e62ac2d5f85b85ac Mon Sep 17 00:00:00 2001 From: James Williams <jimwills@hotmail.com> Date: Thu, 15 Nov 2018 12:54:58 +0000 Subject: [PATCH 7/8] DD-753 removed CSS_SYNTAC from validator --- src/Spec/validator-generated.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Spec/validator-generated.php b/src/Spec/validator-generated.php index 2667840d..6bdaeea9 100644 --- a/src/Spec/validator-generated.php +++ b/src/Spec/validator-generated.php @@ -370,7 +370,7 @@ class ValidationErrorCode { const CSS_SYNTAX_PROPERTY_DISALLOWED_WITHIN_AT_RULE = 'CSS_SYNTAX_PROPERTY_DISALLOWED_WITHIN_AT_RULE'; const CSS_SYNTAX_PROPERTY_DISALLOWED_TOGETHER_WITH = 'CSS_SYNTAX_PROPERTY_DISALLOWED_TOGETHER_WITH'; const CSS_SYNTAX_PROPERTY_REQUIRES_QUALIFICATION = 'CSS_SYNTAX_PROPERTY_REQUIRES_QUALIFICATION'; - const CSS_SYNTAX = 'CSS_SYNTAX'; + //const CSS_SYNTAX = 'CSS_SYNTAX'; } class ValidationErrorSeverity { const UNKNOWN_SEVERITY = 'UNKNOWN_SEVERITY'; From 0649c20d5126cdc85ff0e5494a456423251db2e0 Mon Sep 17 00:00:00 2001 From: James Williams <jimwills@hotmail.com> Date: Fri, 16 Nov 2018 10:15:14 +0000 Subject: [PATCH 8/8] DD-753 updated php7 unittest failure --- .../fragment-html/diff_test.html.php7.out | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/test-data/fragment-html/diff_test.html.php7.out b/tests/test-data/fragment-html/diff_test.html.php7.out index 9a0e12fc..022bd836 100644 --- a/tests/test-data/fragment-html/diff_test.html.php7.out +++ b/tests/test-data/fragment-html/diff_test.html.php7.out @@ -2,17 +2,13 @@ +++ New @@ @@ -<audio controls autoplay> -+<amp-audio controls autoplay><div fallback><div>Your browser does not support the <strong>audio</strong> tag</div><p>Try using recent versions of Google Chrome or Firefox</p></div> - <source src="//example.dd:8088/sites/default/files/drums.mp3" type="audio/mpeg"> +- <source src="//example.dd:8088/sites/default/files/drums.mp3" type="audio/mpeg"> - <source src="http://example.dd:8088/sites/default/files/drums.ogg" type="audio/ogg"> -+ <source type="audio/ogg"> - <source src="https://example.dd:8088/sites/default/files/drums.wav" type="audio/wav"> - <track kind="captions" src="//example.dd:8088/sites/default/files/drums.en.vtt" srclang="en" label="English"> - <track kind="captions" src="https://example.dd:8088/sites/default/files/drums.hi.vtt" srclang="hi" label="Hindi"> +- <source src="https://example.dd:8088/sites/default/files/drums.wav" type="audio/wav"> +- <track kind="captions" src="//example.dd:8088/sites/default/files/drums.en.vtt" srclang="en" label="English"> +- <track kind="captions" src="https://example.dd:8088/sites/default/files/drums.hi.vtt" srclang="hi" label="Hindi"> - <div>Your browser does not support the <strong>audio</strong> tag</div> - <p>Try using recent versions of Google Chrome or Firefox</p> -</audio> -+ -+ -+</amp-audio> ++