Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Gregable opened this issue Jun 25, 2019 · 4 comments · Fixed by #23533
Closed

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

Gregable opened this issue Jun 25, 2019 · 4 comments · Fixed by #23533

Comments

@Gregable
Copy link
Member

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.

@Gregable
Copy link
Member Author

For context, understanding the correct behavior here would be very helpful. There are a couple other issues that could be considered blocking on this: #18091 and #21673

@Gregable
Copy link
Member Author

Ping on this issue. I'm happy to make the change, so this issue amounts to a question at this point.

@sparhami
Copy link

Did some manual testing and it seems like it should work fine if we allow lightbox on type="carousel".

@Gregable
Copy link
Member Author

Thanks!

@Gregable Gregable assigned Gregable and unassigned sparhami Jul 24, 2019
Gregable pushed a commit that referenced this issue Jul 25, 2019
* cl/258377914 Revision bump for #23122

* cl/258634966 Revision bump for #23349

* cl/258870451 Fix incorrect allowance of `<form method="get">` with relative URLs

* cl/259565186 Revision bump for #23386

* cl/259587993 Add a descriptive comment to amp-carousel rules.

* cl/259661215 Fix #23012 by removing the dispatch key on amp-carousel type=carousel.

* cl/259662509 Revision bump for #23148

* cl/259988931 Revision bump for #23482
thekorn pushed a commit to edelight/amphtml that referenced this issue Sep 11, 2019
* cl/258377914 Revision bump for ampproject#23122

* cl/258634966 Revision bump for ampproject#23349

* cl/258870451 Fix incorrect allowance of `<form method="get">` with relative URLs

* cl/259565186 Revision bump for ampproject#23386

* cl/259587993 Add a descriptive comment to amp-carousel rules.

* cl/259661215 Fix ampproject#23012 by removing the dispatch key on amp-carousel type=carousel.

* cl/259662509 Revision bump for ampproject#23148

* cl/259988931 Revision bump for ampproject#23482
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants