W3C home > Mailing lists > Public > www-style@w3.org > December 2000

Re: <link> vs <style></style>

From: Peter S. Linss <peter@linss.com>
Date: Sun, 17 Dec 2000 14:40:55 -0800
Message-ID: <3A3D40F7.C8D88F54@linss.com>
To: www-style@w3.org
A Mozilla based browser (when HTTP Link headers get hooked up) will not pull the stylesheet
twice in that scenario. It's smart enough to see the same sheet linked to the same document
and re-use it without even attempting to re-load it, no matter where the sheet is linked, even
@imports. That's the job of the CSSStyleSheetLoader, one of my favorite pieces of code in the
whole system. Thank Ian's Evil Import Test for forcing me to write it :-)

It WILL be linked to the document twice though, (because that's what you specified) so it'll
have to process the style information twice when resolving style, probably not a noticeable
slowdown unless your stylesheet is HUGE.

I can't speak for other browsers...

"Manos M. Batsis" wrote:

> What if we send the link through the http header while also having the usual <link> in the
> (X)html source.
> If the user agent  is able to understand the Link header field, will it try to pull it
> again from the server when it reads the <link> or will it use the one in the cache?
> I don't think we are getting out of the subject of the list with this thread. After all,
> speed is a serious factor in every internet application and one of the reasons many of us
> learned to use stylesheets ;-)
>
> Manos
>
> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org]On Behalf Of Ian Hickson
> Sent: Saturday, December 16, 2000 10:28 PM
> To: Chris Croome
> Cc: www-style@w3.org
> Subject: Re: <link> vs <style></style>
>
> On Sat, 16 Dec 2000, Chris Croome wrote:
> > Agreed, and an answer to this is to have the external style sheet
> > address in the HTTP headers, so the request for the css file can be sent
> > after the headers of the html file have been returned:
> >
> > http://www.w3.org/TR/html4/present/styles.html#h-14.6
> >
> > However I've not come across sites using this, is it supported in any
> > browsers?
>
> Mozilla supports it in the http-equiv <meta> headers, but due to bug 3248,
> real HTTP 'Link' headers don't make it far enough in the code to be taken
> into account.
>
>    http://bugzilla.mozilla.org/show_bug.cgi?id=3248
>
> So I guess the answer is "almost", which is as useful as "no". ;-)
>
> --
> Ian Hickson                                     )\     _. - ._.)       fL
> Netscape, Standards Compliance QA              /. `- '  (  `--'
> +1 650 937 6593                                `- , ) -  > ) \
> irc.mozilla.org:Hixie _________________________  (.' \) (.' -' __________
Received on Sunday, 17 December 2000 17:41:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:06 GMT