こしごぇ(B)

旧:http://d.hatena.ne.jp/koshigoeb/

Top-level-browsing-context って?

『HTTPの教科書』を読んでいて、X-Frame-OptionsヘッダのSAMEORIGINの説明に「Top-level-browsing-contextが一致した場合のみ許可」と書かれていた。

Same origin policy でいう origin が一致していたらという事だと思っていたんだけど、Top-level-browsing-contextという表現を使う必要があるのはどういうことだろうか。Frameの入れ子とかになっていた場合にどのoriginと比べるのか分からなくなるから、トップレベルのドキュメントコンテキストと比べるんだという感じの意味かな?

X-Frame-Options に関するドキュメントって何を参考にしたら良いんだろうか?以下のドラフトでいいのかな?

SAMEORIGIN A browser receiving content with this header MUST NOT display this content in any frame from a page of different origin than the content itself. If a browser or plugin can not reliably determine whether the origin of the content and the frame have the same origin, this MUST be treated as "DENY". (Please note that current implementations may vary on the interpretation of this criteria: In some it only allows to be framed if the origin of the top-level browsing-context is identical, in other it compares with to the origin of the framing page.)

http://tools.ietf.org/html/draft-ietf-websec-x-frame-options-01

Top-level-browsing-context ってのは、HTML5の用語という事で良いのかな?

The browsing context with no parent browsing context is the top-level browsing context of all the browsing contexts nested within it (either directly or indirectly through other nested browsing contexts).

http://www.w3.org/TR/2010/WD-html5-20100304/browsers.html#top-level-browsing-context

結局、互いのTop-level-browsing-contextのoriginが一致したら許可しまっせという感じかな?