473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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

[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
13 2072
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
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
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
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
"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

"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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: mike420 | last post by:
map(lambda f: f(1), ) Oh, OK, it was a typo (1 instead of i). I take it all back (for now). It was an honest mistake, not a troll! Still, I think it should be instead of
5
by: Jordan Rastrick | last post by:
Hi everyone, Just a little issue that I've come across in Python where I'd be interested to read the thoughts and opinions of the great thinkers and programmers who frequent this newsgroup. ...
38
by: rzed | last post by:
Periodically, we see questions about which gui package is best, or which database package to use. These questions typically trigger some exchanges of opinion, though of course this no one best...
3
by: Mike Agnes | last post by:
I would like to link to a single XHTML file and at the same time specify which of several alternative stylesheets should be used for screen presentation. Is this possible with the current...
32
by: Andreas Prilop | last post by:
Here is an illustration of the warning http://ppewww.ph.gla.ac.uk/~flavell/charset/browsers-fonts.html#dont that you should not specify a typeface when you have characters outside West European...
61
by: Steven T. Hatton | last post by:
Stroustrup's view on classes, for the most part, seems to be centered around the notion of invariants. After a bit of adjusting to the use of yamt (yet another math term) in computer science, I...
9
by: johkar | last post by:
I need some browser implementation clarification. In the below example, the alternate stylesheet could be invoked by user agents that support alternate stylesheets or by script. Are there any...
17
by: Harry George | last post by:
....at least around here. I run a corporate Open Source Software Toolkit, which makes hundreds of libraries and apps available to thousands of technical employees. The rules are that a) a very...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.