W3C home > Mailing lists > Public > www-style@w3.org > December 1995

Re: draft-ietf-html-style-00.txt

From: Scott E. Preece <preece@predator.urbana.mcd.mot.com>
Date: Thu, 7 Dec 1995 14:38:34 -0600
Message-Id: <199512072038.OAA08974@predator.urbana.mcd.mot.com>
To: mjhanna@sandia.gov
Cc: html-wg@oclc.org, www-style@w3.org
   From: mjhanna@sandia.gov (Michael J Hannah)
|   Will we lose anything if we remove CLASS and ID and only keep STYLE
|   as an attribute on every HTML element?  Not if you assume that the
|   only purpose for CLASS and ID is for style purposes, because the
|   content of the value assigned to the STYLE attribute can still refer
|   to classes and ids.

Invalid assumption, see below.

|   =======
|   Making up my own notation as an example (but borrowed heavily from
|   CSS1), let us assume that a name inside the STYLE attribute value that
|   is not followed by a colon is a style selector such as a style class or
|   style id.  If the name is followed by a colon then it is a style
|   declaration element.  Now let us assume that we have a general class
|   "corporate" and a subclass of "regulations" (defined in either the
|   STYLE element or in some LINKed style sheet) and we also want to modify
|   this paragraph where all text has a line through it (like a deleted
|   paragraph).  With the current proposal we would (I think) have:
|     <P CLASS="corporate.regulations" STYLE="text-decoration: line-through">
|     This text should be rendered as deleted text.</P>
|   If we remove the CLASS and ID attributes and simply have one STYLE
|   attribute whose contents is the responsibility of the style notation:
|     <P STYLE="corporate.regulations; text-decoration: line-through">
|     This text should be rendered as deleted text.</P>

Here's a counter-proposal:

Leave CLASS and ID alone, as orthogonal to this issue.  Define the
syntax of the STYLE attribute as:

	{notation-part {(href-part)}:}{name-part}{+styling-part}
({} indicates that each of the three parts is optional).

The notation-part, if present, indicates the notation used in the
styling-part and restricts the name resolution space for the name-part
to stylesheets in the given notation. The optional href-part allows
the author to indicate a specific stylesheet within which the name must
be resolved.

The name-part is used to identify a style named in a stylesheet, using
whatever name resolution mechanism the CSS ends up with; I assume it
would include at least element names, class names, element.class. and
context-specific strings of elements and classes (i.e., anything that
could be in the selector part of a stylesheet entry).

The styling-part contains anything that could be in the declaration part
of a stylesheet entry, including the surrounding brackets; the '+' is
chosen to indicate that the styling is layered on what the rest of the
specification says.

The example would be:
     <P STYLE="corporate.regulations + {text-decoration: line-through}">
     This text should be rendered as deleted text.</P>

|   ========+
|   1) Can the style/CSS working group specify everything they want to
|      specify with regards to style with only three hooks in HTML?
|      a) LINK as described in the draft to access style sheets
|      b) a STYLE element for in-document style sheet specifications
|      c) a STYLE attribute on every element (and no CLASS or ID)

I think you can do fine with just CLASS (and ID, which is a separate
issue).  If you add STYLE names, then you have to decide what to do when
the same name can be either a CLASS or a STYLE; I think the namespaces
can reasonably be combined.

|   2) Is there some markup purpose OTHER than style for which the HTML
|      working group wants to introduce the new (not defined in RFC 1866)
|      attributes of CLASS and ID?

I believe the CLASS and ID attributes are useful for the purposes they
were described as having in the HTML 3 draft - ID as a hyperlink head
and CLASS as a way of specifying additional semantics of one of HTML's
generic elements.  As a long-time information retrieval person, I can
say the ability to attach useful classes to information in the document
is critical to high-precision searching (which is *NOT* what current
HTML search enginces provide!).  I think we will see that use grow
(unless someone comes up with a good SGML browser and the high-content
domains move out of HTML entirely).

I strongly believe CLASS and ID belong in the HTML spec, not in
style-space.  Their styling use is convenient and may be their most
common short-term use, but HTML needs them regardless.


scott preece
motorola/mcg urbana design center	1101 e. university, urbana, il   61801
phone:	217-384-8589			  fax:	217-384-8550
internet mail:	preece@urbana.mcd.mot.com
Received on Thursday, 7 December 1995 15:44:22 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:38 UTC