/
294.txt
564 lines (454 loc) · 26.9 KB
/
294.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
[66] [DFN[[RUBYB[要素]@en[element]]]]は、[[節点木]]上の構成要素 ([[節点]])
の一種です。[[要素]]には種別があり、[[要素名]]と[[名前空間名]]の組で表されます。
[67] [[要素]]は、[[HTML文書][HTML構文]]上は[[開始タグ]]と[[終了タグ]]とその間の部分によって表現されます。
* 仕様書
[REFS[
- [59] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-04-26 20:56:11 +09:00]] 版) <https://html.spec.whatwg.org/#element-type>
]REFS]
* 意味と名前
[40] [[要素]]は、固有の[F[意味]]を持ちます。
;; [[意味]]参照。
[60] [DFN[[RUBYB[要素型]@en[element type]]]]は、
特定の[F[局所名]]と[F[名前空間名]]を持つ[[要素]]の[[集合]]を指します [SRC[>>59]]。
[68] [[要素型]]は、[[要素]]の種別を表しています。[[要素]]の[F[意味]]は、
[[要素型]]ごとに規定されています。
[69] [[要素型]]は、曖昧でなければ[[局所名]]のみで表されます。
[[要素]]の[F[局所名]]のことを[F[要素名]]ともいいます。
[70] [[名前空間]] [VAR[n]] で[F[局所名]] [VAR[l]] の[[要素型]]の[[要素]]を、
「[RUBYB[[[名前空間]] [VAR[n]] の [VAR[l]] [[要素]]]@en[[VAR[l]] element(s) in [VAR[n]] namespace]]」
のようにいいます。曖昧でなければ単に
「[RUBYB[[VAR[l]] [[要素]]]@en[[VAR[l]] element(s)]]」といいます。
[EG[
[61] [CODE(HTMLe)@en[button]] [[要素]]は、[F[局所名]]が
[CODE(HTMLe)@en[button]]、[F[名前空間]]が [[HTML名前空間]]の[[要素型]]を持つ[[要素]]です
[SRC[>>59]]。
]EG]
[EG[
[71] [[HTML]] に関する文脈で、「[CODE(HTMLe)@en[p]] [[要素]]」
といえば、 [F[名前空間名]]が [[HTML名前空間]]で[F[局所名]]が
[CODE(HTMLe)@en[p]] の[[要素]]を指しています。
]EG]
* [CODE(DOMi)@en[Element]] インターフェイス (DOM)
[2] [CODE(DOMi)[Element]] 界面は、 [[HTML]]・[[XML]]
の[[要素]]のための機能を提供します。1つの [CODE(DOM)[Element]]
節が HTML/XML 文書の1つの要素に対応します。
* メンバー
[1] [[DOM1]] では、[RUBYB[要素節] [[CODE(DOM)[Element]] node]]は次の種類の[[節]]を子供に出来ます。
-[[Element]]
-[[Text]]
-[[Comment]]
-[[ProcessingInstruction]]
-[[CDATASection]]
-[[EntityReference]]
[3] [CODE(DOMi)[[[Node]]]] 界面を継承して、
[FIG(list)[
,[CODE(DOMa)@en[[[all]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[applyElement]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[attachEvent]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
- [CODE(DOMm)@en[attachShadow]]
,[CODE(DOMa)@en[[[behaviorUrns]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[blur]]]],"[CODE(DOMi)@en[[[HTMLControlElement]]]] 他 ([[Trident]]), [CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[canHaveChildren]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[clearAttributes]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[click]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[WinIE 4]])"
,[CODE(DOMa)@en[[[clientHeight]]]],"[CODE(DOMi)@en[[[HTMLControlElement]]]] 他 ([[Trident]]), [CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[clientLeft]]]],"[CODE(DOMi)@en[[[HTMLControlElement]]]] 他 ([[Trident]]), [CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[clientTop]]]],"[CODE(DOMi)@en[[[HTMLControlElement]]]] 他 ([[Trident]]), [CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[clientWidth]]]],"[CODE(DOMi)@en[[[HTMLControlElement]]]] 他 ([[Trident]]), [CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[componentFromPoint]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[contains]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[currentStyle]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[detachEvent]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[document]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[doScroll]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[dragDrop]]]],"[CODE(DOMi)@en[[[HTMLElement3]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[FireEvent]]]],"[CODE(DOMi)@en[[[HTMLElement3]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[focus]]]],"[CODE(DOMi)@en[[[HTMLControlElement]]]] 他 ([[Trident]]), [CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[getAdjacentText]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
- [CODE(DOMm)@en[[[getAttributeNames]]]]
,[CODE(DOMm)@en[[[getBoundingClientRects]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[getClientRects]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[getExpression]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[glyphMode]]]],"[CODE(DOMi)@en[[[HTMLElement3]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[hideFocus]]]],"[CODE(DOMi)@en[[[HTMLElement3]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[inflateBlock]]]],"[CODE(DOMi)@en[[[HTMLElement3]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[innerText]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[insertAdjacentElement]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[insertAdjacentText]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[isTextEdit]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[tagName]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[WinIE 4]]), [CODE(DOMi)@en[[[Element]]]] ([[DOM水準1中核]])"
,[CODE(DOMm)@en[[[getAttribute]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[WinIE 4]]), [CODE(DOMi)@en[[[Element]]]] ([[DOM水準1中核]])"
,method,[CODE(DOMm)[[[getAttributeNS]]]],属性値を取得 ,[DOM2]
,[CODE(DOMm)[[[setAttribute]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[WinIE 4]]), [CODE(DOMi)@en[[[Element]]]] ([[DOM水準1中核]])"
,method,[CODE(DOMm)[[[setAttributeNS]]]],属性を設定 ,[DOM2]
,[CODE(DOMm)[[[removeAttribute]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[WinIE 4]]), [CODE(DOMi)@en[[[Element]]]] ([[DOM水準1中核]])"
,method,[CODE(DOMm)[[[removeAttributeNS]]]],属性を削除 ,[DOM2]
,method,[CODE(DOMm)[[[hasAttribute]]]] ,属性の存在 ,[DOM2]
,method,[CODE(DOMm)[[[hasAttributeNS]]]],属性の存在 ,[DOM2]
,method,[CODE(DOMm)[[[getAttributeNode]]]],属性節を取得 ,[DOM1]
,method,[CODE(DOMm)[[[getAttributeNodeNS]]]],属性節を取得,[DOM2]
,method,[CODE(DOMm)[[[setAttributeNode]]]],属性節を設定 ,[DOM1]
,method,[CODE(DOMm)[[[setAttributeNodeNS]]]],属性節を設定,[DOM2]
,method,[CODE(DOMm)[[[removeAttributeNode]]]],属性節を削除,[DOM1]
,method,[CODE(DOMm)[[[removeAttributeNodeNS]]]],属性節を削除,[DOM2]
,method,[CODE(DOMm)[[[getElementsByTagName]]]],要素型名を指定して要素群を取得,[DOM1]
,method,[CODE(DOMm)[[[getElementsByTagNameNS]]]],要素型名を指定して要素群を取得,[DOM2]
,[CODE(DOMm)@en[[[mergeAttributes]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,method,[CODE(DOMm)[[[normalize]]]],子節を正規化,"[DOM1], [DOM1ERRATA]"
,[CODE(DOMa)@en[[[offsetLeft]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[offsetParent]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[offsetTop]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[offsetWidth]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[outerText]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[parentTextEdit]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[readyState]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[readyStateValue]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[recordNumber]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[releaseCapture]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[removeBehavior]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[removeExpression]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[replaceAdjacentText]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
- [CODE(DOMm)@en[requestPointerLock]]
,[CODE(DOMa)@en[[[runtimeStyle]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[scopeName]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[scrollHeight]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[scrollIntoView]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[scrollLeft]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[scrollTop]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[scrollWidth]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[setActive]]]],"[CODE(DOMi)@en[[[HTMLElement3]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[setCapture]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
,[CODE(DOMm)@en[[[setExpression]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
- [CODE(DOMa)@en[shadowRoot]]
- [CODE(DOMa)@en[slot]]
,[CODE(DOMa)@en[[[sourceIndex]]]],"[CODE(DOMi)@en[[[HTMLElement]]]] ([[Trident]])"
,[CODE(DOMa)@en[[[tagUrn]]]],"[CODE(DOMi)@en[[[HTMLElement2]]]] ([[Trident]])"
[HISTORY[
- [CODE(DOMa)@en[uiactions]]
- [CODE(DOMa)@en[uitrigger]]
]HISTORY]
]FIG]
* 状態
[43] [[要素]]は次の状態を持ちます。
[FIG(list members)[
:[[イベントループ]]:[[要素]]の[[節点文書]]の[[閲覧文脈]]の[[イベントループ]]。
:[[click in progress flag]]:
:[[assigned access key]]:
:[[対象]]:[[閲覧文脈]]の指定 ([[フォーム]]や[[提出ボタン]]のみ)。
:[F[[CODE(DOMa)@en[[[classList]]]]]]: [CODE(DOMa)@en[[[classList]]]]
[[IDL属性]]の値として使われる [CODE(DOMi)@en[[[DOMTokenList]]]] です。
: [F[子供テキスト内容]] : [F[子供]]である[[テキスト節点]]の[F[データ]]を連結したものです。
: [F[レンダリング中]] :
: [F[影根]] : 本[[要素]]が[[影ホスト]]なら[[影根]]、そうでなければ [[null]] です。
: [F[カスタム要素状態]] :
: [F[定義済み]] :
: [F[カスタム]] :
: [F[カスタム要素定義]] :
: [F[カスタム要素反応キュー]] :
: [F[[CODE[is]]値][is=""]] :
: [F[scrolling box]] :
: [F[scrolling area]] :
: [F[potentially scrollable]] :
]FIG]
[HISTORY[
[44] かつては次の状態もありました。
[FIG(list members)[
:[F[[[要素の基底URL]]]]: [[要素]]の[[節点文書]]の[[基底URL]]です。
]FIG]
]HISTORY]
[47] [[要素]]は、[[スロット可能]]で、[[スロット可能]]としての状態も持ちます。
* 要素のサブインターフェイス
[23] [[要素]]オブジェクトは、その[[名前空間URL]]と[[局所名]]から決まる[[インターフェイス]]
([DFN[[RUBYB[要素インターフェイス]@en[element interface]]]]) を実装することになっています。
;; [[要素の作成]]を参照。
[63] [[HTML要素]]は [CODE(DOMi)@en[HTMLElement]] またはそれを[[継承]]したもの、
[[SVG要素]]は [CODE(DOMi)@en[SVGElement]] またはそれを[[継承]]したものが[[要素インターフェイス]]となります。
いずれも、 [CODE(DOMi)@en[Element]] を[[継承]]しています。
;; それぞれの項を参照。
[62] それ以外の[[要素]]では、 [CODE(DOMi)@en[Element]] が[[要素インターフェイス]]です。 [SRC[>>33]]
;; [29] [[XSLT]] 等意味的に異なった解釈がなされる文脈の [[HTML要素]]でも同様に実装しなければならないとされており [SRC[>>28]]、
従ってどの[[インターフェイス]]を実装する必要があるかは[[要素]]の[[名前空間]]と[[局所名]]により機械的に定まります。
[37] [CODE(HTMLe)@en[[[embed]]]] [[要素]] ([CODE(DOMi)@en[[[HTMLEmbedElement]]]]),
[CODE(HTMLe)@en[[[object]]]] [[要素]] ([CODE(DOMi)@en[[[HTMLObjectElement]]]])[DEL[, [CODE(HTMLe)@en[[[applet]]]] [[要素]] ([CODE(DOMi)@en[[[HTMLAppletElement]]]])]]
では、[[プラグイン]]がスクリプト可能インターフェイスを提供する場合、
これを晒すべきであるとの規定 [SRC[[[HTML Standard]]]] があります。
;; [38] 具体的にどのような方法かは規定がありません。
[[オブジェクト]] ([[インスタンス]]) に直接相当する[[関数]]等を追加するべきなのか、
[[プロトタイプ鎖]]をいじってもよいのかは不明です。
[[インターフェイス]]は [[Web IDL]] に従う義務もありません。
;; [39] これらの[[要素]]が[[プラグイン]]を[[表現]]するかどうかは動的に変化しますから、
晒されるスクリプト可能インターフェイス (の有無) も動的に変化します。
(晒されていた[[関数]]を保持しておいて、[[要素]]が[[表現]]するものが変化した後に呼び出したらどうなるのかも謎です。)
[64] [[カスタム要素]]では、[[要素インターフェイス]]ではなく、
[CODE(DOMi)@en[HTMLElement]] (または[[子孫]]) を[[継承]]した[[クラス]]が用いられます。
;; [[自律カスタム要素]]参照。
[REFS[
- [33] [CITE@en-US[DOM Standard]] ([TIME[2013-01-25 16:15:15 +09:00]] 版) <http://dom.spec.whatwg.org/#concept-element-interface>
]REFS]
[HISTORY[
[24] [[HTML Standard]] は、その定義において示された [[DOM]] [[インターフェイス]]を実装しなければ[['''ならない''']]としています
[SRC[>>28, >>25]]。 更に [[HTML構文解析器]]の挙動についても同様の規定があります [SRC[>>26]]。
[REFS[
- [28] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-12-31 05:55:07 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#elements-in-the-dom>
- [25] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-12-31 05:55:07 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#element-dfn-dom>
- [26] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-12-31 05:55:07 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#create-an-element-for-the-token>
]REFS]
[30]
[[MathML]] は [CODE(DOMi)@en[[[MathMLElement]]]] およびその[[サブインターフェイス]]を定義しています。
[[XBL]] は [CODE(DOMi)@en[[[XBLContentElement]]]] などを定義しています。
[[Atom DOM]] は [CODE(DOMi)@en[[[AtomElement]]]] およびその[[サブインターフェイス]]を定義しています。
[[XUL]] は [CODE(DOMi)@en[[[XULElement]]]] およびその[[サブインターフェイス]]を使っています。
;; [27] [[W3C DOM]] 時代には [[DOM Core]] では特に規定がなく、
[[DOM HTML]] でどの[[インターフェイス]]と[[要素]]が対応関係にあるかが述べられていました。
[[DOM Standard]] においては2013年1月に[[要素インターフェイス]]に関する規定が追加されています [SRC[>>32]]。
[REFS[
- [32] [CITE[Define the interface part of createElement() and createElementNS(). Requ... · 8469709 · whatwg/dom]] ([TIME[2013-02-01 14:44:56 +09:00]] 版) <https://github.com/whatwg/dom/commit/84697097adb7aeb68ff0a3d80f079a9d733c62b2>
]REFS]
[35] [[MathML 2.0]] の表現要素のインターフェイス一覧
[PRE[
* MathMLElement
math MathMLMathElement
semantics MathMLSemanticsElement
annotation MathMLAnnotationElement
annotation-xml MathMLXMLAnnotationElement
mglyph MathMLGlyphElement
mspace MathMLSpaceElement
mi MathMLPresentationToken
mn MathMLPresentationToken
mtext MathMLPresentationToken
mo MathMLOperatorElement
ms MathMLStringLitElement
mrow MathMLPresentationContainer
mphantom MathMLPresentationContainer
merror MathMLPresentationContainer
mstyle MathMLStyleElement
mpadded MathMLPaddedElement
mfenced MathMLFencedElement
menclose MathMLEncloseElement
maction MathMLActionElement
mfrac MathMLFractionElement
mroot MathMLRadicalElement
msqrt MathMLRadicalElement
msub MathMLScriptElement
msup MathMLScriptElement
msubsup MathMLScriptElement
munder MathMLUnderOverElement
mover MathMLUnderOverElement
munderover MathMLUnderOverElement
mmultiscripts MathMLMultiScriptsElement
mtable MathMLTableElement
mtr MathMLTableRowElement
mlabeledtr MathMLLabeledRowElement
mtd MathMLTableCellElement
maligngroup MathMLAlignGroupElement
malignmark MathMLAlignMarkElement
]PRE]
]HISTORY]
* 歴史
-[DOM1] ''Document Object Model (Core) Level 1'' <http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-745549614>
-[DOM2] ''Document Object Model Core'' <http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614>
-[4] Method [CODE(DOMm)[normalize]] は、 DOM 2
で界面 [CODE(DOMi)[Node]] に移動しました。
- [5] [CODE(DOMi)[Node]] 界面では [CODE(DOMm)[[[hasAttributes]]]] method も定義されています (DOM 2)。 [CODE(DOMm)[hasAttribute]] との違いに注意。
[7] [CITE[IRC logs: freenode / #whatwg / 20110802]]
( ([TIME[2011-08-13 13:39:31 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20110802>
[8] [CITE[IRC logs: freenode / #whatwg / 20111011]]
( ([TIME[2011-10-12 00:08:40 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111011>
[9] [CITE@en-GB-hixie[Web Controls 1.0]]
( ([TIME[2004-11-09 08:49:52 +09:00]] 版))
<http://www.whatwg.org/specs/web-controls/current-work/#the-elementui>
[10] [CITE@en-GB-hixie[Web Applications Markup Language 1.0]]
( ([TIME[2004-04-08 02:39:12 +09:00]] 版))
<http://hixie.ch/specs/html/apps/web-apps-1#the-elementui>
** メモ
[6]
[PRE[
Interface ElementExtended
Methods
getId
Returns one of identifiers of the element. If the element does
not have any identifier, "null" is returned. Note that
an identifier might not be a valid XML name or
might not be unique in the document, particularlly in
case the original document is invalid.
No Parameter
Return Value
DOMString An identifier of the element, or "null" if there is no
identifier.
No Exception
]PRE]
* 要素の分類
[45] [[要素]]は色々に分類されます。
[FIG(list short)[
- [[要素のカテゴリー]]
- [[「all」名前付き要素]]
- [[影ホスト]]
- [[カスタム要素]]
-- [[自律カスタム要素]]
-- [[カスタム化組み込み要素]]
]FIG]
* 歴史
** 要素と要素型 (SGML)
[65] [[SGML]] は、[[クラス]]に当たるものを[DFN[要素型]]、
[[インスタンス]]に当たるものを[DFN[要素]]と呼んで、
時折区別していました。
[FIG[
[11]
>
:(284) 要素 (element):
[[文書型宣言]]によって定義される階層構造の構成要素。 [SRC[[[JIS X 4151]]-1992 3.]]
-備考1. 通常は、[[開始タグ]]及び[[終了タグ]]である[[記述的マーク]]によって[[文書実現値]]の中で識別される。
- 2. 要素は、特定の[[要素型]]に分類される。
]FIG]
[12] 循環定義のように見えますが、おそらく原文では[Q[構成要素]]が
[Q[component]] かなにかなのでしょう。
[13]
[FIG[
- [CODE(ABNF)[[DFN[要素]] := [ [[開始タグ]] ] [[内容]] [ [[終了タグ]] ] ;; JIS X 4151‐1992 (13) より]]
]FIG]
開始タグ、終了タグが省略できるのは、それぞれ特定の条件を満たす場合のみです。
詳しくはそれぞれの説明を参照してください。また、
[[強制空要素]]では内容が必ず空になります。
[FIG[
[14]
> this International Standard [INS[([[ISO/IEC 15445]]:2000)]] makes a
distinction between an individual element with a given generic identifier
and the class of all such elements. The class is called an [DFN[element type]],
the instance is called an [DFN[element]] and the generic identifier is called
an [DFN[element type name]].
[SRC[[[ISO‐HTML]] <http://purl.org/NET/ISO+IEC.15445/15445.html#ELEMENTTYPE>]]
> この国際規格は個々の要素と[[共通識別子]]とそのような要素のすべての[[級]]を区別します。
級は[DFN[要素型]]と呼び、[[実現値]]は[DFN[要素]]と呼び、
共通識別子は[DFN[要素型名]]と呼びます。
]FIG]
[FIG[
[15]
>
:[RUBYB[要素][element]]:
要素は [[DTD]] で宣言された[[文書]]の構造化の単位です。
[[要素]]の[[内容模型]]は [[DTD]] で定義されており、
追えて[[意味]]が自然言語文による要素の説明で定義されているかもしれません。 [SRC[XHTML 1.0 2.2]]
]FIG]
[FIG[
[16]
>
:[RUBYB[要素][element]]:
[[要素型]]の[[実現値]]。
[SRC[XHTML m12n Term]]
]FIG]
[FIG(quote)[
[FIGCAPTION[
[49] [[JIS X 4151]]-1992 3.
]FIGCAPTION]
>
:(285) 要素型 (element type):
同一の[[特性]]をもつ[[要素]]の組の[[型]]。
]FIG]
- 例 章, 節, 要約, 注釈, 目録など。
[FIG(quote)[
[FIGCAPTION[
[50] [[XHTML m12n]] [CSECTION[2. Terms and Definitions]]
<IW:XHTML1m12n:"terms.html#a_terms">
]FIGCAPTION]
>
:[RUBYB[要素型][element type]]:
[[要素]]、すなわち[[文書]]の[[内容]]のある意味的種別に対する[[包含子]]の定義。
]FIG]
[FIG(quote)[
[FIGCAPTION[
[51] [[ISO-HTML]] <http://purl.org/NET/ISO+IEC.15445/15445.html#ELEMENTTYPE>
]FIGCAPTION]
>
ある[[共通識別子]]を持つ要素すべての[RUBYB[[[級]]] [class]]です。
その実現値が[[要素]]です。
]FIG]
[52] [[要素型]]は、平たく言えば要素の種類。文書の意味構造を明示する言語である [[HTML]] 風に味付けした定義が >>50。
]FIG]
*** 仕様書
[REFS[
- [18] [[XHTML 1.0]]
--[CITE[2.2. General Terms]]
<IW:XHTML10:"general">
-[19] [[XHTML m12n]]
--[XHTML m12n Term] [CSECTION[2. Terms and Definitions]]
<IW:XHTML1m12n:"terms.html#a_terms">
]REFS]
*** 要素、要素型、要素型名、タグ
[17]
[DFN[[RUBY[[[要素]]][ようそ]@en[element]]]]とは、
[[文書]]の構造上の単位です。
[[要素]]は[[要素型]]の[[実現値]]です。
[DFN[[RUBY[[[要素型]]][ようそがた]@en[element type]]]]は、
[[要素]]の分類です。
[DFN[[RUBY[[[要素型名]]][ようそがためい]@en[element type name]]]]は、
[[要素型]]を識別するための[[名前]]です。
[DFN[[RUBYB[[[タグ]]]@en[tag]]]]は、
[[実体]]中で[[要素]]のはじめや終わりを識別するための記号列です。
これらはしばしば混同され、時には厳密な区別が意味を成さない場面もありますが、
多くの場合には分けて考えるべきものです。特に、
構造上の範囲である[[要素]]と、構造上の位置を示す[[タグ]]を混同しないことは重要です。
*** 体系と要素
[20] ある要素は、複数の[[体系]]における[[要素形式]]に同時に適合することができますが、
一つの体系の複数の要素形式に同時に適合することはできません。
ただし、ある要素が (その属性に関して) 複数または一つの体系の、
複数の[[属性形式]]に適合することは、 (特に禁止されていなければ) 可能です。
**** 仕様書
[REFS[
- [21] [[ISO/IEC 10744]]:1997
-- A.3.1.1 <http://www.y12.doe.gov/sgml/wg8/docs/n1920/html/clause-A.3.1.html#clause-A.3.1.1>
]REFS]
** 要素型 vs 要素
[53] 要素型と要素は、よくある[[種別]] ([[級]]; [[クラス]]) と[[実現値]] ([[インスタンス]]) の関係にあります。
要素と要素型の違いはさして重要でないことが多いので、歴史的にはいい加減に
(多くの場合は要素型のことを要素と言ったりして) 扱ってきました。
[54] [[WebSGML]] ([[ISO 8879]] [[TC2]]) では、 [[SGML]]
規格中の一部の[Q[要素]]と書かれた箇所をばっさり[Q[要素型]]に修正しています。
[55] [[XML]] は「[[要素]]」と「[[要素型]]」を明確に区別していません [SRC[@@ 要確認]]。
[56] [[HTML5]] は「[[要素型]]」という用語を用いず、[[クラス]]としても[[実現値]]としても
「[[要素]]」と呼んでいます。
** 要素型 vs 要素型の名前
[57] 要素型の名前が[[要素型名]]です。そしてその要素型名がすなわち[[共通識別子]]
([ABBR[[[GI]]][generic identifier]]) です。 SGML 的には要素型(名)よりも
[ABBR[GI][generic identifier]] の方が脚光を浴びていたので、
混同があったんですかね?
[58] SGML で[[付番]] ([CODE(SGML)[[[RANK]]]])
を使うと[[タグ]]に記述する[[名前]]を省略できますけど、
それと[Q[要素]] vs [Q[要素型]] vs [Q[[ABBR[GI]]]] vs
[Q[[[タグ名]]]]は何か関係があるのでしょうか? 詳しい人解説きぼん。
** 要素情報項目 (XML 情報集合)
[10] [[Atom]] や [[AtomPub]] の仕様書では、「[[要素]]」は[[要素情報項目]]を意味します
[SRC[>>22, >>36]]。
*** 仕様書
[REFS[
- [22] [CITE@en[RFC 5023 - The Atom Publishing Protocol]] ([TIME[2008-11-20 18:52:14 +09:00]] 版) <http://tools.ietf.org/html/rfc5023#section-2.1.1>
- [36] [CITE@en[RFC 5005 - Feed Paging and Archiving]] ([TIME[2014-03-09 00:10:19 +09:00]] 版) <https://tools.ietf.org/html/rfc5005#section-1.2>
]REFS]
* メモ
[31] [CITE@EN[Delivery Context: Client Interfaces (DCCI) 1.0]]
( ([TIME[2007-12-11 04:28:19 +09:00]] 版))
<http://www.w3.org/TR/2007/CR-DPF-20071221/#iddiv396386240>
[34] [CITE@en-US[XBL 2.0]]
( ([TIME[2012-05-03 02:23:03 +09:00]] 版))
<http://dev.w3.org/2006/xbl2/Overview.html#the-elementxbl-interface>
[41] [CITE@en[XQuery and XPath Data Model 3.0]]
( ([TIME[2014-04-08 07:00:06 +09:00]] 版))
<http://www.w3.org/TR/xpath-datamodel-3/#ElementNode>
[FIG(quote)[
[FIGCAPTION[
[42] [CITE@en-US[OPDS Catalog 1.1]]
([TIME[2015-11-19 00:28:38 +09:00]] 版)
<http://opds-spec.org/specs/opds-catalog-1-1-20110627/>
]FIGCAPTION]
> The Infoset terms "Element Information Item" and "Attribute Information Item" are shortened to "element" and "attribute" respectively. Therefore, when this specification uses the term "element", it is referring to an Element Information Item, and when it uses the term "attribute", it is referring to an Attribute Information Item.
]FIG]
[46] [CITE@en[Shadow: define slots and slotables · whatwg/dom@a2b04df]]
([TIME[2016-03-24 21:52:57 +09:00]] 版)
<https://github.com/whatwg/dom/commit/a2b04df51b4342d7617c128e80e5aa892889d2e0>
[48] [CITE@en[Add custom elements to HTML · whatwg/html@6e7eaa4]]
([TIME[2016-04-26 18:06:48 +09:00]] 版)
<https://github.com/whatwg/html/commit/6e7eaa4bd2912965fd83766f99f984f249531f3a>
[72] [CITE@en['''['''css-display''']''' Don't export 'element'; now that Bikeshed is used outsi…]]
([[fantasai]]著, [TIME[2017-01-03 21:27:55 +09:00]])
<https://github.com/w3c/csswg-drafts/commit/a9b7214d728d560feffc35d9fe7ad9f6b29ccf13>