[Fwd: Interaction between "preferred" and "alternate" CSS with "media"]

This is from a discussion in netscape.public.mozilla.style
I think it belongs here.

Forwarded message 1

  • From: fantasai <fantasai@escape.com>
  • Date: Sat, 14 Apr 2001 20:02:01 -0400
  • Subject: Re: Interaction between "preferred" and "alternate" CSS with "media"
  • Message-ID: <3AD8E4F9.5FCBC631@escape.com>
Chris Hubick wrote:
> 
> Question 1.1) Will a non-preferred alternate stylesheet be applied
> automatically by the user agent without user interaction possibly due to
> media constraints dissalowing the application of the preferred stylesheet?

If no preferred stylesheet is applicable to the media, then
none will be applied. If there is no preferred stylesheet, 
then none will be applied. Alternate styles are only applied 
if explicitly chosen, so I concur with your first two "guesses" 
[snipped].

> I want to express "If you have a screen, auotmatically apply 
> screen.css, else fallback to and automatically apply default.css".

I don't believe you can do that.

> 
> Related to your example (rre you trying to say?)....
> If I make the preferred and alternate titles the same (grouping preferred
> with a plain alternate) as in:
> 
> <link rel="stylesheet" title="Preferred" media="print">
> <link rel="alternate stylesheet" title="Preferred" media="all">
> 
> Will this cause the alternate to be applied on the screen medium?
> 
> I think perhaps YES....

I don't think its a good idea, but due to this statement:
 "When a user selects a named style, the user agent MUST apply 
  all style sheets with that name." [HTML4:14.3.1, emphasis mine]
I would have to concede. 

However, that doesn't help you at all, since it would be the 
same as saying
 <link rel="stylesheet" title="Preferred" media="print">
 <link rel="stylesheet" title="Preferred" media="all">

> 
> 14.3.1 states "The author may specify that one of the alternates is a
> preferred style sheet"
> 
> Which leads me to believe that despite the different "rel" relation,
> alternates and preferred are treated the same for the most part.  Since you
> can group alternates (as in your example), I see no reason why you can not
> group a preferred with a plain alternate, causing that alternate to become
> preferred as well.  ??

The only difference between a preferred set and any other 
alternate set is that the preferred set is initially chosen.


BTW, this discussion should probably be forwarded to www-style.
Would you mind if I sent it there?

Received on Friday, 20 April 2001 23:01:40 UTC