medialize / ally.js

JavaScript library to help modern web applications with accessibility concerns
http://allyjs.io/
MIT License
1.53k stars 82 forks source link

Remove domtoken list #148

Closed jantimon closed 8 years ago

jantimon commented 8 years ago

This pull request removes the domtoken list dependency and implements the class adding/removing by its own.

jantimon commented 8 years ago

@rodneyrehm could you help me out with this one? https://travis-ci.org/medialize/ally.js/builds/154397276#L2877

I implemented everything else but I am not sure if this is really a bug in this pull request

rodneyrehm commented 8 years ago

Yeah debugging things right off the tests is not a great experience :/

toggle-class.js:21 Uncaught TypeError: element.className.split is not a function

SVG elements may not only not have classList, they might also provide you with SVGAnimatedString when accessing className. This problem can most easily be resolved by using elemen.getAttribute('class') instead of element.className.

jantimon commented 8 years ago

Took the getClass code from https://github.com/jquery/jquery/blob/305f193aa57014dc7d8fa0739a3fefd47166cd44/src/attributes/classes.js#L12-L14 Looks like it works now.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.01%) to 98.883% when pulling e994487e957c27a40b9b6ec451100172afa59935 on jantimon:feature/remove-domtokenlist-shim into 1147c0a0f97e2a5a90eb3f83c04094335053ec10 on medialize:master.