Raynos / min-document

A minimal DOM implementation
MIT License
109 stars 27 forks source link

Fix behavior of getElement* methods #27

Closed mwiencek closed 9 years ago

mwiencek commented 9 years ago
  1. Makes it so you can pass them to map()
  2. Makes the document ones start from the document, not the body

For (2), instead of passing the start node as the second argument, the methods assume this is the start node. As it turns out, removing the second argument also fixes (1), because it no longer conflicts with the map index variable.

This does change the API but I dunno if anyone was legitimately using the parent arguments since they wouldn't have worked in the browser...

Raynos commented 9 years ago

Lgtm. Consider putting the methods in Dom-element.js instead of seperate files

Raynos commented 9 years ago

Feel free to merge

mwiencek commented 9 years ago

Moved to dom-element.js :+1:

$ git diff master... --stat *.js
 document.js    | 67 ++++++++-----------------------------------------------------------
 dom-element.js | 30 ++++++++++++++++++++++++++++--
 2 files changed, 36 insertions(+), 61 deletions(-)