By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,723 Members | 1,662 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,723 IT Pros & Developers. It's quick & easy.

Alternate Stylesheets Considered Harmful (by me, for the time being)

P: n/a
[Xposted, f'up to alt.html,comp.infosystems.www.authoring.stylesheets]

For ages I have provided links to alternate stylesheets from my pages as
per W3C recommendations:

<link rel="stylesheet" href="baz" type="text/css" title="Baz"
media="screen,projection" />
<link rel="alternate stylesheet" href="foo" type="text/css" title="Foo"
media="screen,projection" />
<link rel="alternate stylesheet" href="bar" type="text/css" title="Bar"
media="screen,projection" />

This morning I removed the alternate stylesheets, leaving only a
cookie-based stylesheet selector.

Why?

Simply because the current behaviour of all major CSS-supporting
browsers[1] is to preemptively download *all* linked stylesheets including
alternates when the page initially loads. Even Internet Explorer, which
doesn't even provide a mechanism to switch style sheets exhibits this
behaviour! In my case, this adds an extra 35KB to the initial[2] page
load.

Indeed some browsers[3] go even further and also download the background
images referenced in alternate stylesheets.

So until most browsers implement default style sheets sanely, I'm going
back to the cookie-based styling method.

</rant>

[1] Noticed this in Internet Explorer 5+, Mozilla 1.x, Opera 7.x, Safari
1.1 and Konqueror 3.1, although it probably effects others.
[2] 10KB page, 5KB default style sheet.
[3] Notably Konqueror, Safari.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

Jul 20 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
m
Toby A Inkster wrote:
This morning I removed the alternate stylesheets, leaving only a
cookie-based stylesheet selector.

Why?

Simply because the current behaviour of all major CSS-supporting
browsers[1] is to preemptively download *all* linked stylesheets including
alternates when the page initially loads. Even Internet Explorer, which
doesn't even provide a mechanism to switch style sheets exhibits this
behaviour!


Yeah, I also played with alistapart's javascript switcher which works
with IE, but decided it was also too much of a download, and really
a kind of kludge to patch the shortcomings of Internet Exploder.

The server side solution is attractive, except that you may be limiting
search engine participation. But I think you could have a default
page in normal (X)HTML, with buttons or links to generate the same page with
different style sheets with server side help. That way, the spider
shouldn't miss any actual content.
--
cheers m
Jul 20 '05 #2

P: n/a
Toby A Inkster <Us******************@deadspam.com> wrote in message news:<pa****************************@goddamn.co.uk >...
[snip rant without <rant> tag]
</rant>


You rant does not validate:

Line 31, column 6: end tag for element "RANT" which is not open.

--- Safalra (Stephen Morley) ---
http://www.safalra.com/hypertext
Jul 20 '05 #3

P: n/a
Safalra wrote:
Toby A Inkster <Us******************@deadspam.com> wrote in message news:<pa****************************@goddamn.co.uk >...
[snip rant without <rant> tag]
</rant>


You rant does not validate:

Line 31, column 6: end tag for element "RANT" which is not open.


<!DOCTYPE rant [
<!ELEMENT rant O - (#CDATA) -- rant element has optional opening tag -->
]>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

Jul 20 '05 #4

P: n/a
On Mon, 26 Jan 2004 07:34:59 +0000, Toby A Inkster
<Us******************@deadspam.com> wrote:
Safalra wrote:
Toby A Inkster <Us******************@deadspam.com> wrote in message
news:<pa****************************@goddamn.co.uk >...
[snip rant without <rant> tag]
</rant>


You rant does not validate:

Line 31, column 6: end tag for element "RANT" which is not open.


<!DOCTYPE rant [
<!ELEMENT rant O - (#CDATA) -- rant element has optional opening tag -->
]>


http://www.w3.org/TR/rant10/struct/global.html#h-2.7

"While the use of the opening RANT tag is not required, authors are
encouraged to include it to alert user agents of content which might be
too histrionic for adequate rendering. Agents are not required to render
contents of RANT. However, if they render RANT they may provide an
additional RANT element in response."

Of course, this section is merely informative.
Jul 20 '05 #5

P: n/a
"Harlan Messinger" <h.*********@comcast.net> wrote:
By server-side solution, I assume you mean that the server
writes one set of LINK tags (or stylesheet PIs) unless a request
parameter indicates that a different one has just been selected - -


I thought the idea was to have a LINK element that refers to a server-
side script that generates a style sheet, using the query part of a
URL, or cookie settings, or both. The HTML document could be static;
just the style sheet would get generated dynamically.

I found the original posting somewhat shocking. I had not realized how
bad the situation with alternate style sheets is. But it seems fair to
say that they were a poorly formulated idea from the beginning, and the
implementations, or lack of them, are even worse.

(Crossposting to alt.html and c.i.w.a.s. restored. I don't think it's
useful to have one subthread in one group only. Then again, this
confusion confirms my observations: crossposting usually doesn't pay
off, even if you try to set f'ups meaningfully. Actually, I think I'm
not the only one with a newsreader set to ignore massively crossposted
articles, maybe with "massively" defined as '>3' or something.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
Jul 20 '05 #6

P: n/a

"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..
"Harlan Messinger" <h.*********@comcast.net> wrote:
By server-side solution, I assume you mean that the server
writes one set of LINK tags (or stylesheet PIs) unless a request
parameter indicates that a different one has just been selected - -


I thought the idea was to have a LINK element that refers to a server-
side script that generates a style sheet, using the query part of a
URL, or cookie settings, or both. The HTML document could be static;
just the style sheet would get generated dynamically.


Ahhhh. Though I don't see how *that* would deter search engines either.

Jul 20 '05 #7

P: n/a
Neal wrote:

[snip]
http://www.w3.org/TR/rant10/struct/global.html#h-2.7

"While the use of the opening RANT tag is not required, authors are
encouraged to include it to alert user agents of content which might be
too histrionic for adequate rendering. Agents are not required to render
contents of RANT. However, if they render RANT they may provide an
additional RANT element in response."

Of course, this section is merely informative.


I thought it had been superceeded? Last I read, RANT and associated
emotive tags have been deprecated in favour of cascading emotion maps.
Not that IE supports them yet, obviously.

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 20 '05 #8

P: n/a
On Tue, 27 Jan 2004 21:25:41 +0000, Michael Rozdoba
<mr**@nowhere.invalid> declared in
alt.html,comp.infosystems.www.authoring.stylesheets:

I thought it had been superceeded? Last I read, RANT and associated
emotive tags have been deprecated in favour of cascading emotion maps.
Not that IE supports them yet, obviously.


AIUI, it hasn't actually been deprecated, although there *is* now an
equivalent in CEM {emotion-family: rant;}. Apparently there is still
some discussion as to whether defining it as a rant is simply
presentational, or actually part of the content.

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 20 '05 #9

P: n/a
On Wed, 28 Jan 2004 09:29:42 +1100, Mark Parnell
<we*******@clarkecomputers.com.au> wrote:
On Tue, 27 Jan 2004 21:25:41 +0000, Michael Rozdoba
<mr**@nowhere.invalid> declared in
alt.html,comp.infosystems.www.authoring.stylesheets:

I thought it had been superceeded? Last I read, RANT and associated
emotive tags have been deprecated in favour of cascading emotion maps.
Not that IE supports them yet, obviously.


AIUI, it hasn't actually been deprecated, although there *is* now an
equivalent in CEM {emotion-family: rant;}. Apparently there is still
some discussion as to whether defining it as a rant is simply
presentational, or actually part of the content.


<rant> markup is definitely meaningful. But you can style something to
make it appear like a rant. Another method is to use display-type: rant;

Oh, and the latest XHTML specs finally stipulate that the element <rant>
cannot contain itself.
Jul 20 '05 #10

P: n/a
Neal wrote:
<rant> cannot contain itself.


Very good.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

Jul 20 '05 #11

P: n/a
On Wed, 28 Jan 2004 09:29:42 +1100, Mark Parnell
<we*******@clarkecomputers.com.au> wrote:
On Tue, 27 Jan 2004 21:25:41 +0000, Michael Rozdoba
<mr**@nowhere.invalid> declared in
alt.html,comp.infosystems.www.authoring.stylesheets:

I thought it had been superceeded? Last I read, RANT and associated
emotive tags have been deprecated in favour of cascading emotion maps.
Not that IE supports them yet, obviously.


AIUI, it hasn't actually been deprecated, although there *is* now an
equivalent in CEM {emotion-family: rant;}. Apparently there is still
some discussion as to whether defining it as a rant is simply
presentational, or actually part of the content.


What's the CEM equivalent for <ALERT TYPE="coffee and cats">?
I can't access the spec at present - I keep getting HTTP
error 42: server has died laughing.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #12

P: n/a
Stephen Poley wrote:
On Wed, 28 Jan 2004 09:29:42 +1100, Mark Parnell
<we*******@clarkecomputers.com.au> wrote: What's the CEM equivalent for <ALERT TYPE="coffee and cats">?
I can't access the spec at present - I keep getting HTTP
error 42: server has died laughing.


I imagine an expert will be along to give you the right answer. I'm not
at all sure.

However I do remember reading that CEM shouldn't be considered a drop in
replacement for the deprecated structural mark up. Learn to be able to
recite the full spec, cogitate on the inner meaning & eventually, if you
are chosen, you might reach an enlightened state whence it becomes clear
how your coffee and cats can be emotionally mapped in a far more
harmonious manner than was ever possible with the old mark up.

HTH

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 20 '05 #13

P: n/a
On Wed, 28 Jan 2004 15:37:10 +0100, Stephen Poley
<sb******************@xs4all.nl> wrote:
What's the CEM equivalent for <ALERT TYPE="coffee and cats">?
I can't access the spec at present - I keep getting HTTP
error 42: server has died laughing.


Meaning and presentation. If there is actual coffee and actual cats, use
the HTML as they are content coffee and contented cats.
Jul 20 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.