W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2009

Re: Event Sequence

From: Bo Yang <struggleyb.nku@gmail.com>
Date: Wed, 5 Aug 2009 17:24:12 +0800
Message-ID: <41f08ee10908050224m72f9a3b6r8b5c6a9e18b73538@mail.gmail.com>
To: Olli Pettay <Olli.Pettay@helsinki.fi>
Cc: www-dom@w3.org, Doug Schepers <schepers@w3.org>
On Wed, Aug 5, 2009 at 4:30 PM, Olli Pettay<Olli.Pettay@helsinki.fi> wrote:
> On 8/5/09 8:26 AM, Bo Yang wrote:
>>
>> Hi,
>>   I got some confused by the DOM Events model. Could you please help me?
>>
>>   The DOM Events level 3 spec define two event types DOMNodeInserted
>> and DOMAttrModified. When certain Attr node get removed from its
>> ownerElement.
>
> I assume you mean DOMNodeRemoved and DOMAttrModified.
>
>> Should the implementation generate both the two events
>> or just DOMAttrModified? If it should generate two events, what is the
>> order? Thanks a lot!
>>
>> Regards!
>> Bo
>>
>>
>
> DOM 2 Events and DOM 3 Events (still a draft) differ here.
> DOM 2 talks only about child nodes, DOM 3 has the special case
> for Attr nodes. Note, per DOM 3 if Attr node is removed (or inserted)
> DOMNodeRemoved (or DOMNodeInserted) is dispatched to Attr node.
>
> So per DOM 3 DOMNodeRemoved is dispatched to Attr node and DOMAttrModified
> to its ownerElement. DOMNodeRemoved is dispatched before removing the
> attribute and DOMAttrModified after removal.
>
> In case of adding an Attr node, DOMNodeInserted is dispatched to Attr node
> after the Attr has been added to the element. DOMAttrModified is dispatched
> to the ownerElement. Order of these 2 events is not specified.

That's very detailed explanation, Thank you very much!

Regards!
Bo
Received on Wednesday, 5 August 2009 09:24:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:03 GMT