W3C home > Mailing lists > Public > www-style@w3.org > August 2002

Why the STYLE element (and attrib) shall not be in XHTML2 (Was:Re: Why is the style tag restricted to the head?)

From: Jan Roland Eriksson <jrexon@newsguy.com>
Date: Fri, 09 Aug 2002 18:05:30 +0200
To: www-style@w3.org, www-html@w3.org
Cc: Steffen Goeldner <s.goeldner@eurodata.de>
Message-ID: <l9n7lu47h6funblu4kdntv21dhf3dge2ra@4ax.com>

On Fri, 09 Aug 2002 16:48:17 +0200, you wrote in  www-style@w3.org :

[ fup's to www-html@w3.org ; crossed to www-style@w3.org ]

>Joshua Prowse wrote in www-style@w3.org :
>> What reason is there for restricting the style tag to the head
>>of the document?
>> Why not allow it anywhere in the document so that <style> tags that are placed
>> lower override earlier ones?
>
>In other words: 'Why We Need to Improve the Style Attribute' (by Eric Meyer):
>  <http://www.oreillynet.com/lpt/a/559>
>Steffen Goeldner

The original thread started on the style list with the post referenced
on top of this entry of mine, and the last comment so far in that
thread is from Steffen. All of you who are interested in the subject
may want to recall that thread.

Eric's article, as good as it may stand, addresses a situation only
from an authors point of view and mentions "Structuralists" as if they
are a separate breed :)

Ok, so I'm a "structuralist" then, and what I want to come to here is
given from a completely different angle that has not yet been touched
upon in the style list thread.

Parsing of XHTML2 document instances.

Remember that XML does not allow for a direct inclusion of CDATA
content in elements, all content must at least be treated as #PCDATA.
The only way available to include CDATA content in an XML document is
through a 'CDATA marked section'.

This means that a parser must "react" on any kind of element content
that is relevant for the structure of a doc instance and generate
appropriate entries in a parse tree accordingly.

Now, by its nature, a STYLE element shall only contain such
information that in reality does not belong in a parse tree but is
defined to be sent on unchanged to a second stage rendering
application to be used there. (that is a traditional characteristic of
CDATA content in fact)

In order to reach such a situation, for an XHTML2 that allows for the
use of a STYLE element, it seems to me that we would need a specific
XHTML2 parser that (in disguise) treats STYLE element content as
CDATA, although it is not allowed to do so following rules of XML.

Or alternatively; can the CSS-WG give a 100% guarantee that nothing
that can be written in a stylesheet (in any styling language in fact)
contains a character sequence that would send any XML compliant parser
astray if it treats STYLE element content as #PCDATA?

No, of course not, such guarantees can never be given;

So my conclusion is that the STYLE element shall disappear from the
upcoming XHTML2 spec and that style information shall be accessed only
through reference by the application level in a client that needs it.

--
Rex
Received on Friday, 9 August 2002 12:06:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:15 GMT