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

Allow <noscript> #1279

Closed
Nemo64 opened this Issue Jan 1, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@Nemo64
Copy link
Contributor

Nemo64 commented Jan 1, 2016

Amp pages won't work without JavaScript because all custom tags (like <amp-img>) will silently fail and, depending on the stylesheet, become big blocks of nothing or disappear entirely.

The validator prohibits the use of <noscript> outside the document head. This prevents a basic fallback or at least a notice that JavaScript is required.

I could accept the answer that amp pages simply won't work without JavaScript since such users won't get to those pages anyways (assuming a normal version of the page exists), however the <noscript> tag in the document head would be pointless then, wouldn't it?

I suggest to allow <noscript> in any context and allow some normally prohibited elements like <img> or <style> inside of them. Maybe even suggestions in the documentation on how to implement fallbacks.

@cramforce cramforce changed the title completely allow or deny <noscript> Allow <noscript> Jan 1, 2016

@cramforce

This comment has been minimized.

Copy link
Member

cramforce commented Jan 1, 2016

Should be allowed!

And, indeed noscript img should be allowed (and likely video, audio). Not so sure about noscript style

@Gregable

This comment has been minimized.

Copy link
Member

Gregable commented Jan 4, 2016

Good point. So far I have, for newly allowed descendants of <noscript>:

  • img
  • video
  • audio

Any other allowed tags we should add back in?

I agree with @cramforce that <style> is unnecessary. One can have style rules which only apply to tags inside your <noscript> section.

@cramforce

This comment has been minimized.

Copy link
Member

cramforce commented Jan 4, 2016

@Gregable The main reason to allow style is to e.g. hide a feature outside noscript that doesn't work without JS, but which is not needed to read the page. We can live without for now and see how far that gets us.

List seems fine to me.

@Gregable

This comment has been minimized.

Copy link
Member

Gregable commented Jan 4, 2016

Ah, makes sense. Thanks for the clarification.

@Nemo64

This comment has been minimized.

Copy link
Contributor

Nemo64 commented Jan 5, 2016

The only other element I can think of is an <iframe>. I could live without it though.

The most important element is <img> (and <picture>? maybe?)

@Gregable

This comment has been minimized.

Copy link
Member

Gregable commented Jan 28, 2016

This is now live, <noscript> is allowed in the document body, and <img>, <video>, and <audio> tags are allowed as descendant tags of the <noscript> tag. The others are left out for now, but feel free to raise the issue if you feel that you need them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment