W3C home > Mailing lists > Public > www-style@w3.org > October 2003

Re: [CSS21] DTD defaults are supposed to be ignored

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Thu, 9 Oct 2003 22:37:07 +0300 (EEST)
To: Paul Grosso <pgrosso@arbortext.com>
Cc: www-style@w3.org
Message-ID: <Pine.GSO.4.58.0310092216090.16941@korppi.cs.tut.fi>

On Wed, 8 Oct 2003, Paul Grosso wrote:

>   Matching takes place on attribute values in the document tree.
>   Default attribute values may be defined in a DTD or elsewhere,
>   but cannot be selected by attribute selectors.
>
> First I note this wording is not compliant with RFC 2119, but I
> assume by "cannot" you mean "MUST not" as opposed to "SHOULD not".

The wording is somewhat obscure, since "the document tree" is to be taken
as a tree-like presentation of the actual markup used, as opposite to the
element structure indicated. I guess.

> I find this very objectionable.  This forbids an HTML-tree generating
> processor from being compliant with SGML and XML.  In fact, for most
> APIs to SGML/XML trees, there is no way to tell whether a given
> attribute value is set in the instance or in the DTD by defaulting.

But in the WWW world, conformance to SGML has never been much more than
lip service. Nothing that the WWW related specifications say about SGML
should be taken at face value. It suffices to say that none of the
common browsers ever supported HTML as defined as an SGML application,
e.g. supporting tag minimization.

On the other hand, it is not clear what SGML really means by defaulted
attribute values. This topic was once discussed in the newsgroup
comp.infosystems.www.authoring.stylesheets, and I really tried to
understand the SGML view on attributes. It _seemed_ to me that in the SGML
universe, all elements have all attributes (which is rather analogous to
the principle that in CSS all elements have all properties), i.e. that
this is the general idea, but I was unable to find an explicit statement
about it.

In the CSS universe, the situation could be clarified simply by making it
more explicit what attribute selectors mean. It would surely be
meaningless if the selector type [att] were defined in a context where all
elements have all attributes, so the _intent_ is relatively clear.
But there's still the open question whether attributes defaulted with
a DTD-supplied default value are different from attributes defaulted with
no explicit default value, i.e. with a default value that depends on the
application (browser, that is). This could be avoided by adding a simple
statement: All references to attributes in CSS shall be taken as referring
to attributes that have been explicitly set using attribute specifications
in the document's markup. Of course, some simple explanation might
clarify: For example, input[type="text"] matches only those input elements
that have an explicit type attribute with the value "text", not those
input elements that lack any type type attribute, even though the type
attribute has a default value of "text".

Such a principle can be regarding as illogical and surprising, and it
will surely cause some inconvenience, but the more explicitly it is
expressed, the smaller the damage.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Thursday, 9 October 2003 15:37:19 GMT

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