Opened 12 years ago

Closed 11 years ago

#5055 closed defect (fixed)

add apis for consistent handling of tabindex

Reported by: Becky Gibson Owned by: simonjb
Priority: high Milestone: 1.1
Component: Accessibility Version: 0.9
Keywords: Cc: davidb, alex, sjmiles
Blocked By: Blocking:

Description

the tabindex attribute is treated differently by the browser and between HTML and XTML. We should add apis for getting and setting tabindex attribute to avoid bugs due to these differences.

Attachments (1)

5055.diff (4.0 KB) - added by simonjb 11 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 11 years ago by Becky Gibson

See http://www.weba11y.com/blog/2007/11/29/fun-with-the-tabindex-attribute/ for details about tabindex

I think we should have the following apis:

setTabindex(element, value) {element.tabIndex = value;}

getTabindex(element) { element.getAttribute(tabindex); }

hasTabindex(element) { element.hasAttribute(tabindex); needs work for IE }

We also need to be consistent in templates and always specify with lowercase letter i (eye) (although tabindex is generally not in the templates any longer)

comment:2 Changed 11 years ago by Becky Gibson

Owner: changed from Becky Gibson to simonjb

comment:3 Changed 11 years ago by simonjb

Status: newassigned

comment:4 Changed 11 years ago by davidb

Cc: davidb added

Changed 11 years ago by simonjb

Attachment: 5055.diff added

comment:5 Changed 11 years ago by simonjb

Resolution: fixed
Status: assignedclosed

(In [11891]) Added new API for getting and setting HTML attributes: dojo.hasAttr(), dojo.attr(), and dojo.removeAttr(). Fixes #5055. !strict (errors outside of my changes)

comment:6 Changed 11 years ago by simonjb

(In [11892]) Minor doc fix. Refs #5055. !strict

comment:7 Changed 11 years ago by Adam Peller

Cc: alex sjmiles added
Resolution: fixed
Status: closedreopened

We need to confirm that this belongs in _base.

comment:8 Changed 11 years ago by simonjb

(In [11895]) Fixed up the _base/html.html unit test file to pass on Opera 9. I disabled some tests that cannot pass (tabindex="-1"). Refs #5055.

comment:9 Changed 11 years ago by simonjb

(In [11981]) Small code simplification for dojo.hasAttr(). Refs #5055. !strict

comment:10 Changed 11 years ago by simonjb

In December I wrote up a post to the Dojo contributors mailing list examining the size impact of the API:

http://dojotoolkit.org/pipermail/dojo-contributors/2007-December/008530.html

I received only one response, which asked that the code be made smaller but stay in _base (http://dojotoolkit.org/pipermail/dojo-contributors/2007-December/008531.html). I have made some small size reductions and I think I will close this ticket, leaving the API in _base.

If we want to look again at moving it before 1.1 we could open a new ticket.

comment:11 Changed 11 years ago by simonjb

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.