Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

el.attributes incorrectly defined #53

Closed
ianb opened this issue Jul 27, 2015 · 2 comments
Closed

el.attributes incorrectly defined #53

ianb opened this issue Jul 27, 2015 · 2 comments

Comments

@ianb
Copy link

ianb commented Jul 27, 2015

It appears an element's .attributes property isn't a list-like object, but is instead a mapping. It does have a .length property, but you can't index the attributes. Example:

var domino = require("domino");
var assert = require("assert");

var window = domino.createWindow('<a id="test">test</a>');
var el = window.document.getElementById("test");

// This succeeds:
assert(el.attributes.length == 1);
// The rest fail:
assert(el.attributes[0].name == "id");
assert(el.attributes[0].value == "test");
assert(el.attributes[0].nodeName == "id");
assert(el.attributes[0].nodeValue == "test");
// I believe currently el.attributes.id == "test", but it shouldn't:
assert(el.attributes.id === undefined);
@ghost
Copy link

ghost commented Jul 28, 2015

Possibly related to #27?

@cscott
Copy link
Collaborator

cscott commented Jul 28, 2015

See cf8f7ae

@cscott cscott closed this as completed Jul 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants