W3C home > Mailing lists > Public > public-html@w3.org > February 2013

CDATA in polyglot style and script elements (Was: TAG Decision on Rescinding the request to the HTML WG to develop a polyglot guide)

From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Date: Mon, 18 Feb 2013 21:10:26 +0100
To: Sam Ruby <rubys@intertwingly.net>
Cc: David Carlisle <davidc@nag.co.uk>, public-html@w3.org
Message-ID: <20130218211026232515.b172311b@xn--mlform-iua.no>
Sam Ruby, Mon, 18 Feb 2013 14:34:35 -0500:
> Whether all of the existing restrictions in the Polyglot document are 
> necessary, or indeed if they are sufficient, is the discussion we 
> should be having.


One such thing that I have been thinking about lately is use of 
<![CDATA[ ]]> inside <style> and <script>. Though the bug has a 
slightly blurry name/description, I filed bug 20201 about this in 
December.[1] However, I reluctantly chose to accept Jirka’s argument 
against allowing it. But we should perhaps look at that issue again. 
Please speak out if you agree. ;-)

We have accepted that <![CDATA[ ]]> is not used inside <style> and 
<script>. And, while it slightly encourages some best practices to have 
that restriction, it also prevents - or at least makes it difficult - 
to auto-convert documents with inline scripts to polyglot markup.

So personally, in addition to what the spec says today which describes 
what to do when <![CDATA[ ]]> is not used, I lean towards adding rules 
for how one may also use <![CDATA[ ]]> in <style> and <script>.

And in fact, I remember that Lachlan Hunt, who objected to Polyglot 
Markup, also put questions marks around the forbiddance of <![CDATA[ 
]]>. And, as well, Henri made some (almost correct, at first, and then 
correct) remarks about the consequences of not allowing <![CDATA[ ]]>, 
in this recent round of debate about polyglot. 

If used correctly, then it seems to me that the use of <![CDATA[ ]]> 
doesn't cause much more DOM difference (perhaps it rather creates less 
difference) between XML and HTML than the requirement to use both 
xml:lang and lang. 

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20201

leif halvard silli
Received on Monday, 18 February 2013 20:11:02 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:31 UTC