-
Notifications
You must be signed in to change notification settings - Fork 4
/
301.txt
113 lines (91 loc) · 4.33 KB
/
301.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
* 仕様書
[REFS[
- [11] [CITE@en[DOM Standard]] ([TIME[2015-10-21 01:26:21 +09:00]] 版) <https://dom.spec.whatwg.org/#dom-document-getelementsbytagname>
- [12] [CITE@en[DOM Standard]] ([TIME[2015-10-21 01:26:21 +09:00]] 版) <https://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens>
- [9] [CITE@en[DOM Standard]] ([TIME[2015-10-21 01:26:21 +09:00]] 版) <https://dom.spec.whatwg.org/#dom-element-getelementsbytagname>
- [10] [CITE@en[DOM Standard]] ([TIME[2015-10-21 01:26:21 +09:00]] 版) <https://dom.spec.whatwg.org/#dom-element-getelementsbytagnamens>
]REFS]
* メモ
[2]
[[WinIE 6]] ([[Windows XP]] [[SP]] 2) にて。
[PRE(XML example)[
<root xmlns:a="http://a.example/">
<node>
<a:leaf/>
</node>
</root>
]PRE]
この文書において
[SAMP(DOM)[[CODE(DOMm)[getElementsByTagName]] ('leaf')]]
とすると [CODE(XMLe)[leaf]] 要素が得られる。
(この時点で [[DOM]] 的には異常だが。)
[PRE(XML example)[
<root>
<node xmlns:a="http://a.example/">
<a:leaf/>
</node>
</root>
]PRE]
等価な文書だが [WEAK[([[XML情報集合]]的には少しだけ異なるが)]]、
[SAMP(DOM)[[CODE(DOMm)[getElementsByTagName]] ('leaf')]]
しても [CODE(XMLe)[leaf]]
要素は得られ''ない''。
[PRE(XML example)[
<root>
<node>
<a:leaf xmlns:a="http://a.example/"/>
</node>
</root>
]PRE]
これでも得られ''ない''。
ちなみに、
[PRE(XML example)[
<?xml-stylesheet href="style" type="text/css" media="all"?>
<root>
<node>
<anotherLeaf/>
<a:leaf/>
</node>
</root>
]PRE]
のような[[名前空間整形式]]でない文書を与えると、
[CODE(XMLe)[anotherLeaf]]
の部分まで処理した後にエラー・メッセージが挿入されたものがレンダリングされる。
([[名無しさん]] [WEAK[2005-04-17 04:18:08 +00:00]])
[3]
[CODE(DOMi)@en[[[Document]]]] の[[子孫]]でない[[節点]]は[Q[含まれている]]ことになるのでしょうか?
[[DOM水準2]]には[Q[[[深さ優先探索]]]]、
[[DOM水準3]]には[Q[[[文書順]]]]とあり、
[[DOM水準3]]の [CODE(DOMm)@en[[[compareDocumentPosition]]]]
を考慮しても、含まれていることにはならないように思えます。
では、 [CODE(DOMi)@en[[[Entity]]]] の[[子孫]]は含まれているのでしょうか。
([[名無しさん]])
[4]
第一引数の名前は、 [CODE(DOMi)@en[[[Document]]]]
では [CODE(DOMp)@en[[[tagname]]]] なのですが、
[CODE(DOMi)@en[[[Element]]]] では
[CODE(DOMp)@en[[[name]]]] です。
[5] [CITE[IRC logs: freenode / #whatwg / 20121128]]
( ([TIME[2012-12-09 02:18:35 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20121128#l-539>
[6] [CITE@en[Call out descendants for getElementsBy* in general · c3b4419 · whatwg/dom]]
( ([TIME[2014-11-23 18:31:36 +09:00]] 版))
<https://github.com/whatwg/dom/commit/c3b441965c013427b3936014205a5149c9971837>
[1] [CITE@en[getElementsByTagName(): localName vs tagName]]
([[Anne van Kesteren]] 著, [TIME[2015-10-12 16:53:19 +09:00]] 版)
<https://lists.w3.org/Archives/Public/www-archive/2015Oct/0008.html>
[7] [CITE@en[492933 – getElementsByTagName should match on localName not tagName (for interop)]]
([TIME[2015-10-19 14:22:53 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=492933>
[8] [CITE@en[Fix #90 better: only branch on type to allow more caching · whatwg/dom@10c9c14]] ([TIME[2015-10-23 11:56:21 +09:00]] 版) <https://github.com/whatwg/dom/commit/10c9c14a00897664af4fbb426939a046f8e79f4f>
[13] [[Chrome]] で ([[HTML文書]]と[[XML文書]]で種別が異なる) 他の[[文書]]に [[adopt]]
する前後で取得した [CODE(DOMm)@en[[[getElementsByTagName]]]] の
[CODE(DOMi)@en[[[HTMLCollection]]]] は、異なります。
元の[[文書]]に再び [[adopt]] すると、前と同じ [CODE(DOMi)@en[[[HTMLCollection]]]]
がまた得られます。[[メソッド]]がどのオブジェクトを返すかに関わらず、
既に得られた [CODE(DOMi)@en[[[HTMLCollection]]]] は正常に動作します ([[文書]]が変わっても
[[live]] のままです)。
[TIME[2015-10-23T03:06:46.400Z]]
[14] [CITE@en[Make it clear getElementsByTagName operates on descendants · whatwg/dom@e012ffe]]
([TIME[2016-01-02 11:23:04 +09:00]] 版)
<https://github.com/whatwg/dom/commit/e012ffee0c806331c20f534371ae4e0c0fff1e28>