Skip to content

Add ability to look up spec by name #4597

@westonruter

Description

@westonruter

Feature description

We need to more efficiently walk over the generated spec data, in particular to be able to find tag spec by a spec name. This will allow fleshing out validation errors in the UI with the full context and provide the user with information on amp.dev for more details.

Relates to #1420 and #4566.

  • Separate extension specs from tag specs. This eliminates having to look up extension specs from among tag specs.
  • Add ability to get a specific spec by name for a given tag, and use in the style sanitizer.
  • Add assertion that link rel=stylesheet for fonts spec is present.
  • Include extension_type in generated spec data in order to determine if an extension is a custom-template rather than custom-element.
  • Remove obsolete/unused AMP_Rule_Spec::$additional_allowed_tags.
  • Eliminate duplicate copies of spec in memory (e.g. $allowed_tags, $DEFAULT_ARGS['amp_allowed_tags'], and $args['amp_allowed_tags']).

Relates to #3080 and #4570.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions