Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

hasAttribute is error with uppercase attribute name #431

Closed
yiminghe opened this Issue Apr 5, 2012 · 2 comments

Comments

Projects
None yet
3 participants

yiminghe commented Apr 5, 2012

demo:

    document.body.innerHTML="<span data-e2='2' data-F2='3' id='t'></span>";    
    console.log(document.getElementById("t").hasAttribute("data-e2"));
    console.log(document.getElementById("t").hasAttribute("data-F2"));

expected:

true , true

actual result:

true , false

Collaborator

Sebmaster commented Sep 19, 2014

I wrote a test case for this: https://github.com/Sebmaster/jsdom/tree/fix/attribute-case

Seems like all attributes in HTML should just be handled lowercase, I tried a quick patch but broke a lot of tests with it and haven't looked much further into it yet.

@AVGP AVGP pushed a commit to AVGP/jsdom that referenced this issue Dec 3, 2014

Martin Naumann Fiddling in support for case insensitive hasAttribute. Fixes #431 5d5a781

AVGP commented Dec 3, 2014

I picked up your test, @Sebmaster and wrote a quick patch that doesn't seem to break any tests. It seems a bit silly but it's minimal impact. If you come up with a better thing, feel free to go for it :)

@domenic domenic closed this in 3f4b65d Dec 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment