Closed mwiencek closed 9 years ago
Do we really need comments.
I wanted to keep this minimal; mostly aimed at small libraries that use a minimal set of DOM features.
Currently this is heavily used by virtual-dom.
@Raynos A lot of people won't need them, so up to you. My only arguments in favor would be:
If you still don't like them I can keep them in my fork, I suppose :)
@Raynos thanks for merging, I'll keep the firstChild/nextSibling getters in my fork for now and avoid submitting more bloat upstream unless it's generally useful ;)
Trying to get the bare minimum functionality needed for my knockout.js-related tests to run, and this makes them not immediately throw at least. (Yeah...their template engine gives semantics to HTML comments.)
This builds on the getElementsByTagName PR since that should only return DOMElement nodes if you use
*
.I kept the output of Comment.prototype.toString how it is IRL(?) by returning
[object Comment]
, but I'm not sure if you want to emulate things like that. Tests are failing in the browser because things like[object HTMLDivElement]
are expected in places, so dunno :)I saw in https://github.com/Raynos/min-document/issues/14 that you want to avoid getters, but it seems those are needed for firstChild/nextSibling/etc. too...not that I need to implement those right now.