Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#12377 closed enhancement (fixed)

make set() automatically apply obvious DOMNode attributes, including aria attributes

Reported by: bill Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.6.0rc1
Keywords: 1.7-mobile Cc: Douglas Hays, Becky Gibson
Blocked By: Blocking:


By default, make set() automatically copy attributes to the focusNode/domNode for DOMNode native attributes like "title" and "alt". A widget can override this behavior for a particular attribute by having a custom setter (ex: _setTitleAttr) or an entry for title in the deprecated attributeMap object.

This will avoid needing _setXXXAttr() or attributeMap entries for most of these common attribute names (24 currently in the code, with more needed for HTML5, including the aria attributes like aria-labelledby.

Change History (3)

comment:1 Changed 11 years ago by bill

Keywords: 1.7-mobile added

comment:2 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed

(In [23988]) Make set() and widget constructor (by default) copy specified attribute to this.focusNode (if defined) or this.domNode otherwise. Widgets can override this behavior with custom setters, including custom setters to do nothing (i.e.: _setFooAttr: null). Only copies attributes with corresponding DOMNode attributes (ex: title, alt, aria-labelledby), and not random attribute names (ex: duration).

Fixes #12377 !strict.

comment:3 Changed 11 years ago by bill

(In [24500]) lint fixes, refs #12377 !strict.

Note: See TracTickets for help on using tickets.