[Bug 24451] editorial comments on LCWD

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24451

Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CLOSED                      |REOPENED
         Resolution|FIXED                       |---

--- Comment #9 from Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> ---
(In reply to Liam R E Quin from comment #8)


> 3.6.2.2.1 Safe CDATA usage rules

> "Before the CDATA section there can only be one node" - preferrably only one
> line of code" -- by code here do you mean JavaScript code? There aren't any
> nodes at all in an XML document, nor in an HTMl document until it's aprsed,
> and then you get nodes in the DOM representation (XML systems mostly don't
> use DOM at all). So I don't understand this phrase.

I believe it it essential that the text says "node". This was deliberate. DOM
equivalence is one of the most important things we look for in polyglot markup.

The spec, part you ask about, have a parsed XHTML DOM in mind. To say "line of
code" would be a huge loophole. The script element is not only for javascript,
for instance.

Parsed as HTML, a script element has only a single text node - always. Parsed
as XML, if the script element contains correctly closed tags, comments, cdata
etc, then each such "thing" will result in a node. Thus in XHTML we can have
multiple nodes. Whereas in HTML we only have one node.

In polyglot markup, while the ideal is equality between HTML and XML, we must
sometimes operate with inequality. In which case, we must define the limits of
the inequality. 

And so for the script element, the goal is to have the same amount of nodes.
For instance this script element, since it contains no whitespace outside the
CDATA node, has but one node, whether parsed as HTML or as XML:

<script><![CDATA[foo]]></script>

But, because we may need to comment out the CDATA ”start tag” and ”end tag”, we
should allow one node before and after the CDATA section, like so:

<script>/*<![CDATA[*/
        foo 
/*]]>*/</script>

The above example has 3 nodes in XML: One text node before and after the CDATA
section - and the CDATA section.  And spec thus says that <script> should not
have more than 3 nodes. 

I hope with this explanation you understand my choice of the word "node". 

Hence I propose that we keep the section as it is/was, when you opened the bug.
However, I am open to state something about what we mean about node and why we
talk about nodes.

I reopen until we get the old text back, eventually with improvements.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 20 March 2014 02:58:32 UTC