Re: stupid multiple definitions for the TYPE attribute

E. Stephen Mack (estephen@emf.net)
Sun, 07 Sep 1997 21:28:49 -0700


Message-Id: <3.0.3.32.19970907212849.00e5e638@emf.net>
Date: Sun, 07 Sep 1997 21:28:49 -0700
To: www-html@w3.org
From: "E. Stephen Mack" <estephen@emf.net>
In-Reply-To: <199709080123.VAA00180@melange.gnu.ai.mit.edu>
Subject: Re: stupid multiple definitions for the TYPE attribute

In arguing that most HTML 4.0 elements can use a TYPE attribute to
specify the style sheet language of an inline STYLE attribute, Joel N.
Weber II <devnull@gnu.ai.mit.edu> wrote:
> Really?  take a look at
> http://www.w3.org/TR/WD-html40/present/styles.html#adef-style

This is just an example -- the DTD is more official than any examples
in the draft.  The DTD clearly only allows the TYPE attribute for a
small number of elements, as I cited earlier (and again below).

In fact, I noticed the error in the example you quoted here, back on
29-Jul-97, and I wrote to www-html-editor@w3.org (read by Arnaud Le
Hors) about it.  Arnaud wrote back:

| this is definitely an error. There is no such thing as a type
| attribute on P and style specification given through the style
| attribute are always of the "default style sheet language".

So, there we have it, case closed.  The example Joel quoted is in error
and the DTD is correct: most elements cannot use a TYPE attribute, so
there is no contradiction of multiple TYPE attributes in a single
element (the issue that started this thread).

It's unfortunate that there is not an updated correction list to the
HTML 4.0 draft, so that we can know what errors have already been
discovered.  While maintaining such a list is labor-intensive, it
would have prevented this thread and the time it sucked up, away from
discussing more useful areas.

Joel continues:
> So, you're either misreading the spec, or it's inconsistent with
> itself.

The latter.  The example is definitely in error and inconsistent.

In a different recent e-mail to www-html, Joel wrote:
> If you look in the HTML4.0 index of attributes (at least in the
> version I downloaded; I have only a 14.4, and feel have have better
> things to do with my time than constantly retrieve the latest version
> of the specs), you'll find that the `type' attribute can mean at
> least three things; one for forms, another for OBJECT, and a third
> thing with inline style.

You're correct, TYPE means three different things.  But the context
is quite different; there are many attributes that have different
meanings depending on the element in question (consider the different
semantics of the SIZE attribute when used with FONT, HR, INPUT, and
SELECT for example; or how VALUE varies).  I don't think it's a
problem, and there would be many compatibility problems in trying to
change the existing uses of the TYPE attribute into two or three new
attributes.

As for your other point about downloading different versions of
the draft specification: The one that's available now is the
same as was posted on 8-Jul-97 -- the first and only unified HTML
4.0 draft available to the public.  While the 248 KB zip file
is a lengthy download at 14.4, it's definitely worth it.  I can't
blame the W3C for throwing too many versions at us; the opposite,
in fact -- some of the more critical errors should be corrected
immediately or at least referenced in an errata.

While we're discussing the TYPE attribute:

Note another inconsistency.  In the HTML 4.0's draft list of
attributes [1], the TYPE attribute can be used in the following ways,
as Joel pointed out:

(1) As a style of list (with LI, OL, and UL)
(2) As a style of form control (with INPUT and BUTTON)
(3) As an Internet Media Type (with OBJECT, LINK, SCRIPT, PARAM and
    STYLE) *but* sometimes the Type is listed as "%ContentType", and
    sometimes it's listed as "CDATA."  Also, the Comment descriptions
    vary ("Internet media type" vs. "Internet content type").

I don't mind that the TYPE attribute is used differently for senses
(1), (2), and (3), but *within* (3) the Type and Comment should be
internally consistent.

I agree with the points discussed by Harald.T.Alvestrand@uninett.no
and Joel regarding whether there *should* be an HTTP header for style
content.  But I think we also all agree that we don't need a TYPE or
STYLETYPE attribute for each embedded STYLE attribute.  As Peter Flynn
argued, you won't have multiple style sheet languages in the same
document.

Ideally, embedded and inline style sheets will be deprecated in
HTML 5.0 or 6.0 in favor of linked external style sheets (if we
all live that long).

[1] http://www.w3.org/TR/WD-html40/index/attribs.html
-- 
E. Stephen Mack <estephen@emf.net>    http://www.emf.net/~estephen/