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

Re: Mutation events replacement

From: Robin Berjon <robin@berjon.com>
Date: Thu, 30 Jun 2011 14:21:48 +0200
Cc: Webapps WG <public-webapps@w3.org>
Message-Id: <DAC1AC12-45E5-414C-8BBA-639A90D21837@berjon.com>
To: Jonas Sicking <jonas@sicking.cc>
On Jun 4, 2009, at 12:07 , Jonas Sicking 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);
>  addTextDataChangedListener(NodeDataCallback);
>  removeAttributeChangedListener(NodeDataCallback);
>  removeSubtreeAttributeChangedListener(NodeDataCallback);
>  removeChildlistChangedListener(NodeDataCallback);
>  removeSubtreeChangedListener(NodeDataCallback);
>  removeTextDataChangedListener(NodeDataCallback);

Just a thought: I wonder if it might be interesting to also support:

  addClassListChangedListener(NodeDataCallback)
  addSubtreeClassListChangedListener(NodeDataCallback)
  removeClassListChangedListener(NodeDataCallback)
  removeSubtreeClassListChangedListener(NodeDataCallback)
?

I assume that you could get the same information with the Attribute variants, but with more noise (and if using SVG, with a lot more noise). I'll admit that I haven't thought this through properly, but the thought popped up because class changes is overwhelmingly what I find myself wanting to be notified of most often.

-- 
Robin Berjon - http://berjon.com/ - @robinberjon
Received on Thursday, 30 June 2011 12:22:13 GMT

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