-
Notifications
You must be signed in to change notification settings - Fork 4
/
115.txt
67 lines (52 loc) · 3.21 KB
/
115.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[15] [CODE(HTMLe)@en[iframe]] [[要素]]の
[DFN[[CODE(DOMa)@en[contentDocument]]]]
[[IDL属性]]は、[[フレーム]]内の[[文書]] ([CODE(DOMi)@en[Document]])
を返します。
* 仕様書
[REFS[
- [7] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-03-31 07:16:44 +09:00]] 版) <https://html.spec.whatwg.org/#dom-iframe-contentdocument>
- [13] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-03-31 07:16:44 +09:00]] 版) <https://html.spec.whatwg.org/#dom-object-contentdocument>
- [14] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-03-31 07:16:44 +09:00]] 版) <https://html.spec.whatwg.org/#dom-frame-contentdocument>
]REFS]
* 取得器
[8] [CODE(DOMi)@en[HTMLIFrameElement]] [[インターフェイス]]や
[CODE(DOMi)@en[HTMLObjectElement]] [[インターフェイス]]や
[CODE(DOMi)@en[HTMLFrameElement]] [[インターフェイス]]の
[DFN[[CODE(DOMa)@en[contentDocument]]]] [[IDL属性]]の[[取得器]]は、
次のようにしなければ[MUST[なりません]] [SRC[>>7, >>13, >>14]]。
[FIG(steps)[
= [9]
[FIG(list)[
- [19] [[文脈オブジェクト]]の[F[入れ子閲覧文脈]]が [[null]] でない
- [10] [[文脈オブジェクト]]の[F[入れ子閲覧文脈]]の[F[活性文書]]の[F[起源][文書の起源]]が[[現職設定群オブジェクト]]の[F[起源]]と[[同じ起源ドメイン]]
]FIG]
... のすべての条件を満たせば、
== [11] [[文脈オブジェクト]]の[F[入れ子閲覧文脈]]の[F[活性文書]]を返します。
= [20] それ以外なら、
== [12] [[null]] を返します。
]FIG]
[16] [[文書中]]にない場合や、[[プラグイン]]等を表す [CODE(HTMLe)@en[object]]
[[要素]]は、 [CODE(DOMa)@en[contentDocument]] が [[null]] になります。
[17] [[フレーム]]の内外で[[起源]]が異なる時も、
[CODE(DOMa)@en[contentDocument]] が [[null]] になります。
* 関連
[18] [CODE(DOMa)@en[contentWindow]]、 [CODE(DOMm)@en[getSVGDocument]] も参照。
* 歴史
[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/#parent-to-child-dom-access>
[2] [CITE@en-US-x-hixie[HTML Standard]]
( ([TIME[2012-12-05 05:38:42 +09:00]] 版))
<http://www.whatwg.org/specs/web-apps/current-work/#dom-iframe-contentdocument>
[3] [CITE@en[Web Applications 1.0 r8272 Change iframe, frame, and object.contentDocument to return null when cross-origin documents are involved.]]
( ([TIME[2013-11-13 06:50:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8271&to=8272>
[4] [CITE@en[829872 – Consider returning null from contentDocument getters when the caller does not subsume the document]]
( ([TIME[2013-11-13 20:41:52 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=829872>
[5] [CITE@en[422025 – iframe.contentDocument should use XOW (was: iframe.contentDocument should be restricted like window.document)]]
( ([TIME[2013-11-13 21:21:39 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=422025>
[6] [CITE@en[Merge effective script origin into origin · whatwg/html@8a843f2]]
([TIME[2016-03-31 16:39:04 +09:00]] 版)
<https://github.com/whatwg/html/commit/8a843f2169a6864a3024c4329528dccb2051d275>