

* ownerElement 属性 (DOM Attr 界面)

[1] 読取専用属性 
[CODE[[VAR(DOMi)[[[Attr]]]].[CODE(DOMa)[ownerElement]]]]
([[DOM 2]]) の値は、その[[属性]]の付随する[[要素]]です。
その属性が使われていないときには、 [CODE(DOM)[null]]
となります。

[2] DOM では、属性節と要素節は親子の関係には''ない''ので、
[CODE(DOMa)[[[parentNode]]]] 属性は使えません。
([CODE(DOM)[null]] になっているはずです。)

[3] この属性の値は直接変更できません。
[CODE(DOMm)[[[appendChild]]]] などを使って属性節そのものを操作することで、
間接的に変更できます。

- [DOM2] ''Document Object Model Core'' <http://www.w3.org/TR/DOM-Level-2-Core/core.html#Attr-ownerElement>

[4]
'''XML情報集合との関係''':
[CODE(DOMa)@en[[[ownerElement]]]][[属性]]は[[XML情報集合]]の[CODE(InfoProp)[[[所有者要素]]]][[特性]]に相当します。
([[名無しさん]] [sage])


[5]
'''XPath 1.0との関係''':
[[XPath 1.0]]の[[データ・モデル]]には[CODE(DOMa)@en[[[ownerElement]]]]と同じものはなく、[[要素節点]]が[[属性節点]]の[[親]]になり得ます。
ですから、[CODE(XPath)@en[[[parent]]]][[軸]]が[CODE(DOMa)@en[[[ownerElement]]]]相当となります。

([[名無しさん]] [sage])


[[#comment]]


* メモ

[6] [CITE@en[Re: Change to Attr interface in light of XPath]]
( ([[Jonas Sicking]] 著, [TIME[2014-03-19 05:25:26 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-dom/2014JanMar/0169.html>

[7] [CITE[Bring back Attr.prototype.ownerElement. https://www.w3.org/Bugs/Public/s... · db19f1c · whatwg/dom]]
( ([TIME[2014-04-11 23:53:05 +09:00]] 版))
<https://github.com/whatwg/dom/commit/db19f1c8de8fb78e2ef1218b45a7c967b6a5822d>

[8] [CITE[remove Attr.prototype.ownerElement again; it was not actually implemente... · 8b61686 · whatwg/dom]]
( ([TIME[2014-04-11 23:53:14 +09:00]] 版))
<https://github.com/whatwg/dom/commit/8b6168643a32d819758567d6f5fae6bd991783ed>

[9] [CITE@en[Bug 25086 – Attr should retain ownerElement property]]
( ([TIME[2014-04-11 23:53:26 +09:00]] 版))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=25086>

[10] [CITE@en[Bug 25021 – Reintroduction of Attribute ownerElement]]
( ([TIME[2014-04-12 11:35:58 +09:00]] 版))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=25021>

[11] [CITE[IRC logs: freenode / #whatwg / 20140417]]
( ([TIME[2014-04-18 14:29:25 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140417#l-471>

[12] [CITE@en[Bug 25086 – AttrExodus: Attr should retain ownerElement property]]
( ([TIME[2014-08-19 08:41:03 +09:00]] 版))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=25086>

[13] [CITE@en[Put Attr.prototype.ownerElement back; give Attr.prototype.value a setter... · f64b0c8 · whatwg/dom]]
( ([TIME[2014-08-21 13:17:29 +09:00]] 版))
<https://github.com/whatwg/dom/commit/f64b0c82896d68ad534544ed8109ac41c175840d>