-
Notifications
You must be signed in to change notification settings - Fork 4
/
933.txt
763 lines (564 loc) · 32.4 KB
/
933.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
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
[132] 本項では[[文書]]の題名を表す [CODE(HTMLe)@en[[[title]]]] [[要素]]について紹介します。
* 仕様書
[REFS[
- [42] '''[CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-11-04 19:30:07 +09:00]] 版) <https://html.spec.whatwg.org/#the-title-element>'''
- [43] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-11-04 19:30:07 +09:00]] 版) <https://html.spec.whatwg.org/#the-title-element-2>
- [127] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2013-01-09 20:25:47 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#document.title>
]REFS]
* [CODE(HTMLe)[title]] 要素
[96] [CODE(HTMLe)[title]] 要素の内容には、
文書の題を入れます。''すべての HTML 文書で''
[CODE(HTMLe)[title]] 要素は''必須''です。
[87] 仕様書:
- [[HTML 2.0]]: [[RFC 1866]]
-- [CSECTION[5.2.1. Title: [CODE(HTMLe)[TITLE]]]]
- [[HTML 4]]
-- <IW:HTML4:"struct/global.html#edef-TITLE">
[92]
:[[名前空間名]]:[CODE(URI)[[[http://www.w3.org/1999/xhtml]]]]
:[[局所名]]:[CODE(HTMLe)[[[title]]]]
:[[開始タグ]]:必須
:[[終了タグ]]:必須
:[[内容模型]]:[CODE(SGML)[(#[[PCDATA]])*]]
:出現できる文脈:[CODE(HTMLe)[[[head]]]] の[[子要素]]として丁度1個
:[[属性]]:
,[CODE(HTMLa)[[[dir]]]] , , ,[[書字方向]] ,"[HTML4], [XHTML1]"
,[CODE(HTMLa)@en[[[i18n-content]]]],,,[[Chrome]]
,[CODE(HTMLa)[[[lang]]]] ,[[言語札]] ,(継承) ,[[自然言語]] ,"[HTML4], [XHTML1]"
,[CODE(HTMLa)[[[xml]]:lang]] ,言語札 ,(継承) ,自然言語 ,[XHTML1]
[[#comment]]
** 内容
*** 構文
[93] この要素の内容は [CODE(SGML)[[[PCDATA]]]]
として定義されていますが、
[[文字参照]]は使用してもよい一方で[[注釈宣言]]は禁止されています [SRC[HTML 4]]。
[WEAK[(適合 [[SGML応用]]でこんなのありですか?)]]
[90] 内容模型を [[HTML-CDATA]] として扱う実装が古くから多々あります。
たとえば [SAMP(HTML)[<title>HTML の <b> と <i> について</title>]]
の内容は文字列 [Q[HTML の <b> と <i> について]]
と扱われたりします。
[89]
[CODE(SGML)[[[RCDATA]]]] として扱う実装もありますね。
[[#comment]]
*** 題名の付け方
[95] [[著者]]は、文書の内容を識別するのに
[CODE(HTMLe)[title]] 要素を使うべきです。
[[利用者]]が文脈外から参照することもありますから、
文脈がはっきりする題を使うべきです [SRC[HTML 2.0, HTML 4]]。
例えば、[CITE[紹介]]ではなく[CITE[HTML 4 の紹介]]
とするべきです。
[88]
>>16 のように [CODE(HTMLe)[title]] 要素の内容は種々の場面に利用されるのですが、
古くは、ウィンドウ・システムの制限で title bar
に[[日本語文字]]が表示できないとか、
[[栞]]の名前の既定値として使われるけどその部分の font
が欧文用で日本語文字が表示できないとか、
不都合が色々と出る環境がありました (今でもあるのか?)。
そのために、本文は仮名や漢字で書いても [CODE(HTMLe)[title]]
だけは羅馬字で書いたり英語で書いたりする人が少なくありませんでしたし、
そうするべきだと積極的に主張する人もいました (メイルの
[Q[[CODE(822)[[[Subject]]]] は英語]]論
[WEAK[(欧米人でも最低題名で内容が想像くらいはつくように英語にしろという主張。)]]
とも絡んでいたのかも)。
[91] 昔 [CODE(MIME)[[[text/html]]]] な[[本体部分]]を含んだ[[電子メイル]]を送る
(プログラムを書く) 必要がありまして、その時に必須の [CODE(HTMLe)[title]]
要素は邪魔だなあと思いました。上位プロトコルに [CODE(822)[[[Subject]]]]
欄があるのに。
[WEAK[[CODE(HTMLe)[[[body]]]] を[[根要素]]にすればよかったかも。ただし、それを [CODE(MIME)[text/html]] としてもよいのかという問題 ([CODE(MIME)[[[text/sgml]]]]?) と、そもそも subject と title が同じものかという問題がありますが。]]
[40] 環境によっては題名に十分な長さが取れないので、
64文字未満に抑えるべきであるとされていた時代もありました。 [SRC[HTML 2.0]]
[66]
[CITE@ja[title要素に含めるサイト名は前置か後置か]] ([CODE[2007-01-08 16:21:48 +09:00]] 版) <http://su.que.jp/eskizy/index.cgi?title%cd%d7%c1%c7%a4%cb%b4%de%a4%e1%a4%eb%a5%b5%a5%a4%a5%c8%cc%be%a4%cf%c1%b0%c3%d6%a4%ab%b8%e5%c3%d6%a4%ab>
([[名無しさん]])
[[#comment]]
** 応用
[85]
[[access可能性]]のために、 [[UA]] は
[CODE(HTMLe)[title]] 要素の情報を利用者に提供しなければなりません。
たとえ[[枠]]の中の文書として[[レンダリング]]される場合であってもです。
[SRC[HTML 4]]]
[16] [CODE(HTMLe)[title]] 要素の主たる利用例:
- [[WWWブラウザ]]窓の題 (の一部または全部) として使用
[SRC[HTML 2.0, [[NN]], [[IE]]]]
- WWW ブラウザの上部または下部または右端または左端に表示
[SRC[[[NCSA Mosaic]]]]
- 文書を局所ファイル・システムに保存する時の[[ファイル名]]の既定値として使用
[SRC[[[WinIE]]]]
- 文書の情報を表示する時に一情報として表示
[SRC[[[NN]], [[WinIE]]]]
- [[栞]]の札の既定値として使用 [SRC[[[NN]], [[WinIE]]]]
- (後から読んだ) 他の文書からの参照があるときに、
その[[始点アンカー]]の [[tooltip]] などとして利用者に提供
- HTML 文書群から自動的に目次を生成するときに項目名として使用
[SRC[[[Apache]]]]
- 履歴の項目名として表示 [SRC[HTML 2.0, NN, WinIE]]
[50] [[Windows]] では伝統的に[[窓]]の題名は
[SAMP[[VAR[応用名]] - [VAR[ファイル名]]]]や[SAMP[[VAR[応用名]] - '''['''[VAR[ファイル名]]''']''']]
[WEAK[([[MDI]] の場合。)]] としてきました。最初
[[WWWブラウザ]]もこの慣習に従って[SAMP[[VAR[応用名]] - [VAR[題名]]]]などとしてきましたが、
[[WinIE 3]] [WEAK[(たしか。)]] や [[Netscape Communicator]] 4
の頃[SAMP[[VAR[題名]] - [VAR[応用名]]]]とするようになりました。
その後 [[WWWブラウザ]]以外でもこの方法を採る[[プログラム]]が増えています。
[150]
[CITE@en[wakaba/perl-www-titlecompactor: WWW::TitleCompactor Perl modules]], [TIME[2023-04-17T12:59:56.000Z]] <https://github.com/wakaba/perl-www-titlecompactor>
** 歴史
[86] [CODE(HTMLe)[title]] 要素型は、 HTML
の一番最初から存在する要素型のうちの1つです。
HTML の SGML 的構造が整う以前には、
HTML 文書の最初には題名を書いて [CODE(HTMLe)[title]]
タグで囲むものである程度に捉えられていました。
後に文章本体として表示されるわけではない [CODE(HTMLe)[title]]
要素は他の [CODE(HTMLe)[[[nextid]]]] 要素などと共に
[CODE(HTMLe)[[[head]]]] 要素に入れることとされました。
以後、 [CODE(HTMLe)[title]] は HTML の必須の要素として現在に続いています。
[39] [[内容]]として値を記述するのに本文として表示されない唯一の要素として古来特殊な存在であったため、
内容の扱いにかかわる >>17- のような特別な事情が残っています。
[[#comment]]
** メモ
[41]
HTML 4 DTD の[[注釈]] (参考) には
[Q[The TITLE element is not considered part of the flow of text. It should be displayed, for example as the page header or window title. Exactly one title is required per document.]]
とあります。
([[名無しさん]] [sage])
[56]
[CITE[極端に長いページタイトルに起因する起動時の一時的な不応答について]] <http://www.mozilla-japan.org/security/history-title.html>
([[名無しさん]] [WEAK[2005-12-13 10:33:36 +00:00]])
[68]
[CITE[Bug 118704 – document.title != getElementsByTagName('title')'''['''0''']'''.text]] ([CODE[2007-02-10 13:45:40 +09:00]] 版) <https://bugzilla.mozilla.org/show_bug.cgi?id=118704>
([[名無しさん]])
[71]
[CITE@ja[titleを表示 - 徒書]] ([[北村曉 (KITAMURA Akatsuki)]] 著, [CODE[2006-12-12 10:40:26 +09:00]] 版) <http://www.akatsukinishisu.net/itazuragaki/id/display_title>
([[名無しさん]])
[73]
[CITE@ja[hxxk.jp - title 要素に文字参照は使用できるのか ?]] ([[真琴]] 著, [CODE[2007-04-05 00:52:48 +09:00]] 版) <http://hxxk.jp/2006/01/25/2301>
([[名無しさん]])
[76]
[CITE[HDMI :: Manufacturer]] ([CODE[2007-07-22 14:04:40 +09:00]] 版) <http://www.hdmi.org/manufacturer/index.aspx>
>
[PRE(HTML illegal example code)[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title="HDMI" />
<meta http-equiv="cache-control" content="no-cache" /><meta name="keywords" content="HDMI, HDTV, HDMI connectors, HDMI adopters, High Definition Multimedia Interface" /><link href="../include/style.css" rel="stylesheet" type="text/css" /><title>
HDMI :: Manufacturer
</title></head>
]PRE]
なにがしたかったのだろう?
([[名無しさん]])
[77]
[CITE[見出しと木構造:メモランダム]] ([CODE[2007-07-16 02:55:31 +09:00]] 版) <http://mynotes.jp/blog/2007/07/headings_and_tree_structure>
([[名無しさん]])
[78]
[CITE[HTML 4.01において、以下のような見出し要素の使い方は適切と言えるでしょうか。 <h1>Operaの導入とカスタマイズ</h1> <h2>Movable Typeのプラグインについて</h2> <h3>は.. - 人力検索はてな]] ([CODE[2007-07-28 13:01:55 +09:00]] 版) <http://q.hatena.ne.jp/1184497584>
([[名無しさん]])
[79]
[CITE[見出し要素に関する議論をはてなにポストした:メモランダム]] ([CODE[2007-07-17 14:54:43 +09:00]] 版) <http://mynotes.jp/blog/2007/07/post_discussion_about_heading_element>
([[名無しさん]])
[80]
[CITE[h1要素が一つしかない場合:メモランダム]] ([CODE[2007-07-20 09:34:22 +09:00]] 版) <http://mynotes.jp/blog/2007/07/when_h1_is_the_only_one>
([[名無しさん]])
[81]
[CITE[見出し要素について今さら:メモランダム]] ([CODE[2007-08-18 16:40:50 +09:00]] 版) <http://mynotes.jp/blog/2007/08/post_14>
([[名無しさん]])
[82]
[CITE[ここにタイトルをいれてください - Google 検索]] ([CODE[2007-10-06 19:21:36 +09:00]] 版) <IW:Google:"ここにタイトルをいれてください">
> ここにタイトルをいれてください の検索結果 約 1,550 件中 1 - 10 件目 (0.15 秒)
([[名無しさん]] [WEAK[2007-10-06 10:26:52 +00:00]])
[83]
>>82 [CODE(HTMLa)@en[[[title]]]] [[属性]]の例もあるみたいですね。。。
([[名無しさん]])
[84]
[CITE[見出し要素について今さら:メモランダム]] ([TIME[2007-08-25 16:26:38 +09:00]] 版) <http://mynotes.jp/blog/2007/08/post_14>
([[名無しさん]])
* [CODE(XMLe)@en[atom:title]] 要素 (Atom 1.0)
[105] [DFN[[CODE(XMLe)@en[[[atom:title]]]] [[要素]]]]は、[[フィード]]や[[エントリー]]の[[人間可読]]な[[題名]]を表します
[SRC[[[RFC 4287]] 4.2.14.]]。
[26]
:状態:[[IETF]] [[提案標準]]
:[[要素名]]:[CODE(XMLe)@en[[[title]]]]
(「[RUBYB[[[題名]]]@en[title]]」より)
:文脈:
[CODE(XMLe)@en[[[atom:feed]]]] の[[子要素]]として、
[CODE(XMLe)@en[[[atom:entry]]]] の[[子要素]]として、
[CODE(XMLe)@en[app:[[workspace]]]] の[[子要素]]として、
[CODE(XMLe)@en[app:[[collection]]]] の[[子要素]]として
:[[内容モデル]]:[[Text construct]]
:[[属性]]:[CODE(XMLa)@en[[[type]]]]
** 仕様書
-[35] [CITE@en[RFC 4287 - The Atom Syndication Format]]
--<http://tools.ietf.org/html/rfc4287#section-4.1.1>
--<http://tools.ietf.org/html/rfc4287#section-4.1.2>
--'''<http://tools.ietf.org/html/rfc4287#section-4.2.14>'''
-[25] [CITE@en[RFC 5023 - The Atom Publishing Protocol]]
--<http://tools.ietf.org/html/rfc5023#section-8.3.2.1>
--<http://tools.ietf.org/html/rfc5023#section-8.3.3.2>
** 意味
[24] [[AtomPub]] [CODE(XMLe)@en[atom:[[workspace]]]] [[要素]]の[[子要素]]としての
[CODE(XMLe)@en[atom:[[title]]]] [[要素]]は、[[作業空間]]の[[人間可読]]な[[題名]]を表します
[SRC@en[[[AtomPub]]]]。
[28] [[AtomPub]] [CODE(XMLe)@en[atom:[[collection]]]] [[要素]]の[[子要素]]としての
[CODE(XMLe)@en[atom:[[title]]]] [[要素]]は、[[集成]]の[[人間可読]]な[[題名]]を表します
[SRC@en[[[AtomPub]]]]。
** 文脈
[36] [CODE(XMLe)@en[[[atom:feed]]]] [[要素]]は丁度1つ
[CODE(XMLe)@en[[[atom:title]]]] [[要素]]を含まなければ[['''なりません''']]
[SRC@en[[[Atom 1.0]] 4.1.1.]]。
[38] [CODE(XMLe)@en[[[atom:entry]]]] [[要素]]は丁度1つ
[CODE(XMLe)@en[[[atom:title]]]] [[要素]]を含まなければ[['''なりません''']]
[SRC@en[[[Atom 1.0]] 4.1.2.]]。
[27] [CODE(XMLe)@en[app:[[workspace]]]] [[要素]]は丁度1つ
[CODE(XMLe)@en[atom:[[title]]]] [[要素]]を含まなければ[['''なりません''']]
[SRC@en[[[AtomPub]]]]。
[29]
[CODE(XMLe)@en[app:[[collection]]]] [[要素]]は丁度1つ
[CODE(XMLe)@en[atom:[[title]]]] [[要素]]を含まなければ[['''なりません''']]
[SRC@en[[[AtomPub]]]]。
[37] [CODE(XMLe)@en[[[atom:entry]]]] [[要素]]には[[空]]でない
[CODE(XMLe)@en[[[atom:title]]]] [[要素]]を含めた方が経験的に有用でよいとされています
[SRC@en[[[Atom 1.0]] 4.1.1.1.]]。
** 内容
[106] この[[要素]]は [[Text construct]] です [SRC[[[RFC 4287]] 4.2.14.]]。
* [CODE(XMLe)@en[title]] 要素 (RSS2)
[1] [[RSS]] の [CODE(XMLe)@en[[[title]]]] [[チャンネル要素]]は、
[[チャンネル]]の名前を示します [SRC@en[[[RSS 2.0]]]]。また、
[CODE(XMLe)@en[[[item]]]] [[要素]]の[[子要素]]の
[DFN[[CODE(XMLe)@en[[[title]]]] [[要素]]]]は、[[項目]]の[[題名]]を表します。
[CODE(XMLe)@en[[[image]]]] [[要素]]の[[子要素]]の
[DFN[[CODE(XMLe)@en[[[title]]]] [[要素]]]]は、
[[画像]]を説明するものです。
[CODE(XMLe)@en[[[textInput]]]] [[要素]]の[[子要素]]の
[DFN[[CODE(XMLe)@en[[[title]]]] [[要素]]]]は、[[テキスト入力欄]]の[[提出ボタン]]の[[名札]]を表します
[SRC@en[[[RSS 2.0]]]]。
:[[要素名]]:[CODE(XMLe)@en[[[title]]]] ([[title]] ([[題名]]) より)
:文脈:[[チャンネル要素]]が認められる場所 (必須)、
[CODE(XMLe)@en[[[item]]]] [[要素]]の
[[子要素]]として、[CODE(XMLe)@en[[[image]]]] [[要素]]の[[子要素]]として、
[CODE(XMLe)@en[[[textInput]]]] [[要素]]の[[子要素]]として
:[[内容モデル]]:[[文字データ]]
:[[属性]]:
仕様書:
-[CITE@en[RSS 2.0 Specification (version 2.0.10)]]
--<http://www.rssboard.org/rss-specification#requiredChannelElements>
--<http://www.rssboard.org/rss-specification#hrelementsOfLtitemgt>
--<http://www.rssboard.org/rss-specification#ltimagegtSubelementOfLtchannelgt>
--<http://www.rssboard.org/rss-specification#lttextinputgtSubelementOfLtchannelgt>
-[CITE@en[RSS Best Practices Profile]]
--<http://www.rssboard.org/rss-profile#data-types-characterdata>
--<http://www.rssboard.org/rss-profile#element-channel-title>
--<http://www.rssboard.org/rss-profile#element-channel-image-title>
--<http://www.rssboard.org/rss-profile#element-channel-textinput-title>
--<http://www.rssboard.org/rss-profile#element-channel-item-title>
** 内容
[3] [[RSS]] [[ファイル]]と同じ情報を含んだ [[Webサイト]]がある場合、
その[[題名]]と[[チャンネル]]の[[題名]] ([CODE(XMLe)@en[[[title]]]]) は一致する[['''べきです''']]
[SRC@en[[[RSS 2.0]], [[RSS Best Practices Profile]]]]。
[9] 内容は[[平文]]として解釈されます。
(歴史的に [[HTML]] として解釈する実装や [[HTML]] として解釈されることを期待した[[フィード]]もありますが、
[[RSS Best Practices Profile]] に従えばそれらは誤りです。)
詳しくは[[文字データ]]の項を参照してください。
[17] [CODE(XMLe)@en[[[image]]]] [[要素]]の[[子要素]]の場合、
[[チャンネル]]の [CODE(XMLe)@en[[[title]]]] [[要素]]と同じ[[テキスト]]である[['''べきです''']]
[SRC@en[[[RSS Best Practices Profile]]]]。
[18] [CODE(XMLe)@en[[[image]]]] [[要素]]の[[子要素]]の場合、
[[HTML]] [[レンダリング]]において [CODE(HTMLe)@en[[[img]]]] の
[CODE(HTMLa)@en[[[alt]]]] [[属性値]]として使うのに適当な値である[['''べきです''']]
[SRC@en[[[RSS Best Practices Profile]]]]。
[19] [CODE(XMLe)@en[[[textInput]]]] [[要素]]の[[子要素]]の場合も[[文字データ]]だと思うのですが、
明記されていません。
** 文脈
[4] [CODE(XMLe)@en[[[title]]]] [[要素]]は
[CODE(XMLe)@en[[[channel]]]] [[要素]]の[[子供]]として使うことができます。
この[[要素]]は必須です [SRC@en[[[RSS 2.0]]]]。
[5] [CODE(XMLe)@en[[[title]]]] [[要素]]は
[CODE(XMLe)@en[[[item]]]] [[要素]]の[[子供]]としても使うことができます。
[CODE(XMLe)@en[[[item]]]] [[要素]]は
[CODE(XMLe)@en[[[title]]]] [[要素]]と
[CODE(XMLe)@en[[[description]]]] [[要素]]の少なくてもいずれかはなければなりません。
[7] [CODE(XMLe)@en[[[title]]]] [[要素]]は
[CODE(XMLe)@en[[[image]]]] [[要素]]の[[子供]]として使うことができます。
この[[要素]]は必須です [SRC@en[[[RSS 2.0]]]]。
[8] [CODE(XMLe)@en[[[title]]]] [[要素]]は
[CODE(XMLe)@en[[[textInput]]]] [[要素]]の[[子供]]として使うことができます。
この[[要素]]は必須です [SRC@en[[[RSS 2.0]]]]。
** 例
[2]
[PRE(XML example code)[
<title>GoUpstate.com News Headlines</title>
]PRE]
;; [[RSS 2.0]] 仕様書より、改
[6]
[PRE(XML example code)[
<title>Venice Film Festival Tries to Quit Sinking</title>
]PRE]
;; [[RSS 2.0]] 仕様書より、改
[10]
[PRE(XML example code)[
<title>AT&T</title>
]PRE]
;; [[RSS Best Practices Profile]] より
[11]
[PRE(XML example code)[
<title>Bill & Ted's Excellent Adventure</title>
]PRE]
;; [[RSS Best Practices Profile]] より
[12]
[PRE(XML example code)[
<title>The &amp; entity</title>
]PRE]
;; [[RSS Best Practices Profile]] より
[13]
[PRE(XML example code)[
<title>I <3 Phil Ringnalda</title>
]PRE]
;; [[RSS Best Practices Profile]] より
[14]
[PRE(XML example code)[
<title>A < B</title>
]PRE]
;; [[RSS Best Practices Profile]] より
[15]
[PRE(XML example code)[
<title>A<B</title>
]PRE]
;; [[RSS Best Practices Profile]] より
[94]
[PRE(XML example code)[
<title>Nice <gorilla> what's he weigh?</title>
]PRE]
;; [[RSS Best Practices Profile]] より
* [CODE(XMLe)@en[atom:title]] 要素 (Atom 0.3)
[20] [[Atom 0.3]] の [DFN[[CODE(XMLe)@en[atom:[[title]]]] [[要素]]]]は、
[[フィード]]や[[エントリー]]の[[人間可読]]な[[題名]]を表します [SRC@en[[[Atom 0.3]]]]。
:状態:[[廃止]] → [[Atom 1.0]] [CODE(XMLe)@en[atom:[[title]]]]
:[[局所名]]:[CODE(XMLe)@en[[[title]]]]
:状態:[CODE(XMLe)@en[atom:[[feed]]]] や
[CODE(XMLe)@en[atom:[[entry]]]] の[[子要素]]として
:[[内容モデル]]:[[Content construct]]
:[[属性]]:
[CODE(XMLa)@en[[[mode]]]], [CODE(XMLa)@en[[[type]]]]
仕様書:
-[CITE[The Atom Syndication Format 0.3 (PRE-DRAFT)]]
-- <http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html#rfc.section.4.3>
-- <http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html#rfc.section.4.13.1>
** 文脈
[21] [CODE(XMLe)@en[atom:[[feed]]]] [[要素]]や
[CODE(XMLe)@en[atom:[[entry]]]] は丁度1つ
[CODE(XMLe)@en[atom:[[title]]]] [[要素]]を含まなければ[['''なりません''']]
[SRC@en[[[Atom 0.3]]]]。
** 内容
[22] この[[要素]]は [[Content construct]] です [SRC@en[[[Atom 0.3]]]]。
[23] [[フィード]]や[[エントリー]]が [[Web資源]]を説明する場合、
[CODE(XMLe)@en[atom:[[title]]]] [[要素]]の[[内容]]はその[[資源]]の[[題名]]と同じである[['''べきです''']]
[SRC@en[[[Atom 0.3]]]]。
* [CODE(XMLe)@en[title]] 要素 (RSS1)
[107] [[RSS 1.0]] の [CODE(XMLe)@en[[[channel]]]] [[要素]]の[[子要素]]の
[DFN[[CODE(XMLe)@en[[[title]]]] [[要素]]]]は、[[チャンネル]]の[RUBYB[説明的題名]@en[descriptive title]]を表します
[SRC[>>108]]。
[115] [[RSS 1.0]] の [CODE(XMLe)@en[[[image]]]] [[要素]]の[[子要素]]の
[DFN[[CODE(XMLe)@en[[[title]]]] [[要素]]]]は、[[チャンネル]]の[[画像]]が [[HTML]]
として[[レンダリング]]される際の[[代替文]] ([CODE(HTMLa)@en[[[alt]]]]) を表します
[SRC[>>113]]。
[120] [[RSS 1.0]] の [CODE(XMLe)@en[[[item]]]] [[要素]]の[[子要素]]の
[DFN[[CODE(XMLe)@en[[[title]]]] [[要素]]]]は、項目の[[題名]]を表します
[SRC[>>119]]。
[123] [[RSS 1.0]] の [CODE(XMLe)@en[[[textinput]]]] [[要素]]の[[子要素]]の
[DFN[[CODE(XMLe)@en[[[title]]]] [[要素]]]]は、textinput 欄の[[題名]]を表します
[SRC[>>122]]。
[112]
:要素名:[CODE(XMLe)@en[[[title]]]] (「[RUBYB[[[題名]]]@en[[[title]]]]」より)
:文脈:[CODE(XMLe)@en[[[channel]]]] [[要素]]、
[CODE(XMLe)@en[[[image]]]] [[要素]]の[[子供]]として (>>109)
:内容モデル:[[文字列]] (>>110)
:属性:なし
** 仕様書
- [114] [CITE[RDF Site Summary (RSS) 1.0]] ([TIME[2008-06-10 05:47:42 +09:00]] 版)
-- [108] [CODE(XMLe)@en[[[channel]]]] <http://web.resource.org/rss/1.0/spec#s5.3.1>
-- [113] [CODE(XMLe)@en[[[image]]]] <http://web.resource.org/rss/1.0/spec#s5.4.1>
-- [119] [CODE(XMLe)@en[[[item]]]] <http://web.resource.org/rss/1.0/spec#s5.5.1>
-- [122] [CODE(XMLe)@en[[[textinput]]]] <http://web.resource.org/rss/1.0/spec#s5.6.1>
** 文脈
[109] [CODE(XMLe)@en[[[channel]]]] [[要素]]の[[子要素]]としてちょうど1個だけ使えます
[SRC[>>108 5.3]]。
[116] [CODE(XMLe)@en[[[image]]]] [[要素]]の[[子要素]]としてちょうど1個だけ使えます
[SRC[>>113 5.4]]。
[121] [CODE(XMLe)@en[[[item]]]] [[要素]]の[[子要素]]としてちょうど1個だけ使えます
[SRC[>>119 5.5]]。
[121] [CODE(XMLe)@en[[[textinput]]]] [[要素]]の[[子要素]]としてちょうど1個だけ使えます
[SRC[>>122 5.6]]。
** 内容
[110] この[[要素]]の[[内容]]は [CODE(XML)@en[[[PCDATA]]]] です。
[CODE(XMLe)@en[[[item]]]] [[要素]]では100文字以下、それ以外では
40文字以下とするのがよいと[RUBYB[提案]@en[suggested]]されています。 [SRC[>>108, >>113, >>119, >>122]]
[111] [CODE(XMLe)@en[[[channel]]]] [[要素]]、
[CODE(XMLe)@en[[[item]]]] [[要素]]においては実装によっては [[HTML]]
として取り扱うものがありますが、 [[RSS 1.0]]
本体仕様で [[HTML]] を使えると明示的にも暗示的にも触れている箇所はなく、
[[平文]]と解釈するべきだと考えられます。
[117] [CODE(XMLe)@en[[[image]]]] [[要素]]においてはわざわざ「[CODE(HTMLa)@en[[[alt]]]]
[[属性]]」に相当すると書かれている以上、[[平文]]と考えて間違いないでしょう。
** 例
[124] [SRC[>>122 をもとに作成]]
[PRE(XML example code)[
<textinput rdf:about="...">
...
<title>Subscribe</title>
</textinput>
]PRE]
[125] [SRC[>>122 をもとに作成]]
[PRE(XML example code)[
<textinput rdf:about="...">
<title>Search</title>
...
</textinput>
]PRE]
** メモ
[118] [CODE(XMLe)@en[[[image]]]] [[要素]]では [CODE(HTMLa)@en[[[title]]]] [[属性]]ではなく
[CODE(HTMLa)@en[[[alt]]]] [[属性]]に相当するのですね。
* [CODE(XMLe)@en[title]] 要素 (OPML)
[30] [[OPML]] の [DFN[[CODE(XMLe)@en[title]] [[要素]]]]は、
[[文書]]の[[題名]]を表します [SRC@en[[[OPML 1.0]]]]。
[31]
:[[局所名]]:[CODE(XMLe)@en[[[title]]]]
:文脈:[CODE(XMLe)@en[[[head]]]] の[[子要素]]として
:[[内容モデル]]:[[テキスト]]
:[[属性]]:
[32] 仕様書:
-[CITE[OPML 1.0 Specification]] ([TIME[2008-12-02 16:47:13 +09:00]] 版) <http://www.opml.org/spec#whatIsALtheadgt>
** 文脈
[33] この[[要素]]は [CODE(XMLe)@en[[[head]]]] [[要素]]の[[子要素]]として使うことができます
[SRC@en[[[OPML 1.0]]]]。
[34] この[[要素]]は [[HTML]] などとは異なり必須ではありません。
* [CODE(JS)@en[document.title]]
[97] [CODE(DOMi)@en[[[Document]]]] [[インターフェイス]]の
[DFN[[CODE(DOMa)@en[title]] [[属性]]]] ([CODE(JS)@en[[[document.title]]]])
は、[[文書]]の[[題名]]を表します。
[98] [CODE(JS)@en[document.title]] の[[取得器]]は、
次のようにしなければ[MUST[なりません]] [SRC[>>127]]。
[FIG(steps)[
= [46] [VAR[要素]]を、
[[文脈オブジェクト]]の[F[根要素]]が [[SVG]] [CODE(XMLe)@en[[[svg]]]]
[[要素]]ならその最初の [[SVG]] [CODE(XMLe)@en[[[title]]]] [[子要素]]、
それ以外なら[[文脈オブジェクト]]の[F[文書[CODE(HTMLe)@en[title]]要素]]に設定します。
= [47] [VAR[テキスト]]を、[VAR[要素]]が [[null]] なら[[空文字列]]に、
それ以外なら[VAR[要素]]の[F[子供テキスト内容]]に設定します。
= [48] [VAR[テキスト]]の先頭と末尾の[[間隔文字]]を除去し、
それ以外の連続する[[間隔文字]]を1つにまとめます。
= [49] [VAR[テキスト]]を返します。
]FIG]
;; [51] [[HTML Standard]] はなぜか [CODE(XMLe)@en[svg]]
[[要素]]が[[根要素]]で、[F[子供]]に [CODE(XMLe)@en[title]]
[[要素]]が含まれない場合の扱いを規定していません。
[44] [DFN[[RUBYB[文書[CODE(HTMLe)@en[title]]要素]@en[the [CODE(HTMLe)@en[title]] element]]]]は、
[[文書]]中の最初の [CODE(HTMLe)@en[[[title]]]] [[要素]] ([[木順]]) か、
それがなければ [[null]] です [SRC[>>43]]。
[136] [CODE(JS)@en[document.title]] の[[設定器]]は、
次のようにしなければ[MUST[なりません]] [SRC[>>127]]。
[FIG(steps)[
= [142] [VAR[値]]を、与えられた値を[[文字列]]として解釈した結果に設定します。
= [52] [[文脈オブジェクト]]の[F[根要素]]が [[SVG]] [CODE(XMLe)@en[svg]] [[要素]]なら、
== [53] [[文脈オブジェクト]]の[F[根要素]]の[F[子供群]]に
[[SVG]] [CODE(XMLe)@en[title]] [[要素]]があれば、
=== [54] [VAR[要素]]を、[[文脈オブジェクト]]の[F[根要素]]の最初の
[[SVG]] [CODE(XMLe)@en[title]] [[子要素]]に設定します。
== [55] それ以外なら、
=== [57] [VAR[要素]]を、新しい [[SVG]] [CODE(XMLe)@en[title]] [[要素]]に設定します。
=== [58] [[文脈オブジェクト]]の[F[根要素]]に[VAR[要素]]を最初の[[子供]]として挿入します。
= [59] それ以外で、[[文脈オブジェクト]]の[F[根要素]]が[[HTML要素]]なら、
== [60] [[文脈オブジェクト]]の[F[文書[CODE(HTMLe)@en[title]]要素]]が [[null]] なら、
=== [61] [[文脈オブジェクト]]の[F[文書[CODE(HTMLe)@en[head]]要素]]が [[null]] なら、
==== [62] ここで停止します。
=== [63] それ以外なら、
==== [64] [VAR[要素]]を、新しい [CODE(HTMLe)@en[title]] [[要素]]に設定します。
==== [67] [[文脈オブジェクト]]の[F[文書[CODE(HTMLe)@en[head]]要素]]に[VAR[要素]]を [[append]] します。
== [69] それ以外なら、
=== [70] [VAR[要素]]を、[[文脈オブジェクト]]の[F[文書[CODE(HTMLe)@en[title]]要素]]に設定します。
= [72] それ以外なら、
== [74] ここで停止します。
= [75] [VAR[要素]]の [CODE(DOMa)@en[textContent]] を、[VAR[値]]に設定します。
]FIG]
;; [137] 取得対象と設定対象の [CODE(HTMLe)@en[[[title]]]] [[要素]]の条件が微妙に違っています。
** 歴史
[134] はじめ [CODE(JS)@en[[[document.title]]]] は [CODE(DOMi)@en[[[HTMLDocument]]]]
[[インターフェイス]]に定義されていましたが、 [CODE(DOMi)@en[[[Document]]]]
[[インターフェイス]]との統合に伴い、 [CODE(DOMi)@en[[[Document]]]]
[[インターフェイス]]の[[属性]]となりました。
[REFS[
- [128] [CITE[Scalable Vector Graphics (SVG) 2]] ([TIME[2013-01-11 23:40:44 +09:00]] 版) <https://svgwg.org/svg2-draft/single-page.html#struct-__svg__SVGDocument__title>
- [133] [CITE@en[Web Applications 1.0 r8559 Define document.title in an SVG context since apparently that's gone out of SVG now.]] ([TIME[2014-04-02 03:58:00 +09:00]] 版) <http://html5.org/tools/web-apps-tracker?from=8558&to=8559>
]REFS]
[135] >>133 で [CODE(DOMi)@en[[[SVGDocument]]]] にあった定義も統合されました。
** 実装
[65]
[CITE[Hixie's Natural Log: The DOM0 Legacy: document.title]] <http://ln.hixie.ch/?start=1161121410&count=1>
([[名無しさん]] [WEAK[2006-10-17 22:44:44 +00:00]])
[146] [[Chrome]] は [CODE[U+0008]] も[[間隔文字]]として除去するようです。
[TIME[2017-03-18T03:11:47.400Z]]
** 利用例
[99] [[Gmail]] では、 [[Gtalk]] により[[メッセージ]]を受信した際、
その旨を通知する[[メッセージ]]と本来の[[文書]]の[[題名]]を交互に表示することで
[[Webブラウザー]]の[[タイトル・バー]]等による[[通知]]を実現しています。
* 広告を表す題名
[100] [[広告]]の [CODE@en[[[title]]]] の値は[[広告]]であることを表す記述が含まれていることがあります。
[103] なお、一口に「[[広告]]」といっても実態は様々で、 [[Webサイト]]や[[フィード]]と関連が低いものもあれば、
[[PR記事]]の類もあります。
** 例
-[101] [CODE(example)[PR: 今すぐ使える]]
-[102] [CODE(example)[[PR] 今すぐ使える]]
** 関連
[104] [[電子メイル]]における例は [CODE(822)@en[[[Subject:]]]] 欄の項をご覧ください。
* 関連
[149]
[CODE[dc:title]]
* 歴史
** HTML 以外
[148] [[DTB]]
*** [CODE(XMLe)@en[title]] 要素 (XFrames)
[126] [CITE@en[XFrames]] ([TIME[2010-12-17 00:45:08 +09:00]] 版) <http://www.w3.org/TR/2010/NOTE-xframes-20101216/#s_title-element>
*** [CODE[TITTLE]] 要素 (DjVu XML)
[273]
[[DjVu XML]]
には
[[HTML]]
の
[CODE[title]]
[[要素]]から派生した
[DFN[[CODE[TITLE]]]]
[[要素]]がありました。
** HTML
[129] [CITE@en[Web Applications 1.0 r8404 Update document.title to work like textContent (also defines how things work with mutation observers)]]
( ([TIME[2014-01-17 07:52:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8403&to=8404>
[130] [CITE[''''''[''''''whatwg'''''']'''''' Document.title for SVG documents]]
( ([TIME[2014-04-02 04:58:45 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-April/084609.html>
[131] [CITE[IRC logs: freenode / #whatwg / 20140401]]
( ([TIME[2014-04-02 23:03:41 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140401#l-713>
[138] [CITE@en[Citation Style Language 1.0.1]]
( ([TIME[2014-10-01 11:57:04 +09:00]] 版))
<http://citationstyles.org/downloads/specification.html#info>
[139] [CITE@en[Citation Style Language 1.0.1]]
( ([TIME[2014-10-01 11:57:04 +09:00]] 版))
<http://citationstyles.org/downloads/specification.html#info>
[140] [CITE@en[Citation Style Language 1.0.1]]
( ([TIME[2014-10-01 11:57:04 +09:00]] 版))
<http://citationstyles.org/downloads/specification.html#info>
[141] [CITE@en[Citation Style Language 1.0.1]]
( ([TIME[2014-10-01 11:57:04 +09:00]] 版))
<http://citationstyles.org/downloads/specification.html#info>
[45] [CITE@en[Refactor child Text nodes to a new concept · whatwg/html@0dd609f]]
([TIME[2016-03-10 21:06:55 +09:00]] 版)
<https://github.com/whatwg/html/commit/0dd609fddc08dab337d24da874c787e51e851efc>
[143] [CITE@en[Editorial: synchronize with the DOM Standard · whatwg/html@21c6ec7]]
([TIME[2016-03-20 18:00:39 +09:00]] 版)
<https://github.com/whatwg/html/commit/21c6ec77594eb89b836d4872222f5916910967fd>
[144] [CITE@en[Add MathML and SVG to dependencies and cross-reference their elements · whatwg/html@c35ad72]]
([TIME[2016-03-24 15:31:59 +09:00]] 版)
<https://github.com/whatwg/html/commit/c35ad7267634f640e8e22b615893b78d6252998e>
[145] [CITE@en[Formalize custom element reactions · whatwg/html@27aa7bc]]
([TIME[2016-04-26 18:51:16 +09:00]] 版)
<https://github.com/whatwg/html/commit/27aa7bc4fa6f168654a8c858f0773e611f679b39>
[147] [CITE@en[Stop using textContent in normative text]]
([[annevk]]著, [TIME[2019-04-04 17:23:13 +09:00]])
<https://github.com/whatwg/html/commit/ec860d872de3712277242655562a4d2a1325592a>