[HTML5] The noscript element

Brian Smith brian at briansmith.org
Tue Jul 3 15:44:11 PDT 2007


Henri Sivonen wrote:
> Tim van de Kamp wrote:
> 
>> I would like to know why the noscript element must not be 
>> used in XML documents. (I hope this isn't a silly question.)
> 
> The processing of the element happens in the HTML parser. It 
> does not happen when presenting the DOM. Hence, the place 
> where it is handled is missing in the XML case.

<noscript> is something that is specific to the SGML-ish syntax of
HTML5. It is much more like an IE conditional comment than a real HTML
element. It is not represented in the DOM or in the XML serialization. 

The fact that <noscript> is specific to a particular serialization of
HTML is a good indication that you should not use it. Instead, a
combination of ECMAScript and CSS should be used to achieve similar
effects. That is, the document should be written under the assumption
that Javascript is not available. There should be a script that hides
and/or removes the content that is going to be replaced by some
Javascript functionality.

Section 1.4.1 "HTML vs. XHTML" of the draft specification is worded very
badly. ostensively, the section is a much-needed explanation of the
differences between the HTML5 SGML-ish serialization, the HTML5 DOM, and
the HTML5 XML serialization. However, this explanation is clouded by
unnecessary and unhelpful advocacy of the HTML format over the XML
syntax. The HTML5 working draft is almost as much a position paper
against XHTML 2.0 as it is a technical specification. In particular, the
specification was written by people that prefer the SGML-ish syntax over
the XML syntax. 

If the spec was to be re-written by somebody who preferred the XML
syntax, then instead the specification would highlight the synergy
between the XML serialization and the DOM, and explicitly point out the
exceptions that are specific to the SGML-ish serialization. <noscript>
would either moved to chapter 8 "The HTML Syntax" and be explicitly
deprecated (using the explanation I gave above), or a mechanism to
support it in the XML serialization would be added.

Regards,
Brian




More information about the Help mailing list