- From: mozer <xmlizer@gmail.com>
- Date: Thu, 4 Jun 2009 13:46:01 +0200
- To: Jonas Sicking <jonas@sicking.cc>
- Cc: Webapps WG <public-webapps@w3.org>
- Message-ID: <21d9ade60906040446y50ad80e1x3e60f8ce16ec2a2b@mail.gmail.com>
On Thu, Jun 4, 2009 at 1:42 PM, Jonas Sicking <jonas@sicking.cc> wrote: > 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. We're in agreement here ! That's why I would go for a name stating explicitly that it is about ELEMENT in the subtree and not Whatever in the subtree > > > >> And when Text/CDATASection/ProcessingInstruction > > > > Please add "Comment" too > > Yup. > > / Jonas > Xmlizer
Received on Thursday, 4 June 2009 11:46:39 UTC