W3C home > Mailing lists > Public > www-html@w3.org > November 1999

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

From: Ian Hickson <py8ieh@bath.ac.uk>
Date: Thu, 4 Nov 1999 22:16:26 +0000 (GMT)
To: Chris Wilson <cwilso@microsoft.com>
cc: www-html@w3.org, www-html-editor@w3.org, Dave Raggett <dsr@w3.org>, lehors@w3.org, ij@w3.org
Message-ID: <Pine.GSO.4.04.9911042059370.5039-100000@mary.bath.ac.uk>
On Thu, 4 Nov 1999, Chris Wilson 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.

Great!

So now we just need to agree on what the spec says about the title
attribute of the LINK element...


> 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.

Section 14.3.1 of HTML4:
# User agents MUST NOT apply alternate style sheets with a different
# style name.
   -- http://www.w3.org/TR/REC-html40/present/styles.html#h-14.3.1:


> That's what happens in IE since 4.0 [...] Preferred LINKed
> stylesheets are always applied on load, even if there are multiple
> TITLE values among those applied.

That is incorrect behaviour, and has been tested by the ImportTest
since before IE5 was released:

   http://www.bath.ac.uk/%7Epy8ieh/internet/importtest/main/preferred.html


> 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?

Section 14.3.2 of HTML4:
#    * Specify that the style sheet is persistent, preferred, or
#      alternate:
#         + To make a style sheet persistent, set the rel attribute to
#           "stylesheet" and don't set the title attribute.
#         + To make a style sheet preferred, set the rel attribute to
#           "stylesheet" and name the style sheet with the title
#           attribute.
#         + To specify an alternate style sheet, set the rel attribute to
#           "alternate stylesheet" and name the style sheet with the
#           title attribute.
#   [...]
#   If two or more LINK elements specify a preferred style sheet, the
#   first one takes precedence.
   -- http://www.w3.org/TR/REC-html40/present/styles.html#h-14.3.2

If we indeed assume that the <style> element is like a <link> with a
REL of "stylesheet", then from the above rules the behaviour I
described is exactly what should happen!

 
> 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.

Ah, interesting. Do many of them have "title"s, though?

-- 
Ian Hickson
"So far, people have shown a reasonable amount of sense in evaluating
souls (whether they are properly priced)."
  -- Nick Gibbins; Author of http://totl.net/Soul/, 1999-10-05
Received on Thursday, 4 November 1999 17:16:30 GMT

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