W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2010

Re: Deprecation of DOMAttrModified

From: James Craig <jcraig@apple.com>
Date: Wed, 10 Feb 2010 13:10:19 -0800
Cc: "w3c-wai-pf@w3.org PF" <w3c-wai-pf@w3.org>, "www-dom@w3.org" <www-dom@w3.org>, public-hypertext-cg@w3.org
Message-Id: <C09E46F6-859C-42C9-BF02-15AE2ADC452B@apple.com>
To: Doug Schepers <schepers@w3.org>
On Feb 9, 2010, at 6:11 PM, Doug Schepers wrote:

> The benefit to the selectors-based proposal, in my opinion, is that you can listen for specific values in the notification registration itself.  For example, an author could use the following code to call functions based on the attribute value, rather than embedding that switch logic in the function:
> 
> document.watchSelector("[aria-expanded=true]", doSomething);
> document.watchSelector("[aria-expanded=false]", doSomethingElse);

This seems like a pretty good idea to me. One question though:

This appears to be a good solution for attributes that have a limited number of values (e.g. true/false) but what about attributes that may contain IDREFs or string values. For example, if the 'active descendant' in a list of 10,000 items changes, does the proposed model require me to watch each possible value?

  this.listbox.watchSelector('[aria-activedescendant="item1"]', this.handleActiveDescendantChanged);
  this.listbox.watchSelector('[aria-activedescendant="item2"]', this.handleActiveDescendantChanged);
  this.listbox.watchSelector('[aria-activedescendant="item3"]', this.handleActiveDescendantChanged);
   n 
  this.listbox.watchSelector('[aria-activedescendant="item10000"]', this.handleActiveDescendantChanged);

Or, could I just watch for a change in that value?

  this.listbox.watchAttribute('aria-activedescendant', this.handleActiveDescendantChanged);

Thoughts?


> We will continue to develop these ideas, and hope to have a working spec that can be implemented as a replacement for 'DOMAttributeModified' very soon.  In any case, we will not recommend that 'DOMAttributeModified' is removed from implementations until the replacement is ready... this is the whole point of deprecating it, rather than removing it.
> 
> I hope this addresses your concern.
> 
> [1] http://www.w3.org/2008/webapps/wiki/MutationReplacement#AttributeChanged
> [2] http://www.w3.org/2008/webapps/wiki/MutationReplacement#Replacing_Traditional_Mutation_Events

It does. Thanks.
Received on Wednesday, 10 February 2010 21:10:55 GMT

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