Re: Behavior of <meta> elements linking in stylesheets

On Sat, 10 Apr 2004, Boris Zbarsky wrote:
>
> Say I have, in my (X?)HTML document, the following markup:
>
>    <meta http-equiv="link"
>          content='<http://whatever/something.css>; rel="stylesheet"'>

Note that technically HTML does not say that UAs may handle <meta
http-equiv> elements. It only says that servers may.


> How does this node behave from the point of view of the CSSOM? Does it
> implement the LinkStyle interface?  Does removing the node from the DOM
> remove the sheet from document.styleSheets?  Does changing the
> "http-equiv" or "content" attribute via the DOM change which sheet is
> applied and whether it's applied?
>
> That is, does this behave exactly the same as:
>
>    <link rel="stylesheet" href="http://whatever/something.css">
>
> Or does it behave more like an actual
>
>    Link: <http://whatever/something.css>; rel="stylesheet"
>
> HTTP header (which cannot be affected via the DOM, etc)?

Since HTML only says that http-equiv makes it possible for servers to find
new HTTP headers (despite the fact that to my knowledge, no server has
ever done so, and most UAs interpret them themselves), I would say that
the intention is that they are equivalent to HTTP headers, not <link>
elements. However, the HTTP specs that define Link: say that they are
exactly equivalent to <link> elements. So logically <meta> elements, which
really _can_ be implemented identically to <link> elements, should be.

So in conclusion, the specs don't say, but if you're willing to spend the
time to look at this in the first place, then <meta> should work the same
as <link> while it has http-equiv="Link".

(I could argue this either way. I argued it as above because that is the
way you said you were leaning. If you want me to argue it the other way,
just say that implementing the above is too hard.)

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
U+1047E                                         /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Saturday, 10 April 2004 15:56:31 UTC