These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:08 pm Advanced search

noscript element should not be in the head element

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

Postby zcorpan » Fri Apr 09, 2010 1:48 pm

Well, the specs require that a stream of bytes being labeled as XML be interpreted as required in XML... You can't just throw out some of it. Otherwise it would be compliant to throw out say every other byte when the moon is full.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby JAB Creations » Fri Apr 09, 2010 3:43 pm

Well I'll just extend XHTML 1.1 to include support for XHTML5 elements eventually then. *shrug* It works fine and browsers don't have an issue with it. Thanks for the engaging conversation. :P
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Postby lyosha » Wed Apr 28, 2010 8:47 am

Dude, you'll still have a problem because you will need to serve it as text/html to work, but it is forbidden to serve XHTML 1.1 as text/html. :P
lyosha
<h3>
 
Posts: 60
Joined: Fri Aug 22, 2008 9:26 pm

Postby JAB Creations » Wed Apr 28, 2010 3:16 pm

lyosha, XHTML 1.1 and the noscript element work flawlessly in all browsers for me. When a user agent doesn't support application/xhtml+xml I am forced to cloak by serving the XHTML 1.0 Strict doctype instead.
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Postby zcorpan » Thu Apr 29, 2010 6:46 am

JAB Creations wrote:lyosha, XHTML 1.1 and the noscript element work flawlessly in all browsers for me.


Here are some tests for you to compare text/html and application/xhtml+xml:

Code: Select all
<noscript><script>alert('hello')</script></noscript>

Code: Select all
<form><noscript><input name='x' value='y'/></noscript><input type='submit'/></form>

Code: Select all
<noscript><meta http-equiv='refresh' content='0; URL=http://example.org/'/></noscript>

Code: Select all
<noscript><style>* { color:red }</style></noscript>
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby JAB Creations » Thu Apr 29, 2010 4:08 pm

Z, I don't do that stuff with my code though. I just put a divisible and paragraph element inside of the noscript element with some inline styling. Also the noscript element is a child of the body in XHTML 1.0 so I wouldn't put a script element inside of a noscript any way even if I didn't already refuse to put script elements inside of the body element.

Also the whole bit about XHTML not ignoring the noscript element, really parsers ignore XHTML comments <!-- --> so it's only a matter of programming the parser to ignore noscript elements as well...as they already do live on my website.
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Postby zcorpan » Fri Apr 30, 2010 10:27 pm

JAB Creations wrote:Z, I don't do that stuff with my code though. I just put a divisible and paragraph element inside of the noscript element with some inline styling.
Right, that's why you don't experience any problem with it. If you were to use say a hidden form input or various other things that people put in noscript and expect it to not do anything, then I assume you would be surprised that it did something. That's why the element is not allowed at all in XML.

JAB Creations wrote:Also the whole bit about XHTML not ignoring the noscript element, really parsers ignore XHTML comments <!-- --> so it's only a matter of programming the parser to ignore noscript elements as well...
Yeah but then it wouldn't be XML.
JAB Creations wrote:as they already do live on my website.
No, it's just styled as display:none. The XML parser doesn't do anything special for noscript compared to any other element.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby phoebe » Thu May 13, 2010 2:03 am

You can select which schema to validate against yourself from the UI if you're not happy with the default behavior.
phoebe
<h6>
 
Posts: 3
Joined: Wed May 12, 2010 2:13 am

Re: noscript element should not be in the head element

Postby JAB Creations » Wed Jul 06, 2011 3:52 pm

Was reading the FAQ and found that moving the noscript element from the body and in to the head violates the following WHATWG policy...
http://wiki.whatwg.org/wiki/FAQ#This_me ... edefine_it.

This means you will only able to add to a spec, not redefine it.

Yes. That's been a guiding principle for the WHATWG since its founding. It's even in our charter.
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Re: noscript element should not be in the head element

Postby zcorpan » Mon Aug 01, 2011 9:44 am

Browsers (at least IE and Opera) allowed noscript in head, so the spec was actually adjusted to match.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Re: noscript element should not be in the head element

Postby JAB Creations » Mon Aug 01, 2011 3:49 pm

That still goes against what it quoted.
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Re: noscript element should not be in the head element

Postby zcorpan » Tue Aug 02, 2011 11:54 am

I can't find the quoted text in the FAQ. Anyway, it was discussing backwards-incompatible changes. Allowing noscript in head is backwards compatible since all browsers have been able to implement it and not broken any Web pages.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Re: noscript element should not be in the head element

Postby JAB Creations » Tue Aug 02, 2011 4:50 pm

Obviously that question was specifically removed entirely, wasn't part of the huge disagreement between the W3C and WHATWG was that XHTML 2.0 broke backwards compatibility?
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Re: noscript element should not be in the head element

Postby zcorpan » Wed Aug 03, 2011 7:30 am

Yeah.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Previous

Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 0 guests