static void |
TagSpecUtils.validateAncestorTags(ParsedTagSpec parsedTagSpec,
Context context,
dev.amp.validator.ValidatorProtos.ValidationResult.Builder validationResult) |
Validates if the tag ancestors satisfied the spec.
|
static void |
AttributeSpecUtils.validateAttributes(ParsedTagSpec parsedTagSpec,
ParsedTagSpec bestMatchReferencePoint,
Context context,
ParsedHtmlTag encounteredTag,
ValidateTagResult result) |
Validates whether the attributes set on |encountered_tag| conform to this
tag specification.
|
static void |
AttributeSpecUtils.validateAttrNotFoundInSpec(ParsedTagSpec parsedTagSpec,
Context context,
String attrName,
dev.amp.validator.ValidatorProtos.ValidationResult.Builder result) |
Helper method for validateAttributes, for when an attribute is
encountered which is not specified by the validator.protoascii
specification.
|
static void |
AttributeSpecUtils.validateAttrValueBelowTemplateTag(ParsedTagSpec parsedTagSpec,
Context context,
String attrName,
String attrValue,
dev.amp.validator.ValidatorProtos.ValidationResult.Builder result) |
Specific checks for attribute values descending from a template tag.
|
static void |
TagSpecUtils.validateDescendantTags(ParsedHtmlTag encounteredTag,
ParsedTagSpec parsedTagSpec,
Context context,
dev.amp.validator.ValidatorProtos.ValidationResult.Builder validationResult) |
Validates that this tag is an allowed descendant tag type.
|
static void |
AttributeSpecUtils.validateLayout(ParsedTagSpec parsedTagSpec,
Context context,
ParsedHtmlTag encounteredTag,
dev.amp.validator.ValidatorProtos.ValidationResult.Builder result) |
Validates the layout for the given tag.
|
static void |
TagSpecUtils.validateNoSiblingsAllowedTags(ParsedTagSpec parsedTagSpec,
Context context,
dev.amp.validator.ValidatorProtos.ValidationResult.Builder validationResult) |
Validates if the 'no siblings allowed' rule exists.
|
static void |
TagSpecUtils.validateParentTag(ParsedTagSpec parsedTagSpec,
Context context,
dev.amp.validator.ValidatorProtos.ValidationResult.Builder validationResult) |
Validates whether the parent tag satisfied the spec (e.g., some
tags can only appear in head).
|
static void |
TagSpecUtils.validateRequiredExtensions(ParsedTagSpec parsedTagSpec,
Context context,
dev.amp.validator.ValidatorProtos.ValidationResult.Builder validationResult) |
If this tag requires an extension and we have processed all extensions,
report an error if that extension has not been loaded.
|
static ValidateTagResult |
TagSpecUtils.validateTag(Context context,
ParsedHtmlTag encounteredTag,
ParsedTagSpec bestMatchReferencePoint) |
Validates the provided |tagName| with respect to the tag
specifications in the validator's rules, returning a ValidationResult
with errors for this tag and a PASS or FAIL status.
|
static ValidateTagResult |
TagSpecUtils.validateTagAgainstSpec(ParsedTagSpec parsedTagSpec,
ParsedTagSpec bestMatchReferencePoint,
Context context,
ParsedHtmlTag encounteredTag) |
Validates the provided |tagName| with respect to a single tag
specification.
|
static void |
TagSpecUtils.validateUniqueness(ParsedTagSpec parsedTagSpec,
Context context,
dev.amp.validator.ValidatorProtos.ValidationResult.Builder validationResult) |
Check for duplicates of tags that should be unique, reporting errors for
the second instance of each unique tag.
|