[16] [CODE(DOMi)@en[Window]] [[インターフェイス]]の
[DFN[[CODE(DOMa)@en[frameElement]]]]
[[IDL属性]]は、本[[窓]]が[[フレーム]]の場合に、それを表す[[要素]]を返します。

* 仕様書

[REFS[
- [8] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-03-31 07:16:44 +09:00]] 版) <https://html.spec.whatwg.org/#dom-frameelement>
]REFS]

* 取得器

[9] [CODE(DOMi)@en[Window]] [[インターフェイス]]の
[DFN[[CODE(DOMa)@en[frameElement]]]]
[[IDL属性]]は、次のようにしなければ[MUST[なりません]] [SRC[>>8]]。

[FIG(steps)[
= [21] 
[VAR[現在]]を、
[VAR[[[文脈オブジェクト]]]]の[F[閲覧文脈]]に設定します。
= [22] 
[VAR[現在]]が
[CODE[null]] の場合、
== [23] 
[CODE[null]] 
を返し、
ここで停止します。
=
[25] 
[VAR[包含子]]を、
[VAR[現在]]の[F[包含子][閲覧文脈包含子]]に設定します。
= 
[24] 
[VAR[包含子]]が 
[CODE[null]]
の場合、
== 
[27] 
[CODE[null]] を返し、
ここで停止します。
= [20] 
[VAR[包含子]]の[F[節点文書]]の[F[起源][文書の起源]]と[[現在設定群オブジェクト]]の[F[起源]]が[[同じ起源ドメイン]]で''ない''場合、
== [10] [CODE[null]] を返し、
ここで停止します。
= [26] [VAR[閲覧文脈]]の[F[閲覧文脈包含子]]を返します。
]FIG]

* 関連

[15] [CODE(DOMa)@en[contentWindow]] は、逆方向の[[IDL属性]]です。

* 歴史

[1] [CITE@en[Compound Document by Reference Framework 1.0]]
( ([TIME[2010-08-17 16:50:04 +09:00]] 版))
<http://www.w3.org/TR/CDR/#child-to-parent-dom-access>

[2] [CITE@en-US[Window Object 1.0]]
( ([TIME[2006-04-08 02:19:28 +09:00]] 版))
<http://www.w3.org/TR/Window/#embedding>

[3] [CITE@en[829872 – Consider returning null from contentDocument getters when the caller does not subsume the document]]
( ([TIME[2013-11-13 20:44:00 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=829872>

[4] [CITE@en[868235 – window.frameElement should throw for cross-origin parents]]
( ([TIME[2013-11-13 21:24:15 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=868235>

[5] [CITE@en[Let frameElement return null in cross-origin situations · whatwg/html@3dc7dc9]]
([TIME[2015-10-21 11:32:44 +09:00]] 版)
<https://github.com/whatwg/html/commit/3dc7dc993e5faa35f3c56acdfc037ab1d7b7c438>

[6] [CITE@en[Clarify the definition of window.frameElement · whatwg/html@a398377]]
([TIME[2016-02-10 22:52:09 +09:00]] 版)
<https://github.com/whatwg/html/commit/a398377bbc8483e27c4fc478a097ef72f3057593>

[7] [CITE@en[Merge effective script origin into origin · whatwg/html@8a843f2]]
([TIME[2016-03-31 16:46:10 +09:00]] 版)
<https://github.com/whatwg/html/commit/8a843f2169a6864a3024c4329528dccb2051d275>

[17] [CITE@en[Use "current settings object" in the frameElement origin check]]
([[domenic]]著, [TIME[2016-07-13 06:34:08 +09:00]])
<https://github.com/whatwg/html/commit/921499fbc6d84424ebf569fe58ad82dabc9b59a0>

[18] [CITE@en[Be more precise about nested and discarded browsing contexts]]
([[domenic]]著, [TIME[2016-07-20 22:58:49 +09:00]])
<https://github.com/whatwg/html/commit/39118df640ad4a3f03f164fb5ffe0a56316297be>

[19] [CITE@en[Editorial: modernize Window's parent and frameElement]]
([[annevk]]著, [TIME[2019-02-22 19:46:09 +09:00]])
<https://github.com/whatwg/html/commit/140fde2fbde648c4d7cb19967a473c7442a0120c>

[11] [CITE@en[Editorial: modernize Window's parent and frameElement by annevk · Pull Request #4380 · whatwg/html]]
([TIME[2019-07-15 20:20:19 +09:00]])
<https://github.com/whatwg/html/pull/4380>

[12] [CITE@en[Editorial: nested browsing context is a member, not a type]]
([[annevk]], [TIME[2019-11-27 02:46:03 +09:00]], [TIME[2022-01-18T09:16:00.000Z]])
<https://github.com/whatwg/html/commit/6b737bbc428facf34ec3728c0912cf9e172d0ea4>