Hatena::Groupjavascript

JavaScriptで遊ぶよ

 | 

2010-02-04

04:35

DOM Mutation 系のイベントは DOM 3 Events では deprecated となった。(だいぶ前の話だけど)

Warning! The MutationEvent interface was introduced in DOM Level 2 Events, but has not yet been completely and interoperably implemented across user agents. In addition, there have been critiques that the interface, as designed, introduces a performance and implementation challenge. A new specification is under development with the aim of addressing the use cases that mutation events solves, but in more performant manner. Thus, this specification describes mutation events for reference and completeness of legacy behavior, but deprecates the use of both the MutationEvent interface and the MutationNameEvent interface.

Document Object Model (DOM) Level 3 Events Specification

DOMMutation の代わりとして watchSelector (CSS セレクターを使うもの) と watchCharacterData (テキストノード用) というのが考えられているらしい。

IE の behavior: expression みたいな感じ。

こちらは非同期なので、Mutation Events の使用ケースを完全に置き換えることはできない。(まあ元々 Mutation Events が同期だったのがパフォーマンス的によくないということだったので)

上のページの下のほうにある、Replacing Traditional Mutation Events というところを見ると感じがつかめると思う。


DOM 4 Events を目指してるとか前に読んだので、しばらくは DOMMutation が使われると思う。

今まで listen だったところに watch というのがなんともアレだけど。


その他、最近になって DOMActivate と DOMFocusIn と DOMFocusOut も deprecated となった。(理由はこのへん)

I previously mentioned to you that the DOMActivate, DOMFocusIn, and 
DOMFocusOut were being considered for deprecation in DOM3 Events.  After 
looking into the matter closely and talking with various invested 
parties, I've now deprecated them in current drafts of the spec [1]. 
I've explained some of the rationale for this in the HCG [2].
XForms and Deprecating DOM* Events in DOM3 Events from Doug Schepers on 2010-02-01 (public-forms@w3.org from February 2010)

それだけ。

 |