Skip to content

<amp-carousel type=carousel lightbox> is an unreachable validator variant. #23012

@Gregable

Description

@Gregable

https://github.com/ampproject/amphtml/blob/master/extensions/amp-carousel/validator-amp-carousel.protoascii

There are 4 tagspecs there. One for each combo of:

  • type=slides/type=carousel
  • lightbox/no-lightbox

The specific tagspec for type=carousel/no-lightbox specifies a dispatch_key which makes it the ONLY tagspec that is matched if type=carousel is present.

This means that the type=carousel/lightbox version is unreachable in the validator, except possibly to match certain guaranteed to error out cases, and in those case it will simply make error messages worse. In other words, it is impossible to create a document containing:

<amp-carousel type=carousel lightbox layout=FIXED height=1 width=1>
  ...
</amp-carousel>

Even though there is a tagspec written that would allow it.

There are two possible, and very simple fixes:

  • Remove the type=carousel/lightbox validator version if we don't want this combination to exist.
  • Remove the dispatch_key on the type=carousel/no-lightbox version if we do want that combination to exist.

It's unclear to me which option is the correct one.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions