style 要素の中身が表示できるのは正しいか

HTML4.01仕様書 14.2.3より:

User agents that don't support style sheets, or don't support the specific style sheet language used by a STYLE element, must hide the contents of the STYLE element. It is an error to render the content as part of the document's text. Some style sheet languages support syntax for hiding the content from non-conforming user agents.

うーん、サポートしてるスタイルシート言語で書いてある style 要素は隠さなくていいようにも読める。。。でもどっちみち head 要素は(本文表示画面上では)隠さなきゃならない。

HTML4.01仕様書 7.4.1 より:

User agents do not generally render elements that appear in the HEAD as content. They may, however, make information in the HEAD available to users through other mechanisms.

で、こんなのを表示してみると、

<html>
<title>head</title>
<style type="text/css">
head { display: block; }
head * { display: block; }
</style>
</head>
<body>
body
</body>
</html>

IE は body としか表示せず、firefox は head とか style 要素の中身とかを表示しちゃいます。これは IE の方が正しい気がする。もっとも HTML の仕様と CSS の仕様どっちが優先か? HTML の仕様を CSS でどこまで乗り越えていいのか? ってとこは微妙なのかも。つーかどっちでもいいかこんなの。でもこれ firefox 避けの嫌がらせに使えるかもね。



idトラックバック: