Financial-Times / ftdomdelegate

Create and manage a DOM event delegator
MIT License
320 stars 36 forks source link

May be able to remove or we may have broken case-sensitive logic #47

Closed matthew-andrews closed 10 years ago

matthew-andrews commented 10 years ago

@orangemug ... I just re-discovered this code:- https://github.com/ftlabs/ftdomdelegate/blob/master/lib/delegate.js#L185

Did we break this when I merged: https://github.com/ftlabs/ftdomdelegate/pull/45 ?

It makes sense that SVG is case sensitive (it's XML based) but not modern HTML.

Actually do you know what, I don't think we should be supporting the following to be different:-

del.on('click', 'DIV', function() {
  console.log('i\'m a capital div');
});
del.on('click', 'div', function() {
  console.log('i\'m a lowercase div');
});

Do you think it would be sensible to just lowercase all the tags and remove this (now redundant) logic?

orangemug commented 10 years ago

Can you think of any use case where you'd want case sensitive tag names? (I can't)

matthew-andrews commented 10 years ago

I added some commits to my pull request (bad matt). Turns out we weren't even testing for it either...

https://github.com/ftlabs/ftdomdelegate/pull/46

matthew-andrews commented 10 years ago

I think this is fixed.