developit / undom

🍩 1kb minimally viable DOM Document implementation
https://npm.im/undom
MIT License
668 stars 25 forks source link

Add Attribute class #14

Open tunnckoCore opened 7 years ago

tunnckoCore commented 7 years ago

One more thing is to add Attribute, which should not inherit from Node, so this would be enough

class Attribute {
  constructor (name, value, ns) {
    this.nodeType = 2
    this.name = name
    this.value = value
    this.namespaceURI = ns
  }
}

I can PR with fixes and updates addressed in couple of issues, do you want such PR?

developit commented 6 years ago

This one is probably too strict for undom - we have to err on the side of minimalism. There are a bunch of nice spec-compliant DOM implementations out there, undom's value is in being tiny (and therein sometimes less compliant).