package amp.validator

Mouse Melon logoGet desktop application:
View/edit binary Protocol Buffers messages

message AmpLayout

validator.proto:365

Specifies which AMP Layouts are supported by a given element. For the purpose of the validator, this specifies which values for layout, height, and width attributes are allowed. Also see https://github.com/ampproject/amphtml/blob/main/docs/spec/amp-html-layout.md TODO(johannes): Make the error messages around layouts better. This may require revamping the documentation for elements and/or the above spec, so that a user gets more clearly informed about which layouts are applicable to a given tag, what happens when layout attribute or other attributes are not set, etc. NEXT AVAILABLE TAG: 4

Used in: TagSpec

enum AmpLayout.Layout

validator.proto:367

NEXT AVAILABLE TAG: 10

Used in: AmpLayout

message AncestorMarker

validator.proto:393

An AncestorMarker is a state maintained on the stack of matching tags. When a TagSpec with an AncestorMarker matches, this Marker is placed on the stack until the matched html tag is popped from the stack. Other rules may be triggered by the presence of a specific AncestorMarker on the stack. NEXT AVAILABLE TAG: 2

Used in: AttrSpec, TagSpec

enum AncestorMarker.Marker

validator.proto:395

NEXT AVAILABLE TAG: 2

Used in: AncestorMarker

message AtRuleSpec

validator.proto:278

This spec is used by our CSS parser to determine what AT rules are allowed in the CSS spec. The term 'rule' here refers to the AT Rule in CSS, not a validation rule. NEXT AVAILABLE TAG: 4

Used in: CssSpec

message AttrList

validator.proto:211

Some tags share several attributes, so they're identified by unique key (see the attr_lists map in ValidatorRules). NEXT AVAILABLE TAG: 3

Used in: ValidatorRules

message AttrSpec

validator.proto:96

Attributes that are not covered by at least one of these specs are disallowed. Within a given context (e.g., for a given TagSpec), names are unique. NEXT AVAILABLE TAG: 29

Used in: AttrList, TagSpec

enum AttrSpec.DispatchKeyType

validator.proto:178

Used in: AttrSpec

enum AttrSpec.ValueSet

validator.proto:155

These two fields specify that values from one AttrSpec refer to values from another AttrSpec elsewhere on the page; validator will verify the references are not "dangling". These references may appear before or after their referents. For example, in the "id" AttrSpec in the "template" TagSpec, we have: add_value_to_set: TEMPLATE_IDS and in any "template" AttrSpec, we have: value_oneof_set: TEMPLATE_IDS NEXT AVAILABLE TAG: 3

Used in: AttrSpec, ValueSetProvision

message AttrTriggerSpec

validator.proto:32

Used for validating attributes that require another attribute for some given set of conditions. E.g. attr name: "on" if_value_regex: "tap:.*" also_require_attr: "role" NEXT AVAILABLE TAG: 3

Used in: AttrSpec

message CdataSpec

validator.proto:318

NEXT AVAILABLE TAG: 12

Used in: TagSpec

message ChildTagSpec

validator.proto:415

TagSpec::child_tags uses this configuration to specify which child tags are expected for a specific tag. Matching child tags is done by tag name, while the parent is matched by TagSpec. The reason for this is that matching by tag spec name would produce less useful error messages, because we want to be able to produce a good message even if the tag spec name could not be determined because the enclosed child tag is invalid (no TagSpec matches). By doing a tag name match, we can produce a reasonable error regardless if a child tag was misplaced. NEXT AVAILABLE TAG: 5

Used in: TagSpec

message CssDeclaration

validator.proto:79

NEXT AVAILABLE TAG: 4

Used in: AttrSpec, DeclarationList, DocCssSpec

message CssSpec

validator.proto:290

NEXT AVAILABLE TAG: 10

Used in: CdataSpec

message DeclarationList

validator.proto:227

Some style blocks share long lists of declarations, so they're identified by unique key. NEXT AVAILABLE TAG: 3

Used in: ValidatorRules

message DescendantTagList

validator.proto:219

A list of allowed tags for descendants of any level (children, grandchildren, great-grandchildren, etc). NEXT AVAILABLE TAG: 3

Used in: ValidatorRules

message DisallowedCDataRegex

validator.proto:235

Regex which, if matches the cdata of a tag, causes the tag validation to fail. NEXT AVAILABLE TAG: 3

Used in: CdataSpec

message DocCssSpec

validator.proto:742

Exactly one DocCssSpec will match each AMP document. This spec defines the default css rules for style attributes and publisher style tags across the entire document. Rules for specific tags may be overridden by those tags. NEXT AVAILABLE TAG: 20

Used in: ValidatorRules

message DocSpec

validator.proto:719

Exactly one DocSpec will match each AMP document. This spec defines some default rules for the entire document scoped by it's HtmlFormat and any Type Identifiers. NEXT AVAILABLE TAG: 6

Used in: ValidatorRules

message ErrorCategory

validator.proto:842

This feature was removed in October 2019, however there are still some callers that expect an ErrorCategory to be set. Do not rely on this in new code. TODO(#25188): Remove ErrorCategory completely.

(message has no fields)

enum ErrorCategory.Code

validator.proto:843

Used in: ValidationError

message ErrorFormat

validator.proto:1023

NEXT AVAILABLE TAG: 3

Used in: ValidatorRules

message ErrorSpecificity

validator.proto:1017

Used in the verbose validator to select between multiple generated error types for a failing error. A higher number means that the error is more specific, ie: more helpful, preferred. NEXT AVAILABLE TAG: 3

Used in: ValidatorRules

message ExtensionSpec

validator.proto:467

Specs specific to AMP Extensions. This is a field within TagSpec that replaces the standard tagspec list of attributes, requirements, etc. NEXT AVAILABLE TAG: 10

Used in: TagSpec

enum ExtensionSpec.ExtensionType

validator.proto:486

Most extensions are custom-elements. For custom-template extensions, this value needs to be set true. E.g: amp-mustache. NEXT AVAILABLE TAG: 4

Used in: ExtensionSpec

enum ExtensionSpec.ExtensionUsageRequirement

validator.proto:516

TagSpec.requires_extension will be set to the new extension's name on one or more TagSpecs that require that extension. This typically creates 2 validation requirements: 1) If a tag is on the page whose TagSpec has the requires_extension field set, but that extension is not present, this is an error. (Usage requires extension). 2) If an extension is on the page, but no tags indicating usage of that extension via the required_extension field are on the page, this is an error. (Extension requires usage). The second requirement (extension requires usage) has a few exceptions: 1) For older extensions, implemented before these tagspec rules, we do not want to introduce a breaking change, so we exempt these extensions from the usage requirement. New extensions must use ERROR. 2) Some extensions, such as `amp-dynamic-css-classes`, do not have any associated tag in the document indicating usage. These extensions do not trigger warnings or errors. NEXT AVAILABLE TAG: 4

Used in: ExtensionSpec

message HtmlFormat

validator.proto:533

The HtmlFormat is the declared format in the top-level html tag, which prescribes a particular set of validation rules. This should be kept in sync with Request.HtmlFormat in github.com/ampproject/amppackager/transformer/request/request.proto.

(message has no fields)

enum HtmlFormat.Code

validator.proto:535

NEXT AVAILABLE TAG: 6

Used in: DocCssSpec, DocSpec, TagSpec

message MediaQuerySpec

validator.proto:243

This spec is used when parsing a media query inside a CSS @media rule. NEXT AVAILABLE TAG: 5

Used in: AtRuleSpec

message PropertySpec

validator.proto:46

Used for validating properties in attribute values. Our validator (via parse-viewport.h) implements the parsing algorithm as described here: https://drafts.csswg.org/css-device-adapt/#parsing-algorithm NEXT AVAILABLE TAG: 5

Used in: PropertySpecList

message PropertySpecList

validator.proto:61

NEXT AVAILABLE TAG: 2

Used in: AttrSpec

message ReferencePoint

validator.proto:452

TagSpecs and reference points. Any TagSpec may define a list of reference points via the TagSpec::reference_points field. These reference points specify how DOM elements that are children of this parent tag fulfill particular functionality. For instance, a widget (implemented as an AMP tag) may require a login reference point. Any valid AMP tag would be allowed, whether it's a clickable DIV or an AMP-IMG or a BUTTON, so long as it *also* conforms to the reference point specification. This specification is a TagSpec which does not define a name (the name is set to the special value '$REFERENCE_POINT'), but rather identifies the reference point with AttrSpec requirements. For instance, the login reference point may require that there be a login attribute, or some end-point attribute with a URL, or similar. Therefore, for any child tags of a tag that defines reference points, they are first matched against these reference points, and only then are they validated as regular tags against the TagSpecs that are not reference points while their reference point attributes are skipped. The complexity of this mechanism is unfortunate but reduces the markup required and makes CSS styling more convenient. Please see the amp-live-list specification for an example. NEXT AVAILABLE TAG: 4

Used in: TagSpec

message SelectorSpec

validator.proto:257

This spec is used when parsing a CSS selector group as the prelude of a CSS qualified rule. For example "div.foo span.bar". If no SelectorSpec is provided, the selector groups are unconstrained. NEXT AVAILABLE TAG: 4

For each SelectorSpec list provided a single list element value of "*" indicates that any value is allowed (ie: that feature is unconstrained). An empty list indicates that no value is allowed (ie: that feature is disallowed). Otherwise, the list values are the only allowed values.

Used in: CssSpec

message TagSpec

validator.proto:552

Tags that are not covered by at least one of these specs are disallowed. Some tags are mandatory. Note that the tag name is not unique, that is, there can be multiple tag specs covering the same name, e.g., for multiple meta tags (with different attributes). NEXT AVAILABLE TAG: 40

Used in: ValidatorRules

enum TagSpec.NamedId

validator.proto:595

NamedId's are used to uniquely identify specific TagSpecs in the validator rules in a stable manner. Most TagSpecs have no set NamedId. If a TagSpec has a NamedId it must be unique. In other words, no two TagSpec's may have the same NamedId except for the NOT_SET (0) value. NEXT AVAILABLE TAG: 3

Used in: TagSpec

message UrlSpec

validator.proto:67

Used for validating urls in attribute values (such as href/src/srcset). NEXT AVAILABLE TAG: 5

Used in: AttrSpec, DocCssSpec

message ValidationError

validator.proto:854

We record validation errors in a structured form, so that they can be worked with in code - e.g., to provide translated messages. In the Javascript implementation (validator.js), you may find the amp.validator.renderErrorMessage function which will make a human-readable string from the structured form. It should be easy to port this to other languages as needed; for instance Google has implementations in C++, Java, and for templates used in some frontends. NEXT AVAILABLE TAG: 10

Used in: ValidationResult, ValueSetRequirement

enum ValidationError.Code

validator.proto:866

NEXT AVAILABLE TAG: 124

Used in: ErrorFormat, ErrorSpecificity, ValidationError

enum ValidationError.Severity

validator.proto:856

NEXT AVAILABLE TAG: 5

Used in: ValidationError

message ValidationResult

validator.proto:1054

The validation result provided by Validator instances (see Validator::Result in validator.h). To render such a proto see RenderValidationResult. NEXT AVAILABLE TAG: 9

enum ValidationResult.Status

validator.proto:1056

NEXT AVAILABLE TAG: 3

Used in: ValidationResult

message ValidatorRules

validator.proto:806

Top level message - start reading here. The validator knows about a set of tag specifications. NEXT AVAILABLE TAG: 22

message ValueSetProvision

validator.proto:1031

A value to be added to a particular ValueSet, as found when scanning the document (i.e. AttrSpec.add_value_to_set). NEXT AVAILABLE TAG: 3

Used in: ValidationResult, ValueSetRequirement

message ValueSetRequirement

validator.proto:1043

A requirement that a particular value appears in a particular ValueSet (i.e. AttrSpec.value_oneof_set). All the provisions and requirements are collected until the document has been fully scanned, and then compared to ensure that all requirements are met. This allows provisions to appear after (or even alongside) requirements. NEXT AVAILABLE TAG: 3

Used in: ValidationResult