W3C home > Mailing lists > Public > www-html-editor@w3.org > October to December 1999

RE: The "title" attribute of "style" elements

From: Chris Wilson <cwilso@MICROSOFT.com>
Date: Thu, 4 Nov 1999 12:54:19 -0800
Message-ID: <C35556591D34D111BB5600805F1961B90C311CBF@RED-MSG-47>
To: "'Ian Hickson'" <py8ieh=mozilla@bath.ac.uk>, www-html@w3.org
Cc: www-html-editor@w3.org, Dave Raggett <dsr@w3.org>, lehors@w3.org, ij@w3.org
Ian Hickson [mailto:py8ieh@bath.ac.uk] wrote:
>Would it be a valid (if 'progressive') interpretation of the spec to
>treat the "title" attribute of the "style" element in much the same
>way as the "title" attribute of the "link" element is treated when
>used with stylesheets?

Yes it is valid, but not in the manner you suggest.  Your note about this
not being "100% backwards compatible" understates the issue:

>[Note that this is not 100% backwards compatible, since in HTML 4.0
>browsers all the style elements, even those with title attributes,
>will get used, whereas if using this proposal only the first will. I
>suggest that this is a very minor detail since very few documents ever
>include more than one style element anyway, let alone style elements
>with title attributes.]

In fact, the HTML 4.0 spec does not explicitly state that multiple LINKed
preferred stylesheets (that is, REL="stylesheet" and a given TITLE) are not
all to be applied on load.  That's what happens in IE since 4.0, and I
believe Navigator 4.x as well (haven't checked Mozilla).  Preferred LINKed
stylesheets are always applied on load, even if there are multiple TITLE
values among those applied.  Only by setting the RELationship to "alternate
stylesheet" can you keep the stylesheet from being automatically applied.  A
STYLE element functions like a LINK with a REL of "stylesheet", not one of
"alternate stylesheet".  Otherwise, how would you make a preferred embedded
stylesheet?

In addition, as someone who spends a large percentage of his time digging
through other people's HTML and stylesheets investigating bugs, I guarantee
you there are a VERY large number of documents that include more than one
STYLE element.

As an implementer with a long history with CSS stylesheets, and a large
backwards compatibility issue, I would strongly object to changing this.  If
you want to add the ability to embed alternate (as opposed to preferred)
stylesheets, then I suggest adding some mechanism like a DISABLED attribute
on the STYLE element - which, curiously enough, was in IE 4.0.  :^)  Mostly
as an accident; we put in the object model, and forgot to turn off the
attribute support.

-Chris Wilson
Received on Thursday, 4 November 1999 16:06:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:45 GMT