W3C home > Mailing lists > Public > www-style@w3.org > July 2008

RE: The SCRIPT element

From: Rainer ┼hlfors <rahlfors@wildcatsoftware.net>
Date: Wed, 16 Jul 2008 13:33:04 -0600
Message-ID: <1103A877E41F7A46A6021A6C71DAA8561A2D10@denali.WildcatSoftware.local>
To: "Francois Remy" <fremycompany_pub@yahoo.fr>, "David Dorward" <david@dorward.me.uk>, <www-style@w3.org>
Are you sending it with an XHTML/XML content type, or are you sending it with (broken) text/html?
If the latter, then you are telling the browser to execute it as HTML, reverting to tagsoup fallback rendering.
XHTML doctypes (and XHTML/XML type markup) is utterly useless unless sent with an XHTML or XML content type declaration.


From: www-style-request@w3.org on behalf of Francois Remy
Sent: Wed 2008-07-16 1:22 PM
To: David Dorward; www-style@w3.org
Subject: Re: The SCRIPT element

So you're confirming my understanding of the question.
But, why the element is rendered with the comment even if I decide to put an
XHTML doctype ?


From: "David Dorward" <david@dorward.me.uk>
Sent: Wednesday, July 16, 2008 6:33 PM
To: <www-style@w3.org>
Subject: Re: The SCRIPT element

> On 16 Jul 2008, at 16:58, Anne van Kesteren wrote:
>> On Wed, 16 Jul 2008 17:55:12 +0200, Francois Remy
>> <fremycompany_pub@yahoo.fr
>> > wrote:
>>> If we have <script><!-- --></script> display, we should
>>> see no content in the script (because this is a comment
>>> that's in the script). But in Firefox and Safari, we see
>>> the <!-- --> as plain text. In Opera, after the "fit" button
>>> was pressed, we can see the "<!-- -->".
>> That sounds correct for HTML, since <script> is not parsed like any
>> other element.
> In HTML, <script> and <style> are defined as containing CDATA, so <!--  is
> a string of characters and not the start of a comment (and magic  happens
> to stop them being interpreted as CSS or JS). There is  something to
> render here.
> In XHTML, <script> and <style> are not defined as containing CDATA, so  a
> comment is a comment and stops the script from being executed  (assuming
> the document is not served as text/html). There isn't  something to render
> here.
> --
> David Dorward
> http://dorward.me.uk/
> http://blog.dorward.me.uk/
Received on Wednesday, 16 July 2008 19:36:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:38 UTC