-
Notifications
You must be signed in to change notification settings - Fork 4
/
717.txt
714 lines (567 loc) · 36.8 KB
/
717.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
[7] [[HTML]] の [DFN[[CODE(HTMLe)@en[[[iframe]]]]]] [[要素]]は、
[[入れ子閲覧文脈]]を[[表現]]します [SRC[>>51]]。
* 仕様書
[REFS[
- [51] '''[CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-05-06 10:42:35 +09:00]] 版) <https://html.spec.whatwg.org/#the-iframe-element>'''
- [60] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-05-06 10:42:35 +09:00]] 版) <https://html.spec.whatwg.org/#HTMLIFrameElement-partial>
]REFS]
* 構文
[55] [[HTML構文]]では、[[開始タグ]]も[[終了タグ]]も省略できません [SRC[>>51]]。
* 属性
[56] 次の[[属性]]があります。
[FIG(list short)[
- [[大域属性]]
- [CODE(HTMLa)@en[[[allowfullscreen]]]]
- [CODE(HTMLa)@en[allowpaymentrequest]]
- [CODE(HTMLa)@en[allowusermedia]]
- [CODE(HTMLa)@en[[[height]]]]
- [CODE(HTMLa)@en[[[name]]]]
- [CODE(HTMLa)@en[referrerpolicy]]
- [CODE(HTMLa)@en[[[sandbox]]]]
- [CODE(HTMLa)@en[[[seamless]]]]
- [CODE(HTMLa)@en[[[src]]]]
- [CODE(HTMLa)@en[[[srcdoc]]]]
- [CODE(HTMLa)@en[[[width]]]]
[HISTORY[
- [CODE(HTMLa)@en[mozapp]]
- [CODE(HTMLa)@en[mozbrowser]]
- [CODE(HTMLa)@en[remote][<iframe remote>]]
]HISTORY]
]FIG]
,[CODE(HTMLa)[[[align]]]] ,[CODE(SGML)[%[[IAlign]]]] , ,配置 ,[HTML 4] 非推奨
,[CODE(HTMLa)@en[[[allowcrossdomainxhr]]]],,,非標準,[[Air]]
,[CODE(HTMLa)[[[allowtransparency]]]] , , ,背景透明性 ,非標準
,[CODE(HTMLa)@en[[[application]]]],[CODE(HTML)@en[[[on]]]] | [CODE(HTMLe)@en[[[off]]]],,,非標準,[[HTA]]
,[CODE(HTMLa)[[[border]]]] , , ,境界線 ,非標準
,[CODE(HTMLa)[[[bordercolor]]]] ,[CODE(SGML)[%[[Color]]]] , ,境界線色 ,非標準
,[CODE(HTMLa)[[[class]]]] , ,(なし) ,級 ,[HTML 4] [CODE(SGML)[%[[coreattrs]]]]
,[CODE(HTMLa)[[[datafld]]]] , , ,データ欄 ,非標準
,[CODE(HTMLa)[[[datasrc]]]] ,[CODE(SGML)[%[[URI]]]] , ,データ源 ,非標準
,[CODE(HTMLa)@en[[[documentroot]]]],,,非標準,[[Air]]
,[CODE(HTMLa)[[[frameborder]]]] , ,[CODE(HTML)[1]] ,枠線 ,[HTML 4]
,[CODE(HTMLa)[[[hspace]]]] , , ,横余白 ,非標準
,[CODE(HTMLa)[[[id]]]] ,[CODE(SGML)[[[ID]]]] ,(なし) ,固有識別子 ,[HTML 4] [CODE(SGML)[%coreattrs]]
,[CODE(HTMLa)[[[longdesc]]]] ,[CODE(SGML)[%[[URI]]]] ,(なし) ,長い説明へのリンク ,[HTML 4]
,[CODE(HTMLa)[[[marginheight]]]] ,[CODE(SGML)[%[[Pixels]]]] , ,余白高さ ,[HTML 4]
,[CODE(HTMLa)[[[marginwidth]]]] ,[CODE(SGML)[%[[Pixels]]]] , ,余白幅 ,[HTML 4]
,[CODE(HTMLa)@en[[[ondominitialize]]]],,,非標準,[[Air]]
,[CODE(HTMLa)@en[[[sandboxroot]]]],,,非標準,[[Air]]
,[CODE(HTMLa)[[[scrolling]]]] , ,[CODE(HTML)[auto]] ,Scroll bar ,[HTML 4]
,[CODE(HTMLa)[[[security]]]] , , ,安全上の扱い ,非標準 ,[[WinIE]]
,[CODE(HTMLa)[[[style]]]] , ,(なし) ,スタイル指定 ,[HTML 4] [CODE(SGML)[%coreattrs]]
,[CODE(HTMLa)[[[title]]]] ,[CODE(SGML)[%[[Text]]]] ,(なし) ,注釈的題 ,[HTML 4] [CODE(SGML)[%coreattrs]]
,[CODE(HTMLa)@en[[[type]]]]
,[CODE(HTMLa)[[[vspace]]]] , , ,縦余白 ,非標準
,[CODE(XMLa)[[[xmlns]]]] ,[CODE(URI)[[[http://www.w3.org/1999/xhtml]]]] 固定 ,== ,[[名前空間名]] ,W3C 勧告 ,[[XHTML m12n]]
* 文脈
[53] [[埋め込み内容]]が使える場所で利用できます [SRC[>>51]]。
* 分類
[52] [CODE(HTMLe)@en[[[iframe]]]] [[要素]]は次の通り分類されています [SRC[>>51]]。
[FIG(short list)[
- [[フロー内容]]
- [[語句内容]]
- [[埋め込み内容]]
- [[対話的内容]]
- [[触知可能内容]]
]FIG]
* 状態
[72] [[要素]]、[[閲覧文脈包含子]]の状態に加えて:
[FIG(list members)[
: [F[[CODE(DOMa)@en[sandbox]]]] : [CODE(DOMi)@en[DOMTokenList]]
]FIG]
* 内容
[9]
:[[内容模型]]:[CODE(SGML)[(%[[flow]])*]]
[11] [CODE(HTMLe)[iframe]] 要素の内容は、未対応 UA
や不使用設定の UA だけが表示するべきです [SRC[HTML 4 16.5]]。
* [CODE(DOMi)@en[HTMLIFrameElement]] インターフェイス
[57] [CODE(HTMLe)@en[[[iframe]]]] [[要素]]の[[要素インターフェイス]]は、
[DFN[[CODE(DOMi)@en[[[HTMLIFrameElement]]]]]] [[インターフェイス]]です [SRC[>>51]]。
[58] この[[インターフェイス]]は[[文書環境]]に[[晒され]]ています [SRC[>>51]]。
[59] [CODE(DOMi)@en[[[HTMLElement]]]] [[インターフェイス]]を[[継承]]する [SRC[>>51]] 他、
次の[[メンバー]]があります [SRC[>>51, >>60]]。
[FIG(list short)[
- [CODE(DOMa)@en[[[allowFullscreen]]]]
- [CODE(DOMa)@en[allowPaymentRequest]]
- [CODE(DOMa)@en[[[contentDocument]]]]
- [CODE(DOMa)@en[[[contentWindow]]]]
- [CODE(DOMm)@en[[[getSVGDocument]]]]
- [CODE(DOMa)@en[[[height]]]]
- [CODE(DOMa)@en[[[name]]]]
- [CODE(DOMa)@en[[[sandbox]]]]
- [CODE(DOMa)@en[[[seamless]]]]
- [CODE(DOMa)@en[[[src]]]]
- [CODE(DOMa)@en[[[srcdoc]]]]
- [CODE(DOMa)@en[[[width]]]]
- [CODE(DOMa)@en[[[align]]]]
- [CODE(DOMa)@en[[[frameBorder]]]]
- [CODE(DOMa)@en[[[longDesc]]]]
- [CODE(DOMa)@en[[[marginHeight]]]]
- [CODE(DOMa)@en[[[marginWidth]]]]
- [CODE(DOMa)@en[[[scrolling]]]]
]FIG]
[66] 次の状態を持ちます。
[FIG(list members)[
:[[入れ子閲覧文脈]]:[CODE(HTMLe)@en[[[iframe]]]] [[要素]]が[[表現]]する[[閲覧文脈]]です。
:[[iframe fullscreen flag]]:
]FIG]
* 処理
[68] [[フレーム]]を参照。
[65] [CODE(HTMLe)@en[[[iframe]]]] [[要素]][VAR[要素]]の[VAR[属性]]に関する[[属性変更手順群]]は、[VAR[新しい値]]を次のようにしなければ[MUST[なりません]] [SRC[>>51]]。
[FIG(steps)[
= [89] [VAR[要素]]の[F[入れ子閲覧文脈]]が [CODE[null]] 以外なら、
== [90]
[FIG(list)[
- [91] [VAR[属性]]が [CODE(HTMLa)@en[[[srcdoc]]]] [[属性]]
- [92] [VAR[属性]]が [CODE(HTMLa)@en[[[src]]]] [[属性]]で[VAR[要素]]に [CODE(HTMLa)@en[[[srcdoc]]]] [[属性]]がない
]FIG]
... のいずれかの場合、
=== [93] [[[CODE(HTMLe)@en[iframe]]属性の処理]]を行います。
== [94] [VAR[属性]]が [CODE(HTMLa)@en[name][閲覧文脈名]] [[属性]]なら、
=== [95] [VAR[要素]]の[F[入れ子閲覧文脈]]の[F[閲覧文脈名]]を、
[VAR[新しい値]]が [CODE[null]] なら[[空文字列]]、それ以外なら[VAR[新しい値]]に設定します。
== [96] [VAR[属性]]が [CODE(HTMLa)@en[sandbox]] [[属性]]なら、
=== [97] [VAR[新しい値]]が [CODE[null]] なら、
==== [98] [VAR[要素]]の[F[入れ子閲覧文脈]]の [[[CODE(HTMLe)@en[iframe]]砂箱化フラグ集合]]を、
空にします。
=== [99] それ以外なら、
==== [100] [VAR[要素]]の[F[入れ子閲覧文脈]]の [[[CODE(HTMLe)@en[iframe]]砂箱化フラグ集合]]を、
[VAR[新しい値]]を[[砂箱化指令を構文解析]]した結果に設定します。
]FIG]
[75] [CODE(HTMLe)@en[iframe]] [[要素]]の[[属性]] [VAR[attr]] が表す機能について、
[[文書]][VAR[文書]]が[DFN[[RUBYB[利用を認められる]@en[allowed to use]]]]かどうかは、
次の手順によります [SRC[>>51]]。
[FIG(steps)[
= [77] [VAR[文書]]の[F[閲覧文脈]]が [[null]] なら、
== [78] [[偽]]を返します。
= [107] それ以外で、[VAR[文書]]の[F[閲覧文脈]]の[F[活性文書]]が[VAR[文書]]以外なら、
== [108] [[偽]]を返します。
= [79] それ以外で、[VAR[文書]]の[F[閲覧文脈]]が[F[[[最上位閲覧文脈]]である]]なら、
== [80] [[真]]を返します。
= [110] それ以外なら、
== [111] [VAR[attr]] が [CODE[allowfullscreen]] なら、
=== [76] [VAR[文書]]の[F[閲覧文脈]]の[F[閲覧文脈包含子]]が [CODE(HTMLe)@en[iframe]] [[要素]]で、
その [VAR[attr]] [[属性]]が指定されていて、
その[F[節点文書]]により [VAR[attr]] の機能の[[利用を認められる]]なら、
==== [81] [[真]]を返し、ここで停止します。
== [112] それ以外なら、
=== [113]
[VAR[文書]]の[F[[VAR[attr]] フラグ][allow* flags]]が設定されていて、
[VAR[文書]]の[F[閲覧文脈]]の[F[閲覧文脈包含子]]が [CODE(HTMLe)@en[iframe]] [[要素]]で、
その[F[節点文書]]により [VAR[attr]] の機能の[[利用を認められる]]なら、
==== [114] [[真]]を返し、ここで停止します。
== [83] [[偽]]を返します。
]FIG]
[85] つまり[[最上位閲覧文脈]]であるか、上位のすべての[[フレーム]]で [VAR[attr]]
[[属性]]が指定されているなら、その機能を使うことが認められます。
どの時点の[[属性値]]が適用されるかは [CODE[allowfullscreen]] とそれ以外とで微妙に違っています。
;; [86] これは[[起源]]に関わらず適用される制約です。厳密に言えば[[同一起源ポリシー]]違反で、
上位フレームの情報がわずかに下位フレームに漏洩します。
[84] この条件が適用される[[属性]]には、 [CODE(HTMLa)@en[allowfullscreen]]
と [CODE(HTMLa)@en[allowusermedia]] と
[CODE[allowpaymentrequest]] とがあります。
[82] [[文書]][VAR[文書]]の [DFN[set the allow* flags]] は、
次のようにします [SRC[>>51]]。
[FIG(steps)[
= [115] [VAR[iframe]] を、[VAR[文書]]の[F[閲覧文脈]]の[F[閲覧文脈包含子]]に設定します。
= [124] [VAR[iframe]] の[F[節点文書]]の[F[起源][文書の起源]]が[VAR[文書]]の[F[起源][文書の起源]]と[[同じ起源ドメイン]]なら、
== [125] [VAR[文書]]の [F[allowpaymentrequest flag]] を、[[真]]に設定します。
== [126] [VAR[文書]]の [F[allowusermedia flag]] を、[[真]]に設定します。
= [116] それ以外で、 [VAR[iframe]] が [CODE(HTMLe)@en[iframe]] [[要素]]の場合、
== [117] [VAR[iframe]] に [CODE(HTMLa)@en[allowpaymentrequest]] [[属性]]があれば、
=== [118] [VAR[文書]]の [F[allowpaymentrequest flag]] を、[[真]]に設定します。
== [119] [VAR[iframe]] に [CODE(HTMLa)@en[allowusermedia]] [[属性]]があれば、
=== [120] [VAR[文書]]の [F[allowusermedia flag]] を、[[真]]に設定します。
]FIG]
;; [121] [[閲覧文脈の作成]]や [[navigate]] から呼び出されます。
[127] [[文書]]は、 [DFN[[F[allowpaymentrequest flag]]]]
と [DFN[[F[allowusermedia flag]]]] を持ちます。
* レンダリング
[13] 行内フレームは大きさを変更できません。ですから [CODE(HTMLa)[[[noresize]]]]
属性はありません。 [SRC[HTML 4 16.5]]
[14] HTML 4 は >>13 としていますが、利用者の便を考えれば、
UA は寸法変更機能を設けた方が良いかもしれません。
* 安全性
[15] [[フレーム]]一般と同じく、外部文書を埋込み、 [[DOM]]
などで相互に操作できることによって生じ得る保安上の問題に注意が必要です。
多くの UA では、異なるドメインでのスクリプトによる access
を禁止するなどの措置をとっています。
(現状では十分ではないという指摘もありますし、
あまり制限しすぎると自由度が失われるという問題もあります。)
[1] 異なる[[ドメイン]]の参照は (大抵)
[[広告]]とかだし、ブラウザの設定で出来ないようにして欲しいなあ。
[2] >>1 それを言うなら [CODE(HTMLe)[iframe]] 自体こうこっく(以下略)
[19] [CODE(HTMLe)[[[img]]]] 要素などと同じように、
ごく小さな大きさを指定したり [[CSS]]
などにより非表示にしたりして閲覧者が気付かないうちに別の[[資源]]が読み込まれるように仕組むことができます。
[CODE(HTMLe)[[[img]]]] 要素の場合と同様に[[アクセス・カウンタ]]のような
(閲覧者にとって) 比較的無害な場合もあれば、
[[ブラクラ]]のような危険なものが埋め込まれる可能性もあります。
[[アクセス・カウンタ]]の類と一口に言っても、
単なる計数の場合もあれば、閲覧者の個人情報の収集を狙ったものである可能性もあり、
注意が必要なことには変わりありません。 >>18
の問題のように、外部のサイトに影響を与えさせることを狙った使用例もあります
(>>20)。
[20] 注意: 単純な [CODE(HTTP)[[[GET]]]]
アクセスによって鯖側の状態に大きく影響を与えてしまう
([[安全]]でない) のは [[REST]]
的に間違った実装であり、その外部サイトの側が [CODE(HTMLe)[[[iframe]]]]
で参照されるか否か以前の問題を抱えているとも言えます。
ただし >>18 のようなアクセス数を数えるという場合には必然的に
[CODE(HTTP)[[[GET]]]] でなければなりませんし、 [[REST]]
というか [[HTTP]] 的にも一応問題ないことになってはいるので、
難しい問題ではあります。
[26] '''実例: 2ch からランク付け対象サイトへのリンク'''
[CITE[2chにlivedoor秘書乙部Blogが埋め込まれている!]]
<http://blog.livedoor.jp/otobeorz/>
[[アクセス数]]によって順位付けされている日記サイトへの
[CODE(HTMLe)@en[[[iframe]]]] を使った[[リンク]]が、
日記の著者とは無関係の第三者である [[2ch]]
の [[Web頁]]に含まれていました。
[[2ch]] は膨大な[[アクセス]]のある[[掲示板]]サイトで、
これによって、当該日記の順位は急上昇しました。
[[2ch]] の[[管理者]]である[[ひろゆき]]は、
[[アクセス数]]の水増しのための不正があった場合に、
それが第三者によるものであってもその日記を削除するという日記システム管理者の方針が日記システム管理者の関係者であっても例外とされずに適用されるかを確かめたかったとしています。
この事例は、技術的には
- 無関係な [[Web頁]]を[[利用者]]が気づかないうちに読込ませられるという
[[Webブラウザ]]実装上の問題
- 本来[[冪等]]で[[安全]]な [CODE(HTTP)@en[[[GET]]]]
[[要求]]で自動順位付けすることの是非
社会的には
- [[アクセス数]]という表面的なもので順位付けしている愚かさ
- 悪意のある第三者によってシステム利用者が不利益を被り得る運用方法
への注意を喚起しています。
また、日記システム提供者の[[ライブドア]]は、
[CODE(HTMLe)@en[[[iframe]]]] により[[リンク]]に対して
[[JavaScript]] のコードによる[Q[報復]]を行っていますが、
やろうと思えばそれ以上にえげつないこともできました。
[22] '''実例: mixi による閲覧者の特定'''
- [23] [CITE[インターネット殺人事件 : 日記 : 2005-02]] <http://internet.kill.jp/d/200502.html#d14_t2>
- [24] [CITE[fladdict.net blog: MIXIを使った、トラフィックの個人追跡システム]]
<http://www.fladdict.net/blog-jp/archives/2005/12/mixi.php>
会員制で、ある会員 [VAR@em[X]] がある内部の頁 [VAR@en[P[SUB[M]]]]
を閲覧したことを、 [VAR@en[P[SUB[M]]]] の著者である別の会員
[VAR@en[Y]] が知り得る機能 ([Q[[[足跡]]]]) が存在するサービス
[[mixi]] を悪用することで、 [VAR@en[Y]] は外部の Web
頁 [VAR@en[Q]] を閲覧した [[mixi]] 会員の個人情報を入手し得ます。
機能を悪用する会員 [VAR@en[Y]] がよろしくないのは別として
[WEAK[(あるいは[Q[正当な利用]]だとの主張もできるかもしれませんがw)]]、
別の Web サイトに情報を送ることができる Web
ブラウザの実装にも、個人情報を半自動で [WEAK[(= 会員の意識しない間に)]]
記録する [[mixi]] のシステムにも問題があります。
;;
>>24 にコメントを書いている人が問題を軽視し過ぎなのが情けない。
* 知的財産権に関して
[21] 埋め込み型リンクと著作権等との関係については
[CODE(HTMLe)[[[frame]]]] の項をご覧下さい。
* 不思議解釈
[16] [Q[iframe]] は [Q[inline frame]] の略のようですから、
[Q[インライン・フレーム]]と読むのが適当でしょう。
省略形は省略形のまま読む派 (謎) なら [Q[アイ・フレーム]]
も許容範囲でしょう。
中には[Q[イフレーム]]と読む人もいます。違和感ありまくりですが、
[Q[アイ・フレーム]]が良くて[Q[イフレーム]]は悪いとする理由はなさそうですから、
まあ良いでしょう。
ところが、世間には[Q[イン・フレーム]]と読む人もいます。
確かに [Q[inline frame]] の省略としてあり得るものではありますが、
単なる[Q[イン]]と[Q[インライン]]では意味が随分違ってきます。
[Q[イン・フレーム]]と読むと[Q[フレームの中]]ととられても仕方がありません。
あるいは、頁の''中のフレーム''という意味と誤解していることからそう呼ぶのかもしれませんが、
もしそうだとしたら呆れるばかりです。
[Q[インナー・フレーム]]なる用例も発見しました。
確かに頁の内側にあることには違いありませんが・・・。
[17] 読み方のまとめ:
- ○ 行内フレーム
- ○ インライン・フレーム
- ○ アイ・フレーム
- × イフレーム
- × イン・フレーム
- × インナー・フレーム
[25] '''[CODE(HTMLe)@en[iframe]] の代替内容に [CODE(HTMLe)@en[frame]]!?'''
[[タグ講座]]の中には、
>
[PRE(HTML invalid example code)[
<iframe width=150 height=200 src="blahblah.html">
<frame src="blahblah.html">
</iframe>
]PRE]
のように[[代替内容]]として [CODE(HTMLe)@en[[[frame]]]]
[[要素]]を入れろとしているものがあるそうです。
;; 出典:
- [CITE[<IFRAME>との出会い、そして克服 : Hotwired]]
([[Zach Waller]] 著、1997年11月28日付け、日本語訳2005年12月現在)
<http://hotwired.goo.ne.jp/webmonkey/html/97/47/>
- [CITE@en[The IFrames Lowdown]]
([[Zach Waller]] 著、2001年4月10日付け、2005年12月現在)
<http://hotwired.lycos.com/webmonkey/96/37/index2a_page5.html?tw=authoring>
;;
この出典の[[タグ講座]]もなかなか低品質だw
低品質なのに駄目出しされる元の[[タグ講座]]はどれだけ劣悪なのかww
ちなみにこの出典の[[タグ講座]]の日本語訳は翻訳がひどくて何が言いたいのかさっぱりわからないww
[29]
[CITE[Safari Developer FAQ]] ([CODE[2006-12-31 11:40:00 +09:00]] 版) <http://developer.apple.com/jp/internet/safari/faq.html#anchor5>
> SafariのBack/Forwardキャッシュ(訪れた人がブラウザの「戻る」ボタンや「進む」ボタンを押した時点から蓄積されるキャッシュ)も、ページにフレームを含めることによって阻止することができます。フレームベースのページは、Back/Forwardキャッシュには保存されず、非フレームベースのページも下に示す不可視のiframeを追加することによって同じように動作します。
([[名無しさん]])
[32]
[Q[アイフレ]]と略す人もいるそうです。
* 例
[10] 単純な埋め込み例 [SRC[HTML 4 16.5]]
[PRE(HTML)[
<IFRAME src="foo.html" width="400" height="500"
scrolling="auto" frameborder="1">
[Your user agent does not support frames or is currently configured
not to display frames. However, you may visit
<A href="foo.html">the related document.</A>]
</IFRAME>
]PRE]
この例では、対応している UA は文章中に [SAMP(URI)[foo.html]]
を枠線付きで埋込みます。未対応 UA
は [CODE(HTMLe)[iframe]] の内容をレンダリングします。
* 関連
[12] [CODE(HTMLe)[[[object]]]] 要素型を使っても HTML
文書などを埋込むことができます。属性などは異なりますが、
レンダリングなどに関してはおおむねどちらを使っても同じです。
また、多くの UA では基本的に利用者から見て同じようになります。
[71] [CODE(HTMLe)@en[frame]] [[要素]]と似ていますが、
[CODE(HTMLe)@en[frame]] [[要素]]は
[CODE(HTMLe)@en[frameset]] [[要素]]でしか使えません。
* 歴史
[REFS[
- [8] [[HTML 4]]
-- 16.5 Inline frames: the [CODE(HTMLe)[IFRAME]] element
<IW:HTML4:"present/frames.html#idx-frame-7">
]REFS]
[54] [[HTML4]] では [CODE(SGML)@en[[[%inline;]]]] に分類されていました。
[3] そういえば昔、 [[WinIE 5]] の頃、 [CODE(HTMLe)[iframe]] 内に表示されている文書の [CODE(HTMLe)[[[title]]]] が
[[window]] の [[title bar]] に表示されるというバグ
[WEAK[([[M$]] は[[仕様]]だと言い張るかもしれんが。)]] がありましたね。
そのバグ、今でもあるのかなあ
[35] [[Firefox]] 3.0.4 で[[フィード]]の[[エントリー]]の中身 ([[Atom]]
の [CODE(XMLe)@en[atom:[[content]]]] [[要素]]の[[内容]]) に [CODE(HTMLe)@en[[[iframe]]]]
[[要素]]を含めると、[[フィード]]の中身の一覧で出てくる説明部分に
[CODE(XMLe)@en[[[iframe]]]] [[要素]]の[[内容]]のソースがそのまま出てきます。
どうも、[[スクリプト有効]]で[[構文解析]]した結果 [CODE(DOMi)@en[[[Text]]]]
[[節点]]になった[[内容]]をそのまま取ってきているみたいですね。
[4] まじれすすると、 [CODE(HTMLe)[iframe]] 要素型は[[非推奨]]なので [CODE(HTMLe)[[[object]]]] 要素型を使いましょう。
[5] >>4 または [[XHTML 2]] で [CODE(XHTMLa)[[[src]]]]
[[汎用属性]]という手もある。
[6] しかし[[イフレーム]]はないだろう・・・。
[18]
[[2ch]] から外部日記サイトへの [CODE(HTMLe)[[[iframe]]]]
による[[リンク]]の問題への言及における、[CODE(HTMLe)[[[iframe]]]]
によるリンクを指した表現:
- [Q[埋め込み]]: 結構多い。
- [Q[リンク]]: 結構多い。 2ch の一部のスレタイにも採用
(例: [CITE[【ネット】"なぜ?" 2ちゃんねるトップページに、ライブドア・乙部綾子ブログへの隠しリンク★4]])
- [Q[参照]]: ちらほら
参考:
<IW:Google:"2ch 乙部 iframe">
(現時点では日が浅いので結果は然程多くない。)
([[名無しさん]] [WEAK[2005-05-13 10:15:37 +00:00]])
[27]
[CITE[xkr.us / dom / Accessing the document inside an iframe]] <http://xkr.us/articles/dom/iframe-document/>
([[名無しさん]] [WEAK[2006-10-21 02:10:17 +00:00]])
[28]
[CITE[IFRAME を使わない方法の補足 | WWW WATCH]] <http://hyper-text.org/archives/2006/11/object_element.shtml>
([[名無しさん]] [WEAK[2006-11-26 09:56:01 +00:00]])
[30]
[CITE[Bug 80713 – Need a way to specify an auto-height for an IFRAME such that the frame is given the full height of the contained content]] ([CODE[2007-04-25 20:28:29 +09:00]] 版) <https://bugzilla.mozilla.org/show_bug.cgi?id=80713>
([[名無しさん]] [WEAK[2007-04-25 11:37:12 +00:00]])
[31]
[CITE[JavaScript インラインフレーム(iframe)関連 - とみぞーノート]] ([CODE[2007-05-10 21:44:39 +09:00]] 版) <http://wiki.bit-hive.com/tomizoo/pg/JavaScript%20%A5%A4%A5%F3%A5%E9%A5%A4%A5%F3%A5%D5%A5%EC%A1%BC%A5%E0(iframe)%B4%D8%CF%A2>
([[名無しさん]] [WEAK[2007-05-10 12:46:51 +00:00]])
[33]
[CITE[outsider reflex]] ([[Piro(SHIMODA Hiroshi)]] 著, [CODE[2008-03-01 12:23:54 +09:00]] 版) <http://piro.sakura.ne.jp/>
([CODE(MIME)@en[[[text/html]]]])
[PRE(HTML bad example code)[
<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" [
<!ENTITY % XLINK.xmlns.attrib "xmlns:xhtml2 CDATA #FIXED 'http://www.w3.org/2002/06/xhtml2'">
<!ENTITY % Inline.extra "| xhtml2:l | iframe">
<!ENTITY % newInlineContents "(#PCDATA|br|span|em|strong|dfn|code|samp|kbd|var|cite|abbr|acronym|q|sub|sup|bdo|a|img|map|object|input|select|textarea|label|button|ruby|ins|del|script|noscript|xhtml2:l)*">
<!ENTITY % coreAttributes "
id ID #IMPLIED
class CDATA #IMPLIED
style CDATA #IMPLIED
title CDATA #IMPLIED">
<!ELEMENT xhtml2:l %newInlineContents;>
<!ATTLIST xhtml2:l %coreAttributes;>
<!ELEMENT iframe %newInlineContents;>
<!ATTLIST iframe
%coreAttributes;
longdesc CDATA #IMPLIED
src CDATA #IMPLIED
frameborder ( 1 | 0 ) '1'
marginwidth CDATA #IMPLIED
marginheight CDATA #IMPLIED
scrolling ( yes | no | auto ) 'auto'
height CDATA #IMPLIED
width CDATA #IMPLIED
>
]>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
xml:lang="ja">
]PRE]
([[名無しさん]])
[34]
[CITE[The <iframe> element and sandboxing ideas]] ([[Ian Hickson <ian@...>]] 著, [TIME[2008-05-21 22:30:48 +09:00]] 版) <http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/14191>
[36] [CITE[iframe]]
([TIME[2009-10-18 15:51:31 +09:00]] 版)
<http://suika.fam.cx/~wakaba/-temp/test/html/iframe/remove-create-2.html>
[37] >>36 Firefox 3.5.3 は FAIL、 Opera と Chrome は PASS。
[38] [CITE['''['''whatwg''']''' Iframe dimensions]]
([TIME[2010-08-12 07:46:38 +09:00]] 版)
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027832.html>
[39] [CITE['''['''whatwg''']''' Should events be paused on detached iframes?]]
([TIME[2012-02-08 09:55:26 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-February/034755.html>
[40] [CITE@en[Web Applications 1.0 r7139 Remove the 'magic iframe' feature.]]
( ([TIME[2012-06-23 05:54:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7138&to=7139>
[41] [CITE[''''''[''''''whatwg'''''']'''''' The so-called 'magic iframe' feature]]
( ([TIME[2012-06-23 05:59:53 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-June/036469.html>
[42] [CITE[javascript - iframe without an src attribute - Stack Overflow]]
( ([TIME[2013-07-02 07:32:28 +09:00]] 版))
<http://stackoverflow.com/questions/4284605/iframe-without-an-src-attribute>
[43] [CITE@en[Web Applications 1.0 r8289 Handle the case of removing the 'src' attribute on a live <iframe>, and some minor clarity changes.]]
( ([TIME[2013-11-16 07:10:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8288&to=8289>
[44] [CITE@en[Web Applications 1.0 r7406 Bit of editorial cleanup for <iframe>. Should have no normative effect.]]
( ([TIME[2012-09-26 12:27:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7405&to=7406>
[45] [CITE@en[Web Applications 1.0 r3280 <iframe> content model.]]
( ([TIME[2009-06-17 04:14:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=3279&to=3280>
[46] [CITE@ja[iframe - XUL | MDN]]
( ([TIME[2013-11-14 08:19:45 +09:00]] 版))
<https://developer.mozilla.org/ja/docs/XUL/iframe>
[47] [CITE[''''''[''''''whatwg'''''']'''''' Avoiding synchronous iframe load]]
( ([TIME[2014-01-22 04:26:50 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-January/041898.html>
[48] [CITE@en[Web Applications 1.0 r8708 <iframe>s only do their nested browsing context stuff when they are themselves in a browsing context]]
( ([TIME[2014-08-06 04:31:00 +09:00]] 版))
<http://html5.org/r/8708>
[49] [CITE@en[''''''[''''''webappsec'''''']'''''' Rechartering: force secure-only child browsing contexts]]
( ([[Brad Hill]] 著, [TIME[2014-11-10 09:07:13 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-webappsec/2014Nov/0128.html>
[50] [CITE@en[''''''[''''''whatwg'''''']'''''' <iframe async>]]
([[Anne van Kesteren]] 著, [TIME[2015-02-27 16:57:47 +09:00]] 版)
<https://lists.w3.org/Archives/Public/public-whatwg-archive/2015Feb/0051.html>
[61]
,[CODE(DOMa)@en[[[align]]]],"[CODE(DOMi)@en[[[HTMLIFrameElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[allowTransparency]]]],"[CODE(DOMi)@en[[[HTMLFrameBase2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[border]]]],"[CODE(DOMi)@en[[[HTMLFrameBase]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[contentWindow]]]],"[CODE(DOMi)@en[[[HTMLFrameBase2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[frameBorder]]]],"[CODE(DOMi)@en[[[HTMLFrameBase]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[frameSpacing]]]],"[CODE(DOMi)@en[[[HTMLFrameBase]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[height]]]],"[CODE(DOMi)@en[[[HTMLIFrameElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[hspace]]]],"[CODE(DOMi)@en[[[HTMLIFrameElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[longDesc]]]],"[CODE(DOMi)@en[[[HTMLFrameBase3]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[marginHeight]]]],"[CODE(DOMi)@en[[[HTMLFrameBase]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[marginWidth]]]],"[CODE(DOMi)@en[[[HTMLFrameBase]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[name]]]],"[CODE(DOMi)@en[[[HTMLFrameBase]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[noResize]]]],"[CODE(DOMi)@en[[[HTMLFrameBase]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[onload]]]],"[CODE(DOMi)@en[[[HTMLFrameBase2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[onreadystatechange]]]],"[CODE(DOMi)@en[[[HTMLFrameBase2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[readyState]]]],"[CODE(DOMi)@en[[[HTMLFrameBase2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[scrolling]]]],"[CODE(DOMi)@en[[[HTMLFrameBase]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[src]]]],"[CODE(DOMi)@en[[[HTMLFrameBase]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[vspace]]]],"[CODE(DOMi)@en[[[HTMLIFrameElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[width]]]],"[CODE(DOMi)@en[[[HTMLIFrameElement2]]]] ([[Trident]])"
[FIG(quote)[
[FIGCAPTION[
[62] ([TIME[2015-06-11 18:29:20 +09:00]] 版)
<http://www.ecma.org/about-ecma/>
]FIGCAPTION]
>
> <div style="font-size: 10pt; line-height: 1.5em;">
> <p>ECMA is the International Network of Folding Carton Organisations; carton businesses, national carton associations and suppliers to the carton industry. <br /><br />ECMA provides the European folding carton industry with a dynamic business Network. <br /><br />With its seat in The Hague, The Netherlands, and an office in Brussels, ECMA represents 500 carton producers in nearly all countries in the European Economic Area. Around 70% of the total carton market volume in Europe, and a current workforce of about 45.000 people are represented in ECMA. <br /><br />ECMA works to fulfill its mission for the benefit of member companies in a variety of functions. As part of the ECMA Roadmap 2015 presented on the occasion of ECMA’s 50th anniversary, the association launched an ambitious programme dedicated to supporting the healthy development of European carton makers, raising the profile and professionalism of the European carton industry, developing advanced international standards and best practices, and helping carton makers grow their international network and expertise.<br /><br /><iframe src="uploads/Bestanden/Structure ECMA/120919-ECMA-5-flap-box-full.wmv" width="320" height="240"></iframe></p>
> <p><br />Download the brochure with Membership Information <strong><a title="ECMA Membership Brochure" href="uploads/Bestanden/Membership/ECMA Membership Information.pdf" target="_blank">here</a></strong>.</p>
> </div>
>
]FIG]
[63] >>62 は [CODE(HTMLe)@en[[[iframe]]]] を [[WMV]] に [[navigate]]
した結果[[プラグイン文書]]が[[レンダリング]]されることを想定しているのでしょうが、
[[WMV]] 用の[[プラグイン]]が存在しない環境ではページの表示と同時に[[ダウンロード]]が開始されてしまいます。
[FIG(quote)[
[FIGCAPTION[
[64] [CITE[Android Intents with Chrome - Google Chrome]]
([TIME[2015-07-07 18:07:13 +09:00]] 版)
<https://developer.chrome.com/multidevice/android/intents>
]FIGCAPTION]
> One scenario is launching an app when the user lands on a page, which you can achieve by embedding an iframe in the page with a custom URI-scheme set as the src, as follows: <iframe src="paulsawesomeapp://page1"> </iframe>. This works in the Chrome for Android browser, version 18 and earlier. It also works in the Android browser, of course.
> The functionality has changed slightly in Chrome for Android, versions 25 and later. It is no longer possible to launch an Android app by setting an iframe's src attribute. For example, navigating an iframe to a URI with a custom scheme such as paulsawesomeapp:// will not work even if the user has the appropriate app installed. Instead, you should implement a user gesture to launch the app via a custom scheme, or use the “intent:” syntax described in this article.
]FIG]
[67] [CITE@en[''''''[''''''embedded'''''']'''''' As discussed during the Paris F2F, rewrite the use of HTML5 · w3c/svgwg@bda84ee]]
([TIME[2015-09-02 11:23:12 +09:00]] 版)
<https://github.com/w3c/svgwg/commit/bda84ee3ce02bdf810a7feeecd9f31f5634e39b9>
[69] [CITE@en[Remove <iframe seamless> · whatwg/html@1490eba]]
([TIME[2016-02-04 19:23:16 +09:00]] 版)
<https://github.com/whatwg/html/commit/1490eba4dba5ab476f0981443a86c01acae01311>
[70] [CITE@en[security/third-party-content at master · craigfrancis/security]]
([TIME[2016-03-12 12:44:17 +09:00]] 版)
<https://github.com/craigfrancis/security/tree/master/third-party-content>
[73] [CITE@en[Integrate with the Referrer Policy spec, part 1 of n]]
( ([[domenic]]著, [TIME[2016-05-05 23:01:42 +09:00]]))
<https://github.com/whatwg/html/commit/6a7318072f340ad45229df171245d70d8621c2fe>
[74] [CITE@en[Lower loading priority of cross-origin iframes · Issue #1 · WICG/interventions]]
( ([TIME[2016-06-15 16:10:58 +09:00]]))
<https://github.com/WICG/interventions/issues/1>
[87] [CITE@en[Remove HTML iframe ancestor check]]
([[annevk]]著, [TIME[2016-07-20 14:15:33 +09:00]])
<https://github.com/whatwg/fullscreen/commit/9592913bbeca3a9d029274f310eb27ad8003622c>
[88] [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>
[101] [CITE@en[Integrate referrerpolicy for a, area, iframe, and link elements]]
([[estark37]]著, [TIME[2016-08-12 06:42:26 +09:00]])
<https://github.com/whatwg/html/commit/2e955e66ae7f815efe09ccac6445cfbdcbf643ab>
[102] [CITE@en[Use HTML's new "allowed to use" algorithm]]
([[foolip]]著, [TIME[2016-08-12 18:41:17 +09:00]])
<https://github.com/whatwg/fullscreen/commit/42f9d159f948865ac415f0ac6243ee0e0a5d2c1a>
[103] [CITE@en[Editorial: say "top-level browsing context" in "allowed to use"]]
([[foolip]]著, [TIME[2016-09-11 15:02:12 +09:00]])
<https://github.com/whatwg/html/commit/ac1a524fa70d39364134aca70a654c4d92fdfbe0>
[104] [CITE@en[Remove redundant recursive step of fullscreen element ready check (#52)]]
([[foolip]]著, [TIME[2016-09-15 23:30:40 +09:00]])
<https://github.com/whatwg/fullscreen/commit/484ca40c65fc45ab9196336090918a956554191d>
[105] [CITE@en[Require <iframe> to be empty]]
([[sideshowbarker]]著, [TIME[2016-11-19 02:10:13 +09:00]])
<https://github.com/whatwg/html/commit/0cd77b7473600a51f0d882d20ed02ebbad4bf9be>
[106] [CITE@en[Add an active document check in "allowed to use"]]
([[zcorpan]]著, [TIME[2016-12-09 23:00:14 +09:00]])
<https://github.com/whatwg/html/commit/4f667ffddf192cb366cd3acadeca6f174e3c1328>
[109] [CITE@en[Snapshot allowpaymentrequest and allowusermedia attributes]]
([[zcorpan]]著, [TIME[2017-01-15 01:54:58 +09:00]])
<https://github.com/whatwg/html/commit/b3224a8457e32015153ed91f26b6212e25df1d6b>
[122] [CITE@en[Snapshot allowfullscreen/allowusermedia/allowpaymentrequest by zcorpan · Pull Request #2187 · whatwg/html]]
([TIME[2017-01-20 17:44:02 +09:00]])
<https://github.com/whatwg/html/pull/2187>
[123] [CITE@en[Allow PaymentRequest and getUserMedia for same origin-domain subdocum…]]
([[zcorpan]]著, [TIME[2017-01-26 02:36:45 +09:00]])
<https://github.com/whatwg/html/commit/ffae69861afaff9ca1c1f058f1d7af95412f60fa>
[128] [CITE@en[Changes to DOM - NW.js Documentation]]
([TIME[2017-03-15 15:09:12 +09:00]])
<http://docs.nwjs.io/en/latest/References/Changes%20to%20DOM/>
[129] [CITE@en[Regression fix: run iframe load event steps immediately]]
([[annevk]]著, [TIME[2018-01-16 19:23:55 +09:00]])
<https://github.com/whatwg/html/commit/3784c5375a36e19373982984ff761b491125a5da>
[130] [CITE@en["iframe load event steps" are run in parallel, but that seems really bad · Issue #3357 · whatwg/html]]
([TIME[2018-01-18 15:49:31 +09:00]])
<https://github.com/whatwg/html/issues/3357>
[131] [CITE@en[Regression fix: run iframe load event steps immediately by annevk · Pull Request #3359 · whatwg/html]]
([TIME[2018-01-18 15:50:27 +09:00]])
<https://github.com/whatwg/html/pull/3359>
[132] [CITE@en[Make <frame> fire load synchronously with "completely loaded"]]
([[annevk]]著, [TIME[2018-02-22 20:11:33 +09:00]])
<https://github.com/whatwg/html/commit/16de123059bd4b3660677fb4fdc03e2053815482>
[133] [CITE@en[frame and iframe have different load-event-firing behaviors · Issue #3492 · whatwg/html]]
([TIME[2018-02-24 19:33:27 +09:00]])
<https://github.com/whatwg/html/issues/3492>
[134] [CITE@en[Make <frame> fire load synchronously with "completely loaded" by annevk · Pull Request #3495 · whatwg/html]]
([TIME[2018-02-24 19:33:50 +09:00]])
<https://github.com/whatwg/html/pull/3495>