W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

Re: Mutation events replacement

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 4 Jun 2009 04:42:08 -0700
Message-ID: <63df84f0906040442k2ebfc162i2611fd4634e809b6@mail.gmail.com>
To: mozer <xmlizer@gmail.com>
Cc: Webapps WG <public-webapps@w3.org>
On Thu, Jun 4, 2009 at 4:37 AM, mozer <xmlizer@gmail.com> wrote:
>
>
> On Thu, Jun 4, 2009 at 12:07 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>>
>> Here's an API that might work:
>>
>> The following methods are added to the Document, Element and
>> DocumentFragment interfaces:
>>
>>  addAttributeChangedListener(NodeDataCallback);
>>  addSubtreeAttributeChangedListener(NodeDataCallback);
>>  addChildlistChangedListener(NodeDataCallback);
>>  addSubtreeChangedListener(NodeDataCallback);
>
> I would go for
> addSubtreeElementChangedListener for this one since a modification to an
> attribute in the subtree does not trigger it

the 'SubtreeAttributeChanged' callbacks are called whenever an
attribute is the subtree below the node where the callback is
registered is changed. Is that not what you need? I.e. in a DOM like

<body>
  <div>
    <p>
      here's some text
    </p>
  </div>
</body>

If I call  div.addSubtreeAttributeChangedListener(doStuff);

then doStuff is called if someone sets an attribute on the <p> element.

>> And when Text/CDATASection/ProcessingInstruction
>
> Please add "Comment" too

Yup.

/ Jonas
Received on Thursday, 4 June 2009 11:43:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:31 GMT