Closed asportnoy closed 9 months ago
to be honest I have zero time or interest in this and the PR would likely penalize perf for everyone for something nobody cared for years at this point ... I am afraid this is a won't fix.
Sorry for leaving a comment on a closed issue, but this should probably be mentioned in the README, or at least get a tag with "good first issue". I agree with you that it's pointless to introduce string manipulation that just slows this down. It can take a while to debug the source of a problem with this caveat, though.
In my case HTML gets passed around, and at some certain points the case changes for the attributes. The solution was to make these uniform everywhere, but I wouldn't have known this without this issue.
the thing is that with both SVG and XML parser stuff would break if matches are case-insensitive so that for this weird case I need to change and check the document type before matching against a lower cased attribute and all this because you can't write document.querySelector('div[SOME-ATTRIBUTE],div[some-attribute]')
when that's really strictly needed?
this project goal is to work but if I need to take care of all the possible legacy quirks then I say: use JSDOM instead!
I don't want to destroy performance and become another JSDOM for sloppy stuff easy to workaround, I hope this makes at least sense, even if it's not super welcomed by everyone (I suppose).
P.S. agreed this might be in the README, happy to land a PR, if any, or I'll work on this when I'll find some time, thanks!
Linkedom currently treates attributes as case sensitive. It is currently impossible to use
querySelector
attribute selectors if the attribute is uppercase. In addition,getAttribute
is currently case sensitive and will only return if the cases match. I'm guessing these two issues are related.Live demo: https://runkit.com/embed/vz4doq4cyr3v
In a real browser, these all work: https://jsfiddle.net/7vp3m2r4/
Thanks!